/* ============================================================
   MBEX — Telegram Mini App  ·  Design tokens & base styles
   Clean fintech / banking-grade. Dark + light themes.
   ============================================================ */

@font-face {
  font-family: "Onest";
  src: url("/static/miniapp-new/fonts/Onest-Variable.woff2?v=20260716-calc-cta") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-ui: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-num: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --violet: #8d5cff;
  --violet-2: #612bff;
  --blue: #2f74ff;
  --green: #23d18b;
  --yellow: #ffd23f;
  --danger: #ff5a7a;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --tap: 48px;
  --tg-native-header-offset: 116px;
}

/* ---------- DARK (default) ---------- */
[data-theme="dark"] {
  --bg:         #05060b;
  --bg-grad:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 28%),
    linear-gradient(135deg, transparent 0%, rgba(58,119,255,0.16) 18%, transparent 42%),
    linear-gradient(180deg, #070812, #06070c 55%, #040509);
  --elev:       rgba(18,19,33,0.92);
  --surface:    rgba(18,19,33,0.78);
  --surface-2:  rgba(25,27,45,0.86);
  --surface-3:  rgba(34,36,57,0.90);
  --border:     rgba(174,155,255,0.14);
  --border-2:   rgba(145,101,255,0.42);
  --hairline:   rgba(174,155,255,0.10);

  --text:   #f7f8ff;
  --text-2: #a4a0b7;
  --text-3: #6f6a82;

  --accent:      var(--violet);
  --accent-2:    var(--blue);
  --accent-soft: rgba(141,92,255,0.16);
  --accent-ring: rgba(141,92,255,0.30);

  --pos:      var(--green);
  --pos-soft: rgba(35,209,139,0.15);
  --neg:      var(--danger);
  --neg-soft: rgba(255,90,122,0.15);
  --warn:     var(--yellow);
  --warn-soft: rgba(255,210,63,0.13);

  --usdt: #26a17b;

  --tg-header: transparent;
  --tg-foot:   #06070d;

  --shadow-card: 0 18px 34px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.07);
  --shadow-pop:  0 18px 40px rgba(0,0,0,0.55);
  --on-accent: #ffffff;
  --skel: rgba(255,255,255,0.05);
}

/* ---------- LIGHT ---------- */
[data-theme="light"] {
  --bg:        #eef1f6;
  --bg-grad:   linear-gradient(180deg, #ffffff 0%, #eef1f6 55%);
  --elev:      #ffffff;
  --surface:   #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9eef5;
  --border:    #e4e9f1;
  --border-2:  #d7deea;
  --hairline:  rgba(13,24,40,0.07);

  --text:   #0d1722;
  --text-2: #5c6776;
  --text-3: #93a0b0;

  --accent:      #2069e8;
  --accent-2:    #1559d0;
  --accent-soft: rgba(32,105,232,0.10);
  --accent-ring: rgba(32,105,232,0.22);

  --pos:      #12a06a;
  --pos-soft: rgba(18,160,106,0.12);
  --neg:      #e23b4a;
  --neg-soft: rgba(226,59,74,0.10);
  --warn:     #d98309;
  --warn-soft: rgba(217,131,9,0.12);

  --usdt: #26a17b;

  --tg-header: #ffffff;
  --tg-foot:   #e9edf3;

  --shadow-card: 0 1px 2px rgba(16,24,40,0.04), 0 6px 16px rgba(16,24,40,0.05);
  --shadow-pop:  0 18px 40px rgba(16,24,40,0.18);
  --on-accent: #ffffff;
  --skel: rgba(13,24,40,0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--font-ui);
  background:
    linear-gradient(180deg, rgba(103,77,255,0.20), transparent 32%),
    linear-gradient(145deg, #020308, #080913 54%, #020308);
  color: #fff;
  overflow: hidden;
}

#root { width: 100%; height: 100%; }

.stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 24px;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(74,49,175,0.14), transparent),
    linear-gradient(180deg, rgba(27,161,255,0.06), transparent 48%);
}

/* ---------- Device shell ---------- */
.device {
  position: relative;
  z-index: 1;
  width: min(390px, calc(100vw - 48px));
  height: min(844px, calc(100vh - 48px));
  aspect-ratio: 390 / 844;
  border-radius: 46px;
  background: #090a0f;
  padding: 5px;
  box-shadow:
    0 36px 90px rgba(0,0,0,0.72),
    inset 0 0 0 2px rgba(255,255,255,0.08),
    0 0 0 1px rgba(145,101,255,0.22);
  flex-shrink: 0;
}
.screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 41px;
  overflow: hidden;
  background: var(--bg);
  background-image: var(--bg-grad);
  display: flex; flex-direction: column;
  font-family: var(--font-ui);
  color: var(--text);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 86px 22px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(141,92,255,0.52), transparent);
  pointer-events: none;
  z-index: 0;
}

/* iOS status bar */
.statusbar {
  height: 44px; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px 9px;
  position: relative; z-index: 30;
  background: var(--tg-header);
}
.statusbar .time { font-weight: 800; font-size: 15px; color: var(--text); letter-spacing: 0; }
.statusbar .glyphs { display: flex; align-items: center; gap: 6px; color: var(--text); }
.island {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, #18a1ff, #185dff);
  box-shadow: 0 10px 26px rgba(24,93,255,0.35);
  z-index: 40;
}

/* Telegram header */
.tg-header {
  flex-shrink: 0;
  min-height: 82px;
  background: var(--tg-header);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px 14px;
  border-bottom: 0;
  position: relative; z-index: 20;
}
.tg-brand { min-width: 0; flex-shrink: 0; }
.tg-title { font-size: 17px; font-weight: 800; letter-spacing: 0; color: var(--text); white-space: nowrap; }
.tg-brand .tg-title { font-size: 32px; line-height: 1; font-style: normal; }
.tg-brand .tg-title span { color: var(--accent); text-shadow: 0 0 20px rgba(141,92,255,0.78); }
.tg-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.tg-iconbtn {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  border: 1px solid rgba(174,155,255,0.14);
  background: rgba(255,255,255,0.055);
}
.tg-iconbtn:active { background: rgba(255,255,255,0.095); color: var(--text); }
.tg-back {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  cursor: pointer; color: var(--text); margin-left: 0;
  border: 1px solid rgba(174,155,255,0.14);
  background: rgba(255,255,255,0.055);
}
.tg-back:active { background: rgba(255,255,255,0.095); }

/* App scroll */
.app-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
}
.app-scroll::-webkit-scrollbar { width: 0; }
.app-scroll.has-tabbar {
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}
.body { padding: 0 22px 22px; }
.pad { padding: 0 22px 22px; }

/* Telegram bottom hint */
.tg-foot {
  flex-shrink: 0; height: 24px;
  background: var(--tg-foot);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text-3); font-weight: 600;
}

/* Bottom tab nav */
.tabbar {
  position: absolute;
  right: 18px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 18px;
  z-index: 3;
  display: grid; align-items: center;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(8,9,16,0.94);
  border-top: 1px solid var(--hairline);
  padding: 6px 18px 9px;
}
.tab {
  min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 6px 0; cursor: pointer; color: var(--text-3);
  font-size: 12px; font-weight: 800; letter-spacing: 0;
  border-radius: 14px;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.tab.active { color: var(--accent); filter: drop-shadow(0 0 12px rgba(141,92,255,0.52)); }
.tab svg { display: block; }

/* ---------- Type ---------- */
.h1 { font-size: 22px; font-weight: 800; letter-spacing: 0; margin: 0; color: var(--text); }
.h2 { font-size: 17px; font-weight: 800; letter-spacing: 0; margin: 0; color: var(--text); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.052), rgba(255,255,255,0.02)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.card-2 {
  background: rgba(255,255,255,0.032);
  border: 1px solid rgba(255,255,255,0.075);
  border-color: var(--border);
}
.card-pad { padding: 16px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; cursor: pointer; font-family: var(--font-ui);
  font-weight: 800; font-size: 16px; border-radius: var(--r-md);
  height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; transition: transform .08s ease, filter .15s ease, background .15s ease;
  letter-spacing: .2px; white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--violet-2), var(--blue));
  color: var(--on-accent);
  box-shadow: 0 16px 34px rgba(47,116,255,0.34);
}
.btn-primary:active { filter: brightness(1.08); }
.btn-primary:disabled { background: var(--surface-3); color: var(--text-3); cursor: default; transform: none; }
.btn-soft { background: rgba(141,92,255,0.14); color: #c9b9ff; border: 1px solid rgba(174,155,255,0.14); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(174,155,255,0.14); }
.btn-sm { height: 44px; font-size: 14px; border-radius: var(--r-sm); }

/* ---------- Segmented control ---------- */
.seg {
  display: flex; background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.075);
  border-radius: 17px; padding: 4px; gap: 4px;
}
.seg-item {
  flex: 1; min-height: 44px; text-align: center; padding: 0 4px; border-radius: 13px;
  font-size: 14px; font-weight: 800; color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
}
.seg-item.active {
  background: linear-gradient(135deg, var(--violet-2), var(--blue));
  color: #fff;
  box-shadow: 0 10px 26px rgba(72,78,255,0.35);
}
.seg-item.active.buy,
.seg-item.active.sell { color: #fff; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.pill-pos { background: var(--pos-soft); color: var(--pos); }
.pill-neg { background: var(--neg-soft); color: var(--neg); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: var(--surface-2); color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* coin token */
.coin {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.coin-usdt { background: linear-gradient(135deg, #30d997, #159b72); }
.coin-rub  { background: linear-gradient(135deg, #7f8cff, #315cff); }

/* ---------- Inputs ---------- */
.amount-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.amount-input {
  border: none; background: transparent; outline: none; width: 100%;
  font-family: var(--font-num); font-weight: 600; font-size: 30px; color: var(--text);
  letter-spacing: 0;
}
.amount-input::placeholder { color: var(--text-3); }
.cur-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; padding: 6px 12px 6px 6px;
  font-weight: 800; font-size: 15px; color: var(--text); white-space: nowrap;
}
.field {
  width: 100%; height: 52px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  padding: 0 14px; outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; display: block; white-space: nowrap; }

/* swap button */
.swapbtn {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(21,18,43,0.96);
  border: 1px solid var(--border-2); display: grid; place-items: center; cursor: pointer;
  color: var(--accent); transition: transform .25s ease;
  box-shadow: 0 0 25px rgba(141,92,255,0.32);
}
.swapbtn:active { transform: rotate(180deg); }

/* list rows */
.row {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  cursor: pointer; position: relative;
}
.row:active { background: var(--surface-2); }
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 81px; right: 16px; height: 1px; background: var(--hairline);
}
.row-ic {
  width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,0.055);
  display: grid; place-items: center; color: var(--text-2); flex-shrink: 0;
}
.row-ic.accent { background: rgba(141,92,255,0.14); color: #c9b9ff; }
.chev { color: var(--text-3); flex-shrink: 0; margin-left: auto; }

/* dividers */
.hr { height: 1px; background: var(--hairline); border: none; margin: 0; }

/* stepper */
.steps { display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3); font-size: 12px; font-weight: 800; z-index: 2;
}
.step.done .step-dot { background: var(--pos); color: #fff; }
.step.active .step-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.step-line { position: absolute; top: 13px; left: 50%; right: -50%; height: 2px; background: var(--surface-3); z-index: 1; }
.step.done .step-line { background: var(--pos); }
.step-lbl { font-size: 10px; font-weight: 700; color: var(--text-3); text-align: center; }
.step.active .step-lbl, .step.done .step-lbl { color: var(--text); }

/* misc */
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; }
.grow { flex: 1; }

.skel { background: var(--skel); border-radius: 6px; }

@keyframes mbexpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

@keyframes appViewLeaveForward {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(-8px, 0, 0) scale(.996); }
}

@keyframes appViewLeaveBack {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(8px, 0, 0) scale(.996); }
}

@keyframes appViewEnterForward {
  from { opacity: 0; transform: translate3d(14px, 0, 0) scale(.996); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes appViewEnterBack {
  from { opacity: 0; transform: translate3d(-14px, 0, 0) scale(.996); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.app-view {
  min-height: 100%;
  transform-origin: 50% 30%;
}

.app-view.is-leaving {
  pointer-events: none;
  will-change: opacity, transform;
  animation-duration: 110ms;
  animation-timing-function: cubic-bezier(.4, 0, 1, 1);
  animation-fill-mode: both;
}

.app-view.is-leaving.is-forward { animation-name: appViewLeaveForward; }
.app-view.is-leaving.is-back { animation-name: appViewLeaveBack; }

.app-view.is-entering {
  will-change: opacity, transform;
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(.16, 1, .3, 1);
  animation-fill-mode: both;
}

.app-view.is-entering.is-forward { animation-name: appViewEnterForward; }
.app-view.is-entering.is-back { animation-name: appViewEnterBack; }

@media (prefers-reduced-motion: reduce) {
  .app-view.is-leaving,
  .app-view.is-entering {
    animation: none;
  }
}

/* QR placeholder */
.qr { width: 150px; height: 150px; border-radius: 14px; background: #fff; padding: 10px; }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 10px; color: var(--text-2); font-size: 12px; font-weight: 700;
}

/* sparkline fill */
.spark-fill-pos { fill: var(--pos); opacity: .12; }
.spark-line-pos { stroke: var(--pos); }
.spark-fill-acc { fill: var(--accent); opacity: .12; }
.spark-line-acc { stroke: var(--accent); }

.rate-hero {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--border-2);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(141,92,255,0.24), rgba(8,9,17,0.58) 46%, rgba(47,116,255,0.12)),
    var(--surface);
  box-shadow:
    var(--shadow-card),
    0 0 38px rgba(114,77,255,0.18);
}

.rate-hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: 18px;
  width: 170px;
  height: 68px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(48,217,151,0.22), rgba(49,92,255,0.16)),
    rgba(255,255,255,0.035);
  pointer-events: none;
  transform: rotate(-18deg);
}

.rate-hero-sell::after {
  background:
    linear-gradient(135deg, rgba(255,90,122,0.20), rgba(141,92,255,0.18)),
    rgba(255,255,255,0.035);
}

.rate-hero.is-disabled {
  opacity: .72;
}

.rate-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rate-hero-label {
  color: #cfc5ff;
  font-size: 13px;
  font-weight: 800;
}

.rate-hero-title {
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.rate-hero-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 54px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255,255,255,0.055);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.rate-hero-value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 13px;
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.rate-hero-value span:last-child {
  color: var(--text-2);
  font-size: 22px;
}

.rate-hero-copy {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.rate-hero-switch {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.rate-hero-switch button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.rate-hero-switch button.is-active {
  border-color: rgba(141,92,255,0.62);
  background: linear-gradient(135deg, var(--violet-2), var(--blue));
  color: #fff;
  box-shadow: 0 10px 26px rgba(72,78,255,0.30);
}

.rate-hero-switch span {
  border-radius: 999px;
  padding: 2px 5px;
  background: rgba(255,90,122,0.16);
  color: var(--neg);
  font-size: 9px;
  line-height: 1;
}

.rate-hero-note {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.rate-hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.rate-hero-metrics div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  padding: 9px;
  background: rgba(255,255,255,0.045);
}

.rate-hero-metrics span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
}

.rate-hero-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-hero-metrics .is-up { color: var(--pos); }
.rate-hero-metrics .is-down { color: var(--neg); }

.home-rate-rows {
  overflow: hidden;
}

.home-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 78px;
  gap: 8px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
}

.home-rate-row:last-child {
  border-bottom: 0;
}

.home-rate-row span {
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 800;
}

.home-rate-row strong,
.home-rate-row em {
  min-width: 0;
  color: var(--text-3);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.home-rate-row strong.is-active {
  color: var(--accent);
}

.home-rate-row strong.is-wide {
  grid-column: 2 / 4;
  color: var(--text);
}

.home-rate-row-labels {
  padding-top: 0;
  padding-bottom: 10px;
}

.home-rate-row-labels em {
  color: var(--text-3);
  font-size: 10px;
  text-transform: none;
}

.cbr-rate-card {
  overflow: hidden;
  padding: 18px;
}

.cbr-rate-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cbr-rate-card-head > strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.cbr-rate-card-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.cbr-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.cbr-rate-cell {
  min-width: 0;
  padding-right: 18px;
}

.cbr-rate-cell + .cbr-rate-cell {
  padding-right: 0;
  padding-left: 18px;
  border-left: 1px solid var(--hairline);
}

.cbr-rate-cell > span {
  display: block;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cbr-rate-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.cbr-rate-value-row > strong {
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.cbr-rate-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cbr-rate-change.is-up {
  color: var(--pos);
}

.cbr-rate-change.is-down {
  color: var(--neg);
}

.cbr-rate-change.is-flat {
  color: var(--text-3);
}

@media (max-width: 360px) {
  .cbr-rate-card {
    padding: 16px;
  }

  .cbr-rate-cell {
    padding-right: 12px;
  }

  .cbr-rate-cell + .cbr-rate-cell {
    padding-left: 12px;
  }

  .cbr-rate-value-row > strong {
    font-size: 19px;
  }
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.section-headline span {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.section-headline button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.btn-link:disabled {
  color: var(--text-3);
  cursor: default;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.choice-chip.is-active {
  border-color: var(--accent);
  background: rgba(141,92,255,0.14);
  color: #c9b9ff;
}

.choice-chip.is-disabled {
  cursor: not-allowed;
  opacity: .5;
}

.textarea-field {
  width: 100%;
  min-height: 92px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  padding: 14px;
  outline: none;
  resize: vertical;
}

.textarea-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.wallet-card.is-active {
  border-color: var(--accent);
  background: rgba(141,92,255,0.14);
}

.wallet-card-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.wallet-card-addr {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-num);
}

.empty-card {
  padding: 18px 16px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 17, 29, .94);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 200;
}

[data-theme="light"] .toast {
  background: rgba(13, 23, 34, .92);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  border-color: rgba(226, 59, 74, .35);
}

.toast.is-success {
  border-color: rgba(18, 160, 106, .35);
}

.auth-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(5, 6, 11, .72);
  backdrop-filter: blur(18px);
}

[data-theme="light"] .auth-overlay {
  background: rgba(238, 241, 246, .78);
}

.auth-sheet {
  margin-top: auto;
  width: 100%;
  padding: 24px 16px calc(18px + env(safe-area-inset-bottom, 0));
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.052), rgba(255,255,255,0.02)),
    var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
}

.auth-subtitle {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.auth-note {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
}

.status-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.status-note.warn {
  border-color: rgba(245, 166, 35, .35);
  background: var(--warn-soft);
  color: var(--warn);
}

.status-note.error {
  border-color: rgba(226, 59, 74, .35);
  background: var(--neg-soft);
  color: var(--neg);
}

.mini-legend {
  display: grid;
  gap: 10px;
}

.mini-legend-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.mini-legend-row span:first-child {
  color: var(--text-2);
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-identity-card,
.profile-menu-row,
.profile-friends-head button,
.profile-level-link,
.profile-referral-action button {
  border: 0;
  font-family: var(--font-ui);
  cursor: pointer;
}

.profile-identity-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  border-radius: 22px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-card);
}

.profile-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6b59e5;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.profile-identity-main {
  min-width: 0;
}

.profile-identity-main strong,
.profile-identity-main em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-main strong {
  color: var(--text);
  font-size: 17px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
}

.profile-identity-main em {
  margin-top: 5px;
  color: var(--text-3);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
}

.profile-kyc-badge {
  border-radius: 10px;
  padding: 7px 9px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.profile-kyc-badge.is-verified {
  background: #e0f6eb;
  color: #188a60;
}

.profile-identity-chevron {
  color: #c6c2d5;
}

.profile-level-card {
  overflow: hidden;
  border-radius: 24px;
  padding: 20px 18px 0;
  background: #6b59e5;
  color: #fff;
}

.profile-level-head,
.profile-level-progress-head,
.profile-level-link,
.profile-friends-head,
.profile-referral-action,
.profile-menu-row,
.profile-menu-row-tail {
  display: flex;
  align-items: center;
}

.profile-level-head {
  justify-content: space-between;
  gap: 18px;
}

.profile-card-kicker {
  display: block;
  color: rgba(255, 255, 255, .60);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  line-height: 1;
  text-transform: uppercase;
}

.profile-level-name,
.profile-level-commission strong {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1;
}

.profile-level-name {
  max-width: 230px;
  overflow: hidden;
  font-size: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-level-commission {
  flex-shrink: 0;
  text-align: right;
}

.profile-level-commission strong {
  font-size: 28px;
}

.profile-level-progress-head {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: rgba(255, 255, 255, .66);
  font-size: 12.5px;
  font-weight: 600;
}

.profile-level-progress-head strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-overflow: ellipsis;
}

.profile-level-progress {
  overflow: hidden;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
}

.profile-level-progress span {
  display: block;
  min-width: 6px;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.profile-level-card > p {
  min-height: 38px;
  margin: 10px 0 9px;
  color: rgba(255, 255, 255, .92);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
}

.profile-level-link {
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  border-top: 1px solid rgba(255, 255, 255, .23);
  padding: 0;
  background: transparent;
  color: #fff;
  font-size: 14.5px;
  font-weight: 750;
  text-align: left;
}

.profile-friends-card,
.profile-menu-card {
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.profile-friends-card {
  padding: 18px 16px 16px;
}

.profile-friends-head {
  justify-content: space-between;
  gap: 16px;
}

.profile-friends-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.profile-friends-head button {
  padding: 0;
  background: transparent;
  color: #6b59e5;
  font-size: 14px;
  font-weight: 750;
}

.profile-friends-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.profile-friends-stats > div {
  min-width: 0;
  min-height: 66px;
  border-radius: 16px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.profile-friends-stats span,
.profile-friends-stats strong {
  display: block;
}

.profile-friends-stats span {
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-friends-stats strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
}

.profile-friends-card > p {
  margin: 16px 0 7px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
}

.profile-referral-action {
  gap: 8px;
}

.profile-referral-action > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 42px;
  border-radius: 14px;
  padding: 0 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 42px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-referral-action button {
  flex: 0 0 108px;
  height: 42px;
  border-radius: 14px;
  background: #6b59e5;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
}

.profile-menu-card {
  overflow: hidden;
  padding: 5px 16px;
}

.profile-menu-row {
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 50px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  text-align: left;
}

.profile-menu-row + .profile-menu-row {
  border-top: 1px solid var(--hairline);
}

.profile-menu-row-tail {
  flex-shrink: 0;
  gap: 7px;
  color: #c6c2d5;
}

.profile-menu-row-tail em {
  max-width: 120px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-row.is-muted {
  color: var(--text-3);
}

.profile-root-title {
  font-size: 22px;
  font-weight: 800;
}

.tg-header:has(.profile-root-title) {
  min-height: 68px;
  padding-top: 18px;
}

.runtime-miniapp .tg-header:has(.profile-root-title) {
  min-height: 68px;
  padding-top: 18px;
}

[data-theme="dark"] .profile-kyc-badge.is-verified {
  background: rgba(28, 153, 101, .18);
  color: #50d89f;
}

@media (max-width: 350px) {
  .profile-identity-card {
    grid-template-columns: 44px minmax(0, 1fr) auto 12px;
    gap: 8px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .profile-avatar {
    width: 44px;
    height: 44px;
  }

  .profile-identity-main strong {
    font-size: 15.5px;
  }

  .profile-kyc-badge {
    padding: 6px 7px;
    font-size: 11px;
  }

  .profile-level-name {
    max-width: 180px;
    font-size: 27px;
  }

  .profile-level-commission strong {
    font-size: 25px;
  }

  .profile-level-progress-head strong {
    max-width: none;
  }

  .profile-level-progress-head {
    gap: 4px;
    font-size: 11.5px;
  }

  .profile-friends-stats span {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

  .profile-referral-action button {
    flex-basis: 96px;
  }
}

.profile-info-card {
  padding-top: 8px;
  padding-bottom: 8px;
}

.profile-info-row {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 0;
}

.profile-info-row + .profile-info-row {
  border-top: 1px solid var(--hairline);
}

.profile-info-row span {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.profile-info-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-edit-card .field-lbl {
  margin-bottom: 6px;
}

.profile-edit-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: 10px;
}

.saved-manager-card .section-headline {
  margin-top: 0;
}

.saved-manager-card .section-headline em {
  color: var(--text-3);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.saved-section-head {
  margin: 2px 0 9px;
}

.saved-section-head span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 800;
}

.saved-manage-link {
  display: inline-flex;
  margin-top: 9px;
  color: var(--accent);
  font-size: 12.5px;
}

.saved-empty-action {
  margin-top: 10px;
}

.saved-item-list {
  display: grid;
  gap: 10px;
}

.saved-item-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 11px;
  border-radius: 18px;
  padding: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.saved-item-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.saved-item-main {
  min-width: 0;
}

.saved-item-main strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-item-main span,
.saved-copy-btn {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-copy-btn {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font-family: var(--font-num);
  text-align: left;
  cursor: pointer;
}

.saved-delete-btn {
  width: 96px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border: 0;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.saved-delete-btn.is-confirm {
  background: var(--neg-soft);
  color: var(--neg);
}

.referral-screen {
  padding-bottom: 34px;
}

.referral-stack {
  display: grid;
  gap: 12px;
}

.referral-stack > * {
  min-width: 0;
}

.ref-program-card {
  border-radius: 18px;
  padding: 18px 16px 16px;
  background: #6b59e5;
  color: #fff;
  box-shadow: 0 16px 32px rgba(74, 57, 182, .24);
}

.ref-program-card h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.ref-program-card > p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.ref-share-btn {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 13px;
  background: #fff;
  color: #5d4bd4;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.ref-code-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: rgba(255, 255, 255, .62);
  font-size: 10.5px;
  font-weight: 650;
}

.ref-code-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-code-row button {
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.ref-balance-card,
.ref-people-card,
.ref-history-card,
.ref-menu-card,
.ref-apply-card {
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ref-balance-card {
  min-height: 146px;
  padding: 20px 16px;
}

.ref-balance-grid,
.ref-people-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ref-balance-grid {
  gap: 14px;
}

.ref-balance-grid > div:last-child,
.ref-people-card > div:last-child {
  text-align: right;
}

.ref-balance-grid span,
.ref-people-card span {
  display: block;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.2;
}

.ref-balance-grid strong,
.ref-people-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-weight: 800;
  line-height: 1;
}

.ref-balance-grid > div:first-child strong {
  font-size: 22px;
}

.ref-balance-grid > div:last-child strong {
  font-size: 13px;
}

.ref-withdraw-progress {
  height: 4px;
  margin-top: 21px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.ref-withdraw-progress span {
  display: block;
  height: 100%;
  min-width: 5px;
  border-radius: inherit;
  background: var(--accent);
}

.ref-withdraw-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
}

.ref-withdraw-status p {
  min-width: 0;
  margin: 0;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}

.ref-withdraw-status p strong {
  color: var(--text);
}

.ref-withdraw-status > button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.ref-people-card {
  padding: 15px 16px;
}

.ref-people-card > div + div {
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.ref-people-card strong {
  font-size: 18px;
}

.ref-history-card {
  padding: 10px 12px 12px;
}

.ref-history-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border-radius: 12px;
  padding: 3px;
  background: var(--surface-2);
}

.ref-history-tabs button {
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.ref-history-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 10px rgba(24, 24, 43, .08);
}

.ref-history-tabs span {
  margin-left: 2px;
}

.ref-history-body {
  min-height: 126px;
  padding-top: 8px;
}

.ref-history-empty {
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 18px 12px;
  text-align: center;
}

.ref-history-empty strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.ref-history-empty p {
  max-width: 230px;
  margin: 7px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}

.ref-menu-card {
  overflow: hidden;
  padding: 0 14px;
}

.ref-menu-card > button {
  width: 100%;
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: left;
}

.ref-menu-card > button + button {
  border-top: 1px solid var(--border);
}

.ref-menu-card > button > strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.ref-menu-card > button > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.ref-apply-card {
  padding: 0 14px;
}

.ref-apply-toggle {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  cursor: pointer;
}

.ref-apply-toggle span,
.ref-apply-toggle strong {
  font-size: 12px;
  font-weight: 800;
}

.ref-apply-toggle strong {
  color: var(--accent);
}

.ref-apply-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding: 12px 0 14px;
}

.ref-withdraw-card .section-headline em,
.card .section-headline em {
  color: var(--text-3);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.ref-wallet-picker {
  display: grid;
  gap: 8px;
}

.ref-wallet-picker button {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 11px 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: left;
}

.ref-wallet-picker button.is-active {
  border-color: rgba(109, 92, 231, .36);
  background: var(--accent-soft);
}

.ref-wallet-picker strong,
.ref-wallet-picker span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-wallet-picker strong {
  font-size: 13px;
  font-weight: 850;
}

.ref-wallet-picker span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 750;
}

.ref-list {
  display: grid;
  gap: 9px;
}

.ref-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  border-radius: 17px;
  padding: 12px;
  background: var(--surface-2);
}

.ref-list-row div {
  min-width: 0;
}

.ref-list-row strong,
.ref-list-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-list-row strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 850;
}

.ref-list-row span {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 750;
}

.ref-list-row em {
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.loyalty-screen {
  padding-bottom: 34px;
}

.loyalty-stack {
  display: grid;
  gap: 12px;
}

.loyalty-stack > * {
  min-width: 0;
}

.loyalty-hero-card {
  border-radius: 18px;
  padding: 16px;
  background: #6b59e5;
  color: #fff;
  box-shadow: 0 16px 32px rgba(74, 57, 182, .24);
}

.loyalty-hero-head,
.loyalty-progress-head,
.loyalty-tier-row,
.loyalty-tier-tail,
.loyalty-referral-action {
  display: flex;
  align-items: center;
}

.loyalty-hero-head,
.loyalty-progress-head,
.loyalty-tier-row {
  justify-content: space-between;
}

.loyalty-hero-head {
  align-items: flex-start;
  gap: 12px;
}

.loyalty-kicker {
  display: block;
  color: rgba(255, 255, 255, .68);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.loyalty-level-name {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.04;
}

.loyalty-level-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .20);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.loyalty-commission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.loyalty-commission-grid > div {
  min-width: 0;
  border-radius: 13px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, .14);
}

.loyalty-commission-grid span,
.loyalty-commission-grid strong {
  display: block;
}

.loyalty-commission-grid span {
  color: rgba(255, 255, 255, .68);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.loyalty-commission-grid strong {
  margin-top: 4px;
  color: #fff;
  font-size: 21px;
  font-weight: 750;
  line-height: 1;
}

.loyalty-hero-card > p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.42;
}

.loyalty-progress-card,
.loyalty-tiers-card,
.loyalty-referral-card {
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.loyalty-progress-card {
  padding: 15px 16px 16px;
}

.loyalty-progress-head {
  gap: 10px;
}

.loyalty-progress-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.loyalty-progress-head span {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.loyalty-progress {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.loyalty-progress span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--accent);
}

.loyalty-progress-card > p {
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.loyalty-progress-card > p strong {
  color: var(--text);
  font-weight: 800;
}

.loyalty-tiers-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 7px;
}

.loyalty-tiers-head > h2 {
  margin: 0;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .10em;
  line-height: 1.2;
  text-transform: uppercase;
}

.loyalty-tiers-card {
  overflow: hidden;
}

.loyalty-tier-row {
  min-height: 61px;
  gap: 12px;
  padding: 12px 14px;
}

.loyalty-tier-row + .loyalty-tier-row {
  border-top: 1px solid var(--hairline);
}

.loyalty-tier-row > div:first-child {
  min-width: 0;
}

.loyalty-tier-row > div:first-child > strong,
.loyalty-tier-row > div:first-child > span {
  display: block;
}

.loyalty-tier-row > div:first-child > strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.loyalty-tier-row > div:first-child > span {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
}

.loyalty-tier-tail {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
}

.loyalty-tier-tail > em {
  border-radius: 999px;
  padding: 5px 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.loyalty-tier-tail > strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.loyalty-tiers-toggle {
  flex: 0 0 auto;
  min-height: 24px;
  border: 0;
  margin: 0;
  padding: 4px 6px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.loyalty-referral-card {
  padding: 16px;
  background: #efedfd;
  box-shadow: none;
}

[data-theme="dark"] .loyalty-referral-card {
  background: #1b1b29;
}

.loyalty-referral-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.loyalty-referral-card > p {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.loyalty-referral-action {
  gap: 8px;
  margin-top: 13px;
}

.loyalty-referral-action > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loyalty-referral-action > button {
  flex: 0 0 104px;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: #6b59e5;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.loyalty-disclaimer {
  margin: 0;
  padding: 0 7px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 350px) {
  .ref-program-card,
  .ref-balance-card,
  .ref-people-card {
    padding-right: 13px;
    padding-left: 13px;
  }

  .ref-program-card h2 {
    font-size: 18px;
  }

  .ref-program-card > p {
    font-size: 11px;
  }

  .ref-balance-grid > div:first-child strong {
    font-size: 20px;
  }

  .ref-history-card {
    padding-right: 9px;
    padding-left: 9px;
  }

  .ref-history-tabs button {
    font-size: 9.5px;
  }

  .ref-menu-card {
    padding-right: 12px;
    padding-left: 12px;
  }

  .loyalty-hero-card,
  .loyalty-progress-card,
  .loyalty-referral-card {
    padding-right: 13px;
    padding-left: 13px;
  }

  .loyalty-level-name {
    font-size: 24px;
  }

  .loyalty-commission-grid > div {
    padding-right: 9px;
    padding-left: 9px;
  }

  .loyalty-commission-grid strong {
    font-size: 19px;
  }

  .loyalty-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .loyalty-tier-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .loyalty-tier-tail {
    gap: 5px;
  }

  .loyalty-tier-tail > em {
    padding-right: 5px;
    padding-left: 5px;
  }

  .loyalty-referral-action > button {
    flex-basis: 92px;
  }
}

.runtime-miniapp body {
  background: var(--bg);
}

.runtime-miniapp .stage {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.runtime-miniapp .stage::before {
  display: none;
}

.runtime-miniapp .device {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none !important;
}

.runtime-miniapp .screen {
  border-radius: 0;
  min-height: 100dvh;
}

.runtime-miniapp .statusbar,
.runtime-miniapp .island,
.runtime-miniapp .tg-foot {
  display: none;
}

.runtime-miniapp .tg-header {
  padding-top: env(safe-area-inset-top, 0);
}

.runtime-miniapp .tabbar {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}

/* ---------- /new2 visual source: light purple wallet UI ---------- */
:root {
  --font-ui: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-num: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --violet: #6d5ce7;
  --violet-2: #8c73f0;
  --blue: #3b7de0;
  --green: #2fb37d;
  --yellow: #f5a623;
  --danger: #ef5b6b;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
}

[data-theme="light"] {
  --bg: #f3f1fb;
  --bg-grad: none;
  --elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f3fc;
  --surface-3: #ece9fd;
  --border: #eceaf4;
  --border-2: #efedf6;
  --hairline: #efedf6;
  --text: #15131f;
  --text-2: #5c5870;
  --text-3: #9692ac;
  --accent: #6d5ce7;
  --accent-2: #9277f2;
  --accent-soft: #ece9fd;
  --accent-ring: rgba(109, 92, 231, .18);
  --pos: #2fb37d;
  --pos-soft: #eaf7f0;
  --neg: #ef5b6b;
  --neg-soft: #fbe0e2;
  --warn: #d98e12;
  --warn-soft: #fcf0ce;
  --tg-header: #f3f1fb;
  --tg-foot: #f3f1fb;
  --shadow-card: 0 12px 30px rgba(82, 67, 170, .10);
  --shadow-pop: 0 18px 40px rgba(82, 67, 170, .24);
  --on-accent: #ffffff;
  --skel: rgba(82, 67, 170, .08);
}

[data-theme="dark"] {
  --bg: #0f1015;
  --bg-grad: none;
  --elev: #1a1c24;
  --surface: #1a1c24;
  --surface-2: #20232d;
  --surface-3: #282b36;
  --border: rgba(255, 255, 255, .055);
  --border-2: rgba(154, 108, 255, .24);
  --hairline: rgba(255, 255, 255, .06);
  --text: #fafaff;
  --text-2: #a9acba;
  --text-3: #747887;
  --accent: #9a6cff;
  --accent-2: #7d5af4;
  --accent-soft: rgba(154, 108, 255, .15);
  --accent-ring: rgba(154, 108, 255, .27);
  --pos: #5bd59c;
  --pos-soft: rgba(91, 213, 156, .13);
  --neg: #f27888;
  --neg-soft: rgba(242, 120, 136, .13);
  --warn: #f4c768;
  --warn-soft: rgba(244, 199, 104, .13);
  --tg-header: #0f1015;
  --tg-foot: #0f1015;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, .015), 0 10px 24px rgba(0, 0, 0, .10);
  --shadow-pop: 0 18px 42px rgba(0, 0, 0, .34);
  --on-accent: #ffffff;
}

html,
body {
  background: #6d5ce7;
  color: var(--text);
  font-family: var(--font-ui);
}

.stage {
  background: #6d5ce7;
}

.stage::before,
.screen::before {
  display: none;
}

.device {
  width: min(430px, calc(100vw - 48px));
  height: min(900px, calc(100vh - 48px));
  aspect-ratio: 430 / 900;
  border-radius: 30px;
  background: var(--bg);
  padding: 0;
  box-shadow: 0 34px 90px rgba(55, 38, 140, .45);
}

.screen {
  border-radius: 30px;
  background: var(--bg);
  background-image: none;
  color: var(--text);
}

.statusbar {
  background: var(--bg);
}

.island {
  background: rgba(21, 19, 31, .18);
  box-shadow: none;
}

.tg-header {
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 32px 18px 14px;
  background: var(--bg);
}

.tg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tg-title,
.tg-brand .tg-title {
  color: var(--text);
  font-size: 21px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: none;
}

.tg-brand .tg-title span {
  color: inherit;
  text-shadow: none;
}

.header-logo-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 102px;
  color: var(--text);
}

.header-logo-mark {
  display: block;
  width: 92px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(107, 45, 173, .18));
}

.header-logo-fill {
  fill: currentColor;
  fill-rule: evenodd;
  clip-rule: evenodd;
}

.header-logo-caption {
  color: var(--text-3);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .32em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tg-actions {
  gap: 8px;
}

.tg-iconbtn,
.tg-back {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(82, 67, 170, .08);
}

.tg-iconbtn:active,
.tg-back:active {
  background: var(--surface-2);
  color: var(--accent);
}

.body {
  padding: 0 18px 24px;
}

.stack > * + * {
  margin-top: 14px;
}

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}

.card-2 {
  background: var(--surface-2);
  border: 0;
}

.card-pad {
  padding: 18px;
}

.btn {
  height: 56px;
  border-radius: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #6d5ce7, #8c73f0);
  color: #fff;
  box-shadow: 0 14px 28px rgba(93, 75, 212, .32);
}

.btn-primary:disabled {
  background: #d8d3ee;
  color: rgba(255, 255, 255, .72);
  box-shadow: none;
}

.btn-soft,
[data-theme="light"] .btn-soft {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .36);
  color: rgba(255, 255, 255, .94);
}

.field {
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.field:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field-lbl {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}

.amount-input {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.cur-chip {
  border: 0;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(82, 67, 170, .08);
}

.coin {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.coin-usdt {
  background: #26a17b;
}

.coin-rub {
  background: #6d5ce7;
}

.swapbtn {
  width: 38px;
  height: 38px;
  border: 3px solid var(--surface);
  border-radius: 13px;
  background: linear-gradient(135deg, #6d5ce7, #9277f2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(93, 75, 212, .34);
}

.pill {
  font-weight: 800;
}

.pill-accent {
  background: #ece9fd;
  color: #6d5ce7;
}

.pill-pos {
  background: #eaf7f0;
  color: #1e7a52;
}

.pill-neg {
  background: #fbe0e2;
  color: #d84d60;
}

.pill-warn {
  background: rgba(245, 166, 35, .14);
  color: #d98e12;
}

.row-ic {
  background: var(--accent-soft);
  color: var(--accent);
}

.row-ic.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tabbar {
  height: 76px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 8px 8px;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(82, 67, 170, .12);
}

.tab {
  min-height: 58px;
  border-radius: 18px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
}

.tab.active {
  background: #ece9fd;
  color: var(--accent);
  filter: none;
}

.tg-foot {
  display: none;
}

.rate-hero {
  min-height: 308px;
  padding: 18px 18px 16px;
  border: 0;
  border-radius: 26px;
  background: linear-gradient(135deg, #6d5ce7 0%, #8c73f0 55%, #a98bf6 100%);
  box-shadow: 0 18px 38px rgba(93, 75, 212, .34);
  color: #fff;
}

.rate-hero-buy {
  background: linear-gradient(135deg, #5d66df 0%, #7f74ea 52%, #52c6ad 100%);
}

.rate-hero-sell {
  background: linear-gradient(135deg, #5d55d8 0%, #7f74ea 66%, #d84d60 100%);
}

.rate-hero::before,
.rate-hero::after {
  content: none;
}

.rate-hero-top,
.rate-hero-value,
.hero-rate-chart,
.rate-hero-info,
.rate-hero-note {
  position: relative;
  z-index: 1;
}

.rate-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.rate-hero-main {
  min-width: 0;
}

.rate-hero-label {
  color: rgba(255, 255, 255, .80);
  font-size: 13px;
  font-weight: 800;
}

.rate-hero-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  margin-top: 8px;
  padding: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.rate-hero-updated span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7df0b6;
  animation: mbexpulse 1.6s infinite;
}

.rate-hero-value {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.rate-hero-value span:last-child {
  color: #fff;
  font-size: 32px;
}

.rate-hero-value em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin: 0 0 0 2px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .18);
  color: #9ef7c6;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.rate-hero-value em.is-down {
  background: rgba(123, 33, 80, .22);
  color: #ffd0d6;
}

.rate-hero-range {
  display: grid;
  gap: 14px;
  padding-top: 2px;
  text-align: right;
}

.rate-hero-range div {
  display: grid;
  gap: 4px;
}

.rate-hero-range span {
  color: rgba(255, 255, 255, .60);
  font-size: 11px;
  font-weight: 650;
}

.rate-hero-range strong {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.hero-rate-chart {
  position: relative;
  margin: 18px 0 0;
}

.hero-rate-chart svg {
  display: block;
  width: 100%;
  height: 116px;
  overflow: visible;
  cursor: crosshair;
  touch-action: none;
}

.hero-rate-grid {
  stroke: rgba(255, 255, 255, .20);
  stroke-width: 1;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
}

.hero-rate-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 10px rgba(74, 43, 163, .28));
  vector-effect: non-scaling-stroke;
}

.hero-rate-plot {
  transform-box: fill-box;
  transform-origin: left center;
}

.hero-rate-chart.is-revealing .hero-rate-plot {
  animation: heroRatePlotReveal 1300ms cubic-bezier(.22, 1, .36, 1) both;
}

.hero-rate-last-halo {
  fill: rgba(255, 255, 255, .24);
}

.hero-rate-last-marker {
  fill: #fff;
  stroke: rgba(255, 255, 255, .68);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.hero-rate-cursor {
  stroke: rgba(255, 255, 255, .68);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.hero-rate-cursor-dot {
  fill: #fff;
  stroke: #6d5ce7;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.hero-rate-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 104px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(34, 27, 79, .92);
  box-shadow: 0 8px 18px rgba(39, 26, 107, .28);
  color: #fff;
  font-family: var(--font-num);
  font-size: 10px;
  line-height: 1.25;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}

.hero-rate-tooltip strong,
.hero-rate-tooltip span {
  display: block;
}

.hero-rate-tooltip strong {
  font-size: 12px;
  font-weight: 800;
}

.hero-rate-tooltip span {
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
}

.hero-rate-axis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: -3px;
  color: rgba(255, 255, 255, .54);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
}

.hero-rate-axis span {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.hero-rate-axis span:first-child {
  text-align: left;
}

.hero-rate-axis span:last-child {
  text-align: right;
}

@keyframes heroRatePlotReveal {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.rate-hero-info {
  margin-top: 14px;
}

.rate-hero-info-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

.rate-hero-info-summary > span {
  min-width: 0;
}

.rate-hero-info-summary > button {
  min-height: 44px;
  margin: -6px -4px -6px 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .94);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.rate-hero-info-summary > button:active {
  color: #fff;
  opacity: .72;
}

.rate-hero-info-details {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .22s ease, margin-top .22s ease, opacity .16s ease, visibility 0s linear .22s;
}

.rate-hero-info-details.is-open {
  grid-template-rows: 1fr;
  margin-top: 6px;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows .22s ease, margin-top .22s ease, opacity .18s ease .04s;
}

.rate-hero-info-details > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
}

.rate-hero-info-details p {
  margin: 0;
  padding: 11px 0 11px 12px;
  color: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.rate-hero-info-details button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.rate-hero-info-details button:active {
  opacity: .72;
}

@media (prefers-reduced-motion: reduce) {
  .rate-hero-info-details,
  .rate-hero-info-details.is-open {
    transition: none;
  }

  .hero-rate-chart.is-revealing .hero-rate-plot {
    animation: none;
  }
}

.rate-hero-note {
  margin-top: 12px;
  border-radius: 14px;
  background: rgba(252, 240, 206, .95);
  color: #995f00;
}

.home-direction-switcher {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 18px;
  background: #e7e3f6;
}

.home-direction-switcher button {
  min-width: 0;
  min-height: 46px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.home-direction-switcher button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(82, 67, 170, .10);
}

.home-direction-switcher span {
  padding: 2px 5px;
  border-radius: 999px;
  background: #fbe0e2;
  color: var(--danger);
  font-size: 9px;
  line-height: 1;
}

.calc-card {
  padding: 18px;
}

.calc-field {
  border-radius: 16px;
  padding: 14px 16px;
}

.calc-field-result {
  background: #eaf7f0;
}

[data-theme="dark"] .calc-field-result {
  background: #163024;
}

.calc-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-result-info {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.calc-result-info:hover {
  color: var(--accent);
}

.calc-result-info:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

.calc-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 6, 11, .54);
  backdrop-filter: blur(8px);
  animation: historyFilterFadeIn 160ms ease both;
}

.calc-notice-sheet {
  width: min(100%, 420px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: historyFilterSheetIn 220ms cubic-bezier(.16, 1, .3, 1) both;
}

.calc-notice-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calc-notice-head strong {
  font-size: 18px;
  font-weight: 850;
}

.calc-notice-head button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}

.calc-notice-sheet p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.deposit-copy-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 6, 11, .62);
  backdrop-filter: blur(8px);
  animation: historyFilterFadeIn 160ms ease both;
}

.deposit-copy-notice-sheet {
  width: min(100%, 360px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px 18px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-pop);
  animation: historyFilterSheetIn 220ms cubic-bezier(.16, 1, .3, 1) both;
}

.deposit-copy-notice-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border: 2px solid rgba(18, 160, 106, .3);
  border-radius: 50%;
  background: var(--pos-soft);
  color: var(--pos);
  box-shadow: inset 0 0 0 6px var(--surface);
}

.deposit-copy-notice-sheet > strong {
  display: block;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.35;
}

.deposit-copy-notice-sheet p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.deposit-copy-notice-sheet p b {
  color: var(--text);
}

.deposit-copy-notice-suppress {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  color: var(--text-2);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}

.deposit-copy-notice-suppress input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.deposit-copy-notice-confirm {
  width: 100%;
  margin-top: 18px;
}

.calc-summary {
  margin-top: 13px;
}

.mini-legend {
  gap: 11px;
}

.mini-legend-row {
  font-size: 13px;
}

.mini-legend-row strong {
  color: var(--text);
  font-weight: 800;
}

.home-create-btn {
  margin-top: 16px;
  gap: 8px;
}

.section-headline {
  margin-top: 6px;
}

.section-headline span,
.home-section-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.section-headline button {
  color: var(--accent);
}

.home-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-services-grid .card {
  min-height: 126px;
  padding: 16px;
  cursor: pointer;
}

.home-services-grid .card > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 11px;
  color: var(--accent);
  background: #ece9fd;
}

.home-services-grid .card:nth-child(2) > span {
  background: #fbe0e2;
  color: #e0697a;
}

.home-services-grid .card:nth-child(3) > span {
  background: #fcf0ce;
  color: #d69a2e;
}

.home-services-grid .card:nth-child(4) > span {
  background: #e7f0ff;
  color: #3b7de0;
}

.home-services-grid strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.home-services-grid em {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
}

.status-note {
  border: 0;
  background: var(--surface-2);
}

.info-screen .section-headline {
  margin-top: 0;
}

.info-hero-card {
  display: grid;
  gap: 14px;
}

.info-hero-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}

.aml-hero-card .info-hero-icon {
  background: var(--pos-soft);
  color: var(--pos);
}

.info-hero-card p,
.office-head p {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.info-status-pill {
  display: flex;
}

.info-link-card {
  overflow: hidden;
}

.info-policy-card {
  overflow: hidden;
}

.info-bullet {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.info-policy-card .info-bullet {
  padding: 14px 16px;
}

.info-policy-card .info-bullet + .info-bullet {
  border-top: 1px solid var(--hairline);
}

.card-pad > .info-bullet {
  padding: 6px 0;
}

.info-bullet-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent);
}

.info-bullet strong,
.info-bullet span {
  display: block;
  min-width: 0;
}

.info-bullet strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.info-bullet span {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.office-card {
  overflow: hidden;
}

.office-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.office-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.office-meta-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.office-meta-grid span,
.office-meta-grid strong {
  display: block;
  min-width: 0;
}

.office-meta-grid span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.office-meta-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.office-photo-strip {
  display: flex;
  gap: 9px;
  margin: 15px -16px 0;
  padding: 0 16px 3px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.office-photo-strip::-webkit-scrollbar {
  display: none;
}

.office-photo-strip img {
  width: 196px;
  height: 128px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  scroll-snap-align: start;
}

.office-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.office-actions .btn {
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
}

.office-actions .btn-soft {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
}

.create-summary-card {
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(135deg, #6d5ce7, #8c73f0);
  color: #fff;
  box-shadow: 0 14px 30px rgba(93, 75, 212, .30);
}

.create-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.create-summary-head .pill {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.create-summary-head > span {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
}

.create-summary-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.create-summary-main > div:last-child {
  text-align: right;
}

.create-summary-main span {
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 700;
}

.create-summary-main strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buy-create-card {
  box-shadow: 0 10px 26px rgba(82, 67, 170, .08);
}

.create-amount-hint {
  display: block;
  margin-top: 4px;
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 800;
}

.buy-input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
}

.buy-input-shell .amount-input {
  min-width: 0;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 9px;
}

.preset-grid button,
.saved-pills button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.preset-grid button.is-active,
.saved-pills button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.buy-estimate-box {
  border-radius: 16px;
  padding: 6px 14px;
  background: #eaf7f0;
}

.sell-estimate-box {
  background: #f0edff;
}

[data-theme="dark"] .buy-estimate-box {
  background: #163024;
}

[data-theme="dark"] .sell-estimate-box {
  background: #211f35;
}

.mini-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: #e7e3f6;
}

[data-theme="dark"] .mini-tabs {
  background: var(--surface-2);
}

.mini-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mini-tabs button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 5px 12px rgba(82, 67, 170, .08);
}

.mini-tabs button:disabled {
  color: var(--text-3);
  cursor: not-allowed;
  opacity: .6;
}

.kyc-recipient-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.kyc-recipient-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

.saved-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.saved-pills button {
  width: auto;
  max-width: 100%;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-input-row {
  position: relative;
}

.wallet-input-row .field {
  padding-right: 102px;
}

.wallet-input-row button {
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  min-width: 82px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(82, 67, 170, .08);
}

.rules-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.rules-check > span {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid #d8d3ee;
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
}

.rules-check > span.is-checked {
  border-color: var(--accent);
  background: var(--accent);
}

.form-error-note {
  margin-bottom: 10px;
  border-radius: 14px;
  padding: 11px 13px;
  background: #fbe0e2;
  color: #b74252;
  font-size: 12.5px;
  font-weight: 800;
}

.sell-flow-card .status-note {
  background: var(--surface-2);
}

.order-wallet-card {
  --wallet-note-bg: rgba(255, 255, 255, .12);
  --wallet-note-color: rgba(255, 255, 255, .82);
  overflow: hidden;
  border-radius: 22px;
  padding: 18px;
  color: #fff;
}

.sell-deposit-card {
  background: linear-gradient(145deg, #201552, #6d5ce7);
  box-shadow: 0 16px 34px rgba(45, 31, 124, .28);
}

.order-wallet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-wallet-head > div {
  min-width: 0;
}

.order-wallet-head span {
  display: block;
  color: rgba(255, 255, 255, .68);
  font-size: 11.5px;
  font-weight: 800;
}

.sell-deposit-head .pill-neg {
  background: var(--neg-soft);
  color: var(--neg);
}

.order-wallet-head .wallet-timer-expired {
  background: var(--wallet-note-bg);
  color: var(--wallet-note-color);
}

.order-wallet-head strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 17px;
  line-height: 1.25;
}

.order-wallet-card .field-lbl {
  color: rgba(255, 255, 255, .72);
}

.order-wallet-card .field {
  border: 0;
  background: rgba(255, 255, 255, .96);
  color: #19152f;
}

.order-wallet-card .muted {
  color: rgba(255, 255, 255, .72);
}

.deposit-empty-address {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.order-wallet-note {
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--wallet-note-bg);
  color: var(--wallet-note-color);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

.order-status-hero {
  text-align: center;
}

.order-status-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.order-status-hero .pill {
  margin-bottom: 10px;
}

.order-timeline-section {
  display: grid;
  gap: 10px;
}

.order-timeline-header {
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 0;
}

.order-timeline-heading {
  display: grid;
  gap: 3px;
}

.order-timeline-heading small {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

.order-timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 60px;
  padding-bottom: 10px;
}

.timeline-item:last-child {
  min-height: 36px;
  padding-bottom: 0;
}

.timeline-rail {
  position: absolute;
  top: 30px;
  bottom: -2px;
  left: 15px;
  width: 2px;
  border-radius: 999px;
  background: var(--border);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 800;
}

.timeline-copy {
  min-width: 0;
  padding-top: 1px;
}

.timeline-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.timeline-copy span {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.timeline-item.is-done .timeline-dot {
  border-color: var(--pos);
  background: var(--pos);
  color: #fff;
}

.timeline-item.is-done .timeline-rail {
  background: var(--pos);
}

.timeline-item.is-current .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.timeline-item.is-warn .timeline-dot {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}

.timeline-item.is-error .timeline-dot {
  border-color: var(--neg);
  background: var(--neg-soft);
  color: var(--neg);
}

.order-timeline-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding: 10px 1px 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.order-timeline-toggle svg {
  flex: 0 0 auto;
  transform: rotate(90deg);
  transition: transform .18s ease;
}

.order-timeline-toggle[aria-expanded="true"] svg {
  transform: rotate(-90deg);
}

.order-timeline-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.order-detail-card {
  overflow: hidden;
}

.detail-value-list {
  margin-top: 5px;
}

.detail-value-row {
  display: grid;
  grid-template-columns: minmax(92px, .62fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.detail-value-row:last-child {
  border-bottom: 0;
}

.detail-value-row > span {
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.detail-value-row > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-value-row > strong.is-copyable {
  cursor: pointer;
  color: var(--accent);
}

.detail-link-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
  cursor: pointer;
}

.history-filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
  padding-bottom: 2px;
}

.history-filter-chip {
  min-height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 13px 0 15px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.history-filter-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-filter-chip svg {
  flex: 0 0 auto;
}

.history-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.history-filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 6, 11, .54);
  backdrop-filter: blur(8px);
  animation: historyFilterFadeIn 160ms ease both;
}

.history-filter-sheet {
  width: min(100%, 420px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: historyFilterSheetIn 220ms cubic-bezier(.16, 1, .3, 1) both;
}

.history-filter-sheet-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-filter-sheet-head strong {
  font-size: 18px;
  font-weight: 850;
}

.history-filter-sheet-head button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}

.history-filter-options {
  display: grid;
  gap: 8px;
}

.history-filter-options > button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0 16px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.history-filter-options > button.is-selected {
  border-color: var(--border-2);
  background: var(--accent-soft);
  color: var(--accent);
}

@keyframes historyFilterFadeIn {
  from { opacity: 0; }
}

@keyframes historyFilterSheetIn {
  from { opacity: 0; transform: translateY(20px); }
}

@media (prefers-reduced-motion: reduce) {
  .history-filter-overlay,
  .history-filter-sheet {
    animation: none;
  }
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-order-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.history-order-card:active {
  background: var(--surface-2);
}

.history-order-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.history-order-icon.is-buy {
  background: var(--pos-soft);
  color: var(--pos);
}

.history-order-icon.is-sell {
  background: var(--neg-soft);
  color: var(--neg);
}

.history-order-icon.is-transfer {
  background: var(--accent-soft);
  color: var(--accent);
}

.history-order-main {
  min-width: 0;
}

.history-order-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.history-order-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-title span {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.history-order-sub,
.history-order-meta {
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-sub {
  margin-top: 3px;
}

.history-order-meta {
  display: flex;
  gap: 7px;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.5px;
}

.history-order-meta em {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-side {
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: 126px;
}

.history-order-side > strong {
  max-width: 126px;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-side .pill {
  max-width: 126px;
  overflow: hidden;
  justify-content: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-status-actions {
  display: grid;
  gap: 10px;
}

.order-status-actions .btn {
  min-width: 0;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.order-status-actions .btn-soft {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-card);
}

.order-status-actions .btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

[data-theme="dark"] .order-status-actions .btn-soft {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

[data-theme="dark"] .order-status-actions .btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-2);
}

.auth-overlay {
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0 28px;
  overflow-y: auto;
  background: radial-gradient(130% 90% at 50% 0%, #7c68ee 0%, #5d4bd4 60%, #3f2fa8 100%);
  color: #fff;
  backdrop-filter: none;
}

[data-theme="light"] .auth-overlay {
  background: radial-gradient(130% 90% at 50% 0%, #7c68ee 0%, #5d4bd4 60%, #3f2fa8 100%);
}

.auth-sheet {
  width: 100%;
  min-height: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.auth-logo {
  width: 172px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: #fff;
  filter: drop-shadow(0 18px 34px rgba(31, 22, 112, .32));
}

.auth-logo-img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-title {
  margin-top: 22px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
}

.auth-subtitle {
  align-self: center;
  max-width: 250px;
  margin-top: 16px;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.5;
}

.auth-actions {
  gap: 14px;
  margin-top: auto;
}

.auth-actions .field {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.auth-actions .field::placeholder {
  color: rgba(255, 255, 255, .64);
}

.auth-telegram-btn,
.auth-actions .btn-primary {
  background: #fff;
  color: #5d4bd4;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}

.auth-note {
  color: rgba(255, 255, 255, .66);
}

.auth-tabs,
.auth-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .16);
}

.auth-tabs button,
.auth-methods button {
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, .68);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tabs button.is-active,
.auth-methods button.is-active {
  background: #fff;
  color: #5d4bd4;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 14px;
}

.auth-field {
  display: block;
  text-align: left;
}

.auth-field span {
  display: block;
  margin: 0 0 6px 3px;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.auth-field .field {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
}

.auth-field .field::placeholder {
  color: rgba(255, 255, 255, .82);
  opacity: 1;
}

.auth-field .field:focus {
  border-color: rgba(255, 255, 255, .42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

.auth-panel .btn-ghost {
  background: rgba(255, 255, 255, .13);
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
}

.auth-register-card,
.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.auth-register-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .15);
  text-align: left;
}

.auth-register-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, .18);
}

.auth-register-card strong {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.auth-register-card span {
  color: rgba(255, 255, 255, .70);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-code-field {
  margin-top: 2px;
}

.auth-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .82);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-status.is-error {
  background: rgba(255, 90, 122, .18);
  color: #ffe1e7;
}

.auth-status.is-ok,
.auth-status.is-success {
  background: rgba(35, 209, 139, .17);
  color: #dffbed;
}

.toast {
  border: 0;
  background: rgba(21, 19, 31, .94);
}

.choice-chip,
.textarea-field,
.wallet-card,
.empty-card {
  border-color: var(--border);
  background: var(--surface);
}

.choice-chip.is-active,
.wallet-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tg-back + .tg-title {
  color: var(--text);
}

@media (max-width: 480px) {
  .stage {
    background: #6d5ce7;
  }

  .runtime-miniapp .screen {
    width: 100%;
    min-height: 100dvh;
    background: var(--bg);
  }

  .runtime-miniapp .tg-header {
    min-height: 76px;
    padding: 32px 18px 12px;
  }

}

.runtime-telegram .tg-header {
  padding-top: calc(var(--tg-native-header-offset) + env(safe-area-inset-top, 0px));
}

.runtime-telegram.runtime-telegram-desktop .tg-header {
  padding-top: max(32px, calc(var(--tg-content-safe-area-inset-top, 0px) + 12px));
}

.runtime-telegram .tg-back {
  display: none;
}

.runtime-miniapp .app-scroll {
  scroll-padding-bottom: 112px;
}

.runtime-miniapp.keyboard-open .app-scroll {
  scroll-padding-bottom: 140px;
}

.runtime-miniapp.keyboard-open .tabbar {
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0 8px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  border: 0;
  box-shadow: none;
}

.runtime-miniapp.keyboard-open .tab {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ---------- 1D neutral dark palette ---------- */
html[data-theme="dark"],
html[data-theme="dark"] body,
[data-theme="dark"] .stage {
  background: var(--bg);
}

[data-theme="dark"] .device {
  box-shadow: 0 34px 90px rgba(0, 0, 0, .48);
}

[data-theme="dark"] .tg-iconbtn,
[data-theme="dark"] .tg-back {
  border: 0;
  background: var(--surface);
  box-shadow: none;
}


[data-theme="dark"] .card {
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .card-2 {
  border: 0;
  background: var(--surface-2);
}

[data-theme="dark"] .rate-hero {
  border: 0;
  background: #6b59e5;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}

[data-theme="dark"] .rate-hero-buy {
  background: #6b59e5;
}

[data-theme="dark"] .rate-hero-sell {
  background: #6b59e5;
}

[data-theme="dark"] .home-direction-switcher {
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="dark"] .home-direction-switcher button {
  color: var(--text-3);
}

[data-theme="dark"] .home-direction-switcher button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}

[data-theme="dark"] .home-direction-switcher span {
  background: var(--neg-soft);
  color: var(--neg);
}

[data-theme="dark"] .home-services-grid .card > span,
[data-theme="dark"] .home-services-grid .card:nth-child(2) > span,
[data-theme="dark"] .home-services-grid .card:nth-child(3) > span,
[data-theme="dark"] .home-services-grid .card:nth-child(4) > span {
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="dark"] .calc-card {
  padding: 18px;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .calc-field,
[data-theme="dark"] .calc-field-result {
  border: 0;
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="dark"] .calc-summary {
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .calc-summary .mini-legend {
  margin-top: 12px !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .cur-chip {
  border: 0;
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="dark"] .mini-legend {
  margin-top: 16px;
  padding: 16px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .buy-estimate-box,
[data-theme="dark"] .sell-estimate-box,
[data-theme="dark"] .mini-tabs,
[data-theme="dark"] .history-filter-chip,
[data-theme="dark"] .history-filter-options > button,
[data-theme="dark"] .info-bullet-icon,
[data-theme="dark"] .office-meta-grid div,
[data-theme="dark"] .preset-grid button,
[data-theme="dark"] .saved-pills button,
[data-theme="dark"] .status-note {
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="dark"] .history-order-card,
[data-theme="dark"] .history-filter-sheet,
[data-theme="dark"] .calc-notice-sheet,
[data-theme="dark"] .deposit-copy-notice-sheet,
[data-theme="dark"] .textarea-field,
[data-theme="dark"] .wallet-card,
[data-theme="dark"] .empty-card {
  border-color: transparent;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .history-order-card:active {
  background: var(--surface-2);
}

[data-theme="dark"] .form-error-note {
  background: var(--neg-soft);
  color: var(--neg);
}

[data-theme="dark"] .rules-check > span {
  border-color: var(--border);
  background: var(--surface-2);
}

[data-theme="dark"] .auth-overlay {
  background: var(--bg);
}

[data-theme="dark"] .create-summary-card,
[data-theme="dark"] .sell-deposit-card {
  background: #6b59e5;
}

[data-theme="dark"] .pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-theme="dark"] .pill-pos {
  background: var(--pos-soft);
  color: var(--pos);
}

[data-theme="dark"] .pill-neg {
  background: var(--neg-soft);
  color: var(--neg);
}

[data-theme="dark"] .pill-warn,
[data-theme="dark"] .rate-hero-note {
  background: var(--warn-soft);
  color: var(--warn);
}

[data-theme="dark"] .btn-primary:disabled {
  background: var(--surface-3);
  color: var(--text-3);
}

[data-theme="dark"] .tabbar {
  border: 1px solid #2a2d37;
  background: rgba(26, 28, 36, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
}

[data-theme="dark"] .tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Full customer wallet addresses ---------- */
.wallet-address-full {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-field-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field-value.wallet-address-full,
.saved-copy-btn.wallet-address-full,
.ref-wallet-picker span.wallet-address-full,
.ref-list-row span.wallet-address-full,
.history-order-sub.wallet-address-full,
.detail-value-row > strong.wallet-address-full {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-field.has-wrapping-value,
.detail-value-row.has-wrapping-value {
  min-height: 52px;
}

.detail-value-row.has-wrapping-value {
  align-items: start;
}

.detail-value-row.has-wrapping-value > strong,
.detail-value-row.has-wrapping-value > .detail-link-btn {
  margin-top: 1px;
}

.wallet-card-addr.wallet-address-full,
.saved-copy-btn.wallet-address-full,
.ref-wallet-picker span.wallet-address-full,
.history-order-sub.wallet-address-full,
.ref-withdrawal-meta.wallet-address-full,
.deposit-copy-address {
  line-height: 1.45;
}

.tg-header:has(+ .loyalty-screen),
.tg-header:has(+ .referral-screen) {
  min-height: 64px;
  padding: 10px 18px;
}

.runtime-miniapp .tg-header:has(+ .loyalty-screen),
.runtime-miniapp .tg-header:has(+ .referral-screen) {
  min-height: 64px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}

/* ---------- Wallets · Claude Design 4A / 4B / 4C ---------- */
.tg-header:has(+ .wallets-screen) {
  min-height: 72px;
  padding: 10px 18px;
}

.runtime-miniapp .tg-header:has(+ .wallets-screen) {
  min-height: 72px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}

.wallets-screen {
  padding-top: 2px;
}

.wallets-shell {
  display: grid;
  gap: 16px;
}

.wallet-empty-card,
.wallet-editor-card {
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.wallet-empty-card {
  padding: 22px 20px 20px;
}

.wallet-empty-state {
  display: grid;
  gap: 12px;
}

.wallet-empty-card h2,
.wallet-editor-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.01em;
}

.wallet-empty-card p {
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
}

.wallet-primary-action {
  height: 52px;
  border-radius: 15px;
  font-size: 15px;
}

.wallet-info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 7px 0;
  color: var(--text-3);
}

.wallet-info-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

.wallet-info-note p,
.wallet-empty-note {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.5;
}

.wallet-editor-card {
  padding: 18px 16px 20px;
}

.wallet-editor-head,
.wallet-list-head,
.wallet-name-label,
.wallet-validation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-editor-head {
  margin-bottom: 20px;
}

.wallet-editor-head > button,
.wallet-validation button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}

.wallet-field-group {
  display: block;
}

.wallet-field-group + .wallet-field-group {
  margin-top: 18px;
}

.wallet-field-group > span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.wallet-address-input {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}

.wallet-address-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wallet-address-input.is-error {
  border-color: var(--neg);
}

.wallet-address-input.is-valid {
  border-color: var(--pos);
}

.wallet-address-input input,
.wallet-name-input,
.wallet-rename-panel input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 650 14px var(--font-ui);
}

.wallet-address-input input {
  font: 650 12px var(--font-num);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.wallet-address-input input::placeholder,
.wallet-name-input::placeholder {
  color: var(--text-3);
}

.wallet-address-input button {
  flex: 0 0 auto;
  border: 0;
  padding: 8px 0 8px 12px;
  background: transparent;
  color: var(--accent);
  font: 750 12px var(--font-ui);
  cursor: pointer;
}

.wallet-validation {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
}

.wallet-validation.is-valid {
  color: var(--pos);
}

.wallet-validation.is-error {
  display: block;
  color: var(--neg);
}

.wallet-field-group > .wallet-name-label {
  display: flex;
  margin-bottom: 8px !important;
}

.wallet-name-label span {
  min-width: 0;
}

.wallet-name-label em,
.wallet-list-head em {
  color: var(--text-3);
  font-style: normal;
  font-weight: 650;
}

.wallet-name-input {
  height: 52px;
  padding: 0 13px;
  border-radius: 15px;
  background: var(--surface-2);
}

.wallet-name-input:focus,
.wallet-rename-panel input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wallet-editor-card > .wallet-primary-action {
  margin-top: 20px;
}

.wallet-empty-note {
  padding: 0 7px;
}

.wallet-addresses-section {
  background: transparent;
  box-shadow: none;
}

.wallet-list-head {
  padding: 0 4px 10px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wallet-list-head em {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: none;
}

.wallet-address-list {
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.wallet-address-row {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  min-height: 91px;
  padding: 14px 12px 12px 11px;
}

.wallet-address-row + .wallet-address-row {
  border-top: 1px solid var(--hairline);
}

.wallet-default-button,
.wallet-row-menu-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.wallet-row-menu-button {
  border-radius: 10px;
  background: var(--surface-2);
}

.wallet-default-button > span {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--text-3);
  border-radius: 50%;
  transition: border-color .15s, box-shadow .15s;
}

.wallet-address-row.is-default .wallet-default-button > span {
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wallet-address-main {
  min-width: 0;
}

.wallet-address-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.wallet-address-title strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-address-title span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wallet-address-value {
  display: block;
  width: 100%;
  margin: 6px 0 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.wallet-address-main small {
  display: block;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
}

.wallet-row-menu-wrap {
  position: relative;
}

.wallet-row-menu {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 5;
  width: 174px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--elev);
  box-shadow: var(--shadow-pop);
}

.wallet-row-menu button {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 0;
  padding: 0 13px;
  background: transparent;
  color: var(--text);
  font: 700 12px var(--font-ui);
  text-align: left;
  cursor: pointer;
}

.wallet-row-menu button + button {
  border-top: 1px solid var(--hairline);
}

.wallet-row-menu button.is-danger {
  color: var(--neg);
}

.wallet-rename-panel {
  grid-column: 1 / -1;
}

.wallet-rename-panel input {
  height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  background: var(--surface-2);
}

.wallet-rename-panel > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.wallet-rename-panel button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 750 11px var(--font-ui);
  cursor: pointer;
}

.wallet-add-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 52px;
  margin: 14px 0 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent);
  font: 800 13px var(--font-ui);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.wallet-default-note {
  padding-top: 0;
}

[data-theme="dark"] .wallet-empty-card,
[data-theme="dark"] .wallet-editor-card {
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .wallet-address-input,
[data-theme="dark"] .wallet-name-input,
[data-theme="dark"] .wallet-rename-panel input {
  background: var(--surface-2);
}

[data-theme="dark"] .wallet-primary-action {
  background: #6b59e5;
  box-shadow: none;
}

[data-theme="dark"] .wallet-address-list,
[data-theme="dark"] .wallet-add-secondary {
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

@media (max-width: 340px) {
  .wallet-empty-card,
  .wallet-editor-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .wallet-address-row {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 7px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .wallet-address-title span {
    font-size: 7px;
  }
}
