/* ============================================================
   وی‌پی‌ان پرو — Telegram Mini App
   Design System: Glassmorphism · Dark-first · RTL · Vazirmatn
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Brand palette */
  --primary: #A855F7;
  --primary-soft: rgba(168, 85, 247, .14);
  --secondary: #7C3AED;
  --success: #36FF9B;
  --success-soft: rgba(54, 255, 155, .14);
  --destructive: #FF4458;
  --destructive-soft: rgba(255, 68, 88, .14);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, .14);

  /* Legacy aliases (components reference these) */
  --accent-1: var(--primary);
  --accent-2: var(--primary);
  --accent-grad: linear-gradient(135deg, #A855F7 0%, #C084FC 100%);
  --green: var(--success);
  --green-grad: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --gold-grad: linear-gradient(135deg, #FBBF24 0%, #F97316 100%);

  /* Chart colors */
  --chart-1: #A855F7;
  --chart-2: #C084FC;
  --chart-3: #FBBF24;
  --chart-4: #FB923C;
  --chart-5: #38BDF8;

  --nav-h: 80px;
  --shell-w: 480px;

  --ease: cubic-bezier(.22, .9, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Dark (default) */
body.dark {
  --bg: #121212;
  --bg-soft: #1a1a1a;
  --surface: rgba(255, 255, 255, .06);
  --surface-2: rgba(255, 255, 255, .11);
  --surface-solid: #1e1e1e;
  --border: #333333;
  --border-strong: #555555;
  --text: #f0f0f0;
  --muted: #999999;
  --shadow: 4px 4px 0 0 #000000;
  --shadow-soft: 3px 3px 0 0 #000000;
  --glow: 0 0 28px rgba(168, 85, 247, .4);
  --nav-bg: rgba(18, 18, 18, .88);
  --backdrop: rgba(0, 0, 0, .7);
  --shimmer: rgba(255, 255, 255, .08);
}

/* Light theme */
body.light {
  --bg: #F2F1E6;
  --bg-soft: #e8e7dc;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --border: #000000;
  --border-strong: #000000;
  --text: #1a1a1a;
  --muted: #666666;
  --shadow: 4px 4px 0 0 #000000;
  --shadow-soft: 3px 3px 0 0 #000000;
  --glow: 0 0 24px rgba(168, 85, 247, .32);
  --nav-bg: rgba(242, 241, 230, .88);
  --backdrop: rgba(0, 0, 0, .35);
  --shimmer: rgba(0, 0, 0, .06);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background .35s var(--ease), color .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(420px 320px at 85% -5%, rgba(168, 85, 247, .18), transparent 70%),
    radial-gradient(380px 300px at -10% 35%, rgba(192, 132, 252, .12), transparent 70%),
    radial-gradient(420px 340px at 50% 110%, rgba(168, 85, 247, .08), transparent 70%);
}
body.light::before {
  background:
    radial-gradient(420px 320px at 85% -5%, rgba(168, 85, 247, .14), transparent 70%),
    radial-gradient(380px 300px at -10% 35%, rgba(192, 132, 252, .10), transparent 70%),
    radial-gradient(420px 340px at 50% 110%, rgba(168, 85, 247, .06), transparent 70%);
}

/* ---------- App shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: var(--shell-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}
@media (min-width: 540px) {
  .app-shell {
    border-inline: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(0, 0, 0, .25);
  }
}

.page-host {
  padding: 18px 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}

/* Page transition */
.page { animation: pageIn .38s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

/* Stagger helper for children */
.stagger > * { animation: riseIn .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .09s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .21s; }
.stagger > *:nth-child(5) { animation-delay: .27s; }
.stagger > *:nth-child(6) { animation-delay: .33s; }
.stagger > *:nth-child(7) { animation-delay: .39s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Icons ---------- */
.icon { display: inline-flex; flex: none; }
.icon svg { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm svg { width: 1em; height: 1em; }
.icon-lg svg { width: 1.6em; height: 1.6em; }

/* ---------- Typography ---------- */
.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .74rem; }
.num { font-variant-numeric: tabular-nums; letter-spacing: .5px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head .head-text { flex: 1; min-width: 0; }
.page-head h1 { font-size: 1.28rem; font-weight: 800; }
.page-head p { color: var(--muted); font-size: .8rem; margin-top: 3px; }

.avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  background: var(--accent-grad);
  box-shadow: var(--glow);
  border: 2px solid rgba(255, 255, 255, .25);
}
.avatar-lg { width: 74px; height: 74px; font-size: 1.6rem; }

.head-btn {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: transform .2s var(--spring), background .2s;
  position: relative;
}
.head-btn:hover { background: var(--surface-2); transform: translateY(-2px); }
.head-btn:active { transform: scale(.94); }
.head-btn .dot {
  position: absolute; top: 9px; inset-inline-start: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--destructive); border: 2px solid var(--bg);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 2px 12px;
}
.section-title h2 { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-title h2 .icon { color: var(--accent-1); }
.section-title .link { color: var(--accent-2); font-size: .78rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 700; font-size: .9rem;
  border: 1px solid transparent;
  transition: transform .18s var(--spring), box-shadow .25s, filter .2s, opacity .2s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; filter: saturate(.4); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-2px); }

.btn-green {
  background: var(--success);
  color: #121212;
  box-shadow: var(--shadow);
}
.btn-green:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface); }

.btn-danger-ghost { color: var(--destructive); border-color: rgba(255, 68, 88, .3); background: var(--destructive-soft); }
.btn-danger-ghost:hover { background: rgba(255, 68, 88, .2); }

.btn-lg { padding: 16px 24px; font-size: 1rem; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 14px; font-size: .78rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .22;
  transform: scale(0);
  animation: ripple .55s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* Spinner */
.spinner {
  width: 18px; height: 18px; flex: none;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .7rem; font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); background: var(--success-soft); border-color: rgba(54, 255, 155, .3); }
.badge-warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, .3); }
.badge-danger  { color: var(--destructive); background: var(--destructive-soft); border-color: rgba(255, 68, 88, .3); }
.badge-info    { color: var(--chart-5); background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .3); }
.badge-plain::before { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .74rem; font-weight: 600;
  color: var(--muted);
}
.chip .icon { color: var(--accent-2); }

/* ---------- Progress ---------- */
.progress {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  position: relative;
  transition: width 1s var(--ease);
  overflow: hidden;
}
.progress-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmerX 2.2s linear infinite;
}
.progress-fill.warn { background: linear-gradient(135deg, #FBBF24, #F97316); }
.progress-fill.danger { background: linear-gradient(135deg, #FF4458, #FF6B81); }
@keyframes shimmerX { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ---------- Bottom navigation (floating dock) ---------- */
.nav-bar {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: calc(var(--shell-w) - 24px);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  z-index: 50;
  height: auto;
}
.nav-item {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--muted);
  transition: color .25s;
}
.nav-icon { display: grid; place-items: center; transition: transform .3s var(--spring); }
.nav-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { font-size: .62rem; font-weight: 700; }
.nav-item.active { color: var(--text); }
.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.08);
  color: var(--primary);
  filter: drop-shadow(0 4px 10px rgba(168, 85, 247, .45));
}
.nav-item:active .nav-icon { transform: scale(.88); }

/* ---------- Home: welcome banner ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 24px 20px;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 45%, #C084FC 100%);
  color: #fff;
  box-shadow: var(--glow);
}
.hero::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  top: -90px; inset-inline-end: -60px;
}
.hero::after {
  content: "";
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 22px solid rgba(255, 255, 255, .08);
  bottom: -70px; inset-inline-start: -30px;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 1.25rem; font-weight: 900; margin-bottom: 6px; }
.hero p { font-size: .82rem; opacity: .88; line-height: 1.8; margin-bottom: 16px; max-width: 78%; }
.hero .btn { background: rgba(255,255,255,.96); color: #7C3AED; box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.hero .btn:hover { transform: translateY(-2px); }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 5px 12px; border-radius: 999px;
  font-size: .7rem; font-weight: 700;
  margin-bottom: 12px;
}

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-card.wide { grid-column: 1 / -1; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: .74rem; font-weight: 600; }
.stat-ico {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--accent-2);
  border: 1px solid var(--border);
}
.stat-value { font-size: 1.12rem; font-weight: 800; }
.stat-sub { color: var(--muted); font-size: .72rem; }

/* ---------- Quick actions ---------- */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .74rem; font-weight: 700;
  transition: transform .2s var(--spring), background .2s;
}
.quick-btn:hover { background: var(--surface-2); transform: translateY(-3px); }
.quick-btn:active { transform: scale(.95); }
.quick-btn .icon { color: var(--accent-2); }

/* ---------- Plan cards ---------- */
.plan-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px;
}
.plan-card.popular {
  border-color: rgba(168, 85, 247, .55);
  background: linear-gradient(160deg, rgba(168, 85, 247, .14), var(--surface) 55%);
  box-shadow: var(--glow);
}
.plan-ribbon {
  position: absolute;
  top: 16px; inset-inline-start: -34px;
  transform: rotate(-45deg);
  background: var(--gold-grad);
  color: #fff;
  font-size: .64rem; font-weight: 800;
  padding: 5px 40px;
  box-shadow: 0 4px 12px rgba(251, 191, 36, .4);
  z-index: 2;
}
[dir="rtl"] .plan-ribbon { transform: rotate(45deg); inset-inline-start: auto; inset-inline-end: -34px; }

/* Header */
.plan-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.plan-ico {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--primary);
  transition: transform .3s var(--spring);
}
.plan-card:hover .plan-ico { transform: scale(1.06); }
.popular .plan-ico {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  box-shadow: var(--glow);
}
.plan-header-text { flex: 1; min-width: 0; }
.plan-name { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.plan-desc {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .74rem;
}
.off-badge {
  background: var(--destructive-soft);
  color: var(--destructive);
  border: 1px solid rgba(255, 68, 88, .3);
  font-size: .64rem; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
  flex: none;
}

/* Price section */
.plan-price-section {
  margin-bottom: 18px;
}
.plan-old-price {
  display: block;
  color: var(--muted);
  text-decoration: line-through;
  font-size: .78rem;
  margin-bottom: 4px;
}
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.plan-price {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.5px;
}
.plan-currency {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.plan-period {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Divider */
.plan-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* Features */
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.4;
}
.plan-features .icon {
  color: var(--primary);
  flex: none;
}

/* Legacy (payment page references) */
.plan-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.plan-meta { color: var(--muted); font-size: .74rem; margin-top: 3px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-box .old { color: var(--muted); text-decoration: line-through; font-size: .72rem; display: block; }
.price-box .price { font-size: 1.22rem; font-weight: 900; }
.price-box .price small { font-size: .68rem; font-weight: 600; color: var(--muted); margin-inline-start: 4px; }

/* Mini plan cards (home) */
.mini-plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mini-plan { display: flex; flex-direction: column; gap: 10px; }
.mini-plan .plan-ico { width: 40px; height: 40px; }
.mini-price { font-weight: 900; font-size: 1rem; }
.mini-price small { font-size: .64rem; color: var(--muted); font-weight: 600; }

/* ---------- Bank / payment card ---------- */
.bank-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 20px;
  color: #fff;
  background: linear-gradient(130deg, #1a0a30 0%, #6B21A8 45%, #A855F7 100%);
  box-shadow: 4px 4px 0 0 #000;
  border: 1px solid rgba(255, 255, 255, .14);
}
.bank-card::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
  top: -110px; inset-inline-end: -70px;
}
.bank-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.09) 48%, transparent 60%);
  transform: translateX(-100%);
  animation: cardShine 4.5s ease-in-out infinite;
}
@keyframes cardShine { 0%, 55% { transform: translateX(-110%); } 90%, 100% { transform: translateX(110%); } }
.bank-card > * { position: relative; z-index: 1; }
.bank-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.bank-name { font-size: .8rem; font-weight: 700; opacity: .9; display: flex; align-items: center; gap: 7px; }
.bank-chip {
  width: 42px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f5d576, #d4a437);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.3);
  position: relative;
}
.bank-chip::after {
  content: "";
  position: absolute; inset: 6px 5px;
  border: 1px solid rgba(0,0,0,.25);
  border-radius: 4px;
}
.card-number {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  direction: ltr;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.bank-bottom { display: flex; align-items: flex-end; justify-content: space-between; }
.bank-holder .lbl { font-size: .62rem; opacity: .7; margin-bottom: 3px; }
.bank-holder .val { font-size: .88rem; font-weight: 700; }
.bank-logo { font-size: .68rem; font-weight: 800; opacity: .85; letter-spacing: 1px; }

/* Info rows (copyable) */
.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.info-row .icon { color: var(--accent-2); }
.info-row .grow { flex: 1; min-width: 0; }
.info-row .lbl { font-size: .68rem; color: var(--muted); margin-bottom: 2px; }
.info-row .val { font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .2s var(--spring);
  position: relative; overflow: hidden;
}
.copy-btn:hover { color: var(--accent-2); transform: translateY(-2px); }
.copy-btn:active { transform: scale(.9); }

/* ---------- Plan summary (payment) ---------- */
.summary-card { display: flex; flex-direction: column; gap: 14px; }
.summary-top { display: flex; align-items: center; gap: 12px; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-price {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}
.summary-price .amount { font-size: 1.35rem; font-weight: 900; }
.summary-price .amount small { font-size: .7rem; color: var(--muted); font-weight: 600; margin-inline-start: 5px; }

/* ---------- Upload ---------- */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 30px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--accent-1);
  background: rgba(124, 92, 255, .07);
  transform: translateY(-2px);
}
.upload-ico {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--glow);
  animation: floatY 3s ease-in-out infinite;
}
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.upload-title { font-weight: 800; font-size: .92rem; }
.upload-hint { color: var(--muted); font-size: .72rem; }

.upload-preview { display: flex; flex-direction: column; gap: 12px; }
.preview-row { display: flex; align-items: center; gap: 13px; }
.preview-thumb {
  width: 64px; height: 64px; flex: none;
  border-radius: var(--r-sm);
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.preview-meta { flex: 1; min-width: 0; }
.preview-name { font-size: .82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; }
.preview-size { font-size: .7rem; color: var(--muted); margin-top: 3px; }
.remove-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--destructive-soft);
  border: 1px solid rgba(255, 68, 88, .28);
  color: var(--destructive);
  transition: all .2s var(--spring);
  position: relative; overflow: hidden;
}
.remove-btn:hover { background: rgba(255, 68, 88, .2); transform: translateY(-2px); }
.remove-btn:active { transform: scale(.9); }
.preview-success {
  display: flex; align-items: center; gap: 9px;
  background: var(--success-soft);
  border: 1px solid rgba(54, 255, 155, .3);
  color: var(--success);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: .78rem; font-weight: 700;
  animation: popIn .4s var(--spring) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- Radial chart (home analytics) ---------- */
.radial-block { text-align: center; padding: 22px 16px 18px; }
.radial-wrap { position: relative; width: 128px; margin: 0 auto 12px; }
.radial-svg { display: block; margin: 0 auto; }
.radial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.radial-pct { font-size: 1.75rem; font-weight: 900; }
.radial-pct small { font-size: .65rem; color: var(--muted); font-weight: 600; }
.radial-label { font-size: .62rem; color: var(--muted); }
.radial-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.radial-stat { text-align: center; }
.radial-stat .num-v { font-size: 1.05rem; font-weight: 900; }
.radial-stat .lbl { font-size: .62rem; color: var(--muted); margin-top: 4px; }

/* ---------- QR code ---------- */
.qr-svg { border-radius: 12px; padding: 8px; display: block; }
body .qr-svg { background: #f5f5f5; }
body.dark .qr-svg { background: #1a1a1a; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-wrap .qr-label { font-size: .68rem; color: var(--muted); font-weight: 600; }

/* ---------- Expandable connection sections ---------- */
.conn-card { padding: 0; overflow: hidden; }
.conn-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background .2s;
}
.conn-header:hover { background: var(--surface-2); }
.conn-header .grow { flex: 1; min-width: 0; }
.conn-header .plan-name { font-size: .95rem; }
.conn-header .chev { color: var(--muted); transition: transform .3s var(--ease); flex: none; }
.conn-card.open .conn-header .chev { transform: rotate(180deg); color: var(--accent-2); }
.conn-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease);
}
.conn-card.open .conn-body { max-height: 900px; }
.conn-inner { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.conn-sep { height: 1px; background: var(--border); margin: 0 18px; }
.conn-link-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.conn-link-row .grow { flex: 1; min-width: 0; }
.conn-link-row .lbl { font-size: .62rem; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.conn-link-row .val { font-size: .72rem; font-weight: 700; direction: ltr; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-qr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Note card */
.note-card {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(168, 85, 247, .08);
  border: 1px solid rgba(168, 85, 247, .22);
  color: var(--muted);
  font-size: .76rem; line-height: 1.9;
}
.note-card .icon { color: var(--primary); flex: none; margin-top: 2px; }

/* ---------- Subscription cards ---------- */
.sub-card { display: flex; flex-direction: column; gap: 14px; }
.sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sub-plan { display: flex; align-items: center; gap: 11px; }
.sub-name { font-weight: 800; font-size: .95rem; }
.sub-id { color: var(--muted); font-size: .68rem; margin-top: 3px; }
.sub-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.sub-stat .lbl { font-size: .66rem; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.sub-stat .val { font-size: .82rem; font-weight: 800; }
.sub-traffic .row { display: flex; justify-content: space-between; font-size: .72rem; margin-bottom: 7px; }
.sub-actions { display: flex; gap: 10px; }
.sub-actions .btn { flex: 1; }

/* ---------- Profile ---------- */
.profile-card { text-align: center; padding: 26px 18px 20px; position: relative; overflow: hidden; }
.profile-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 92px;
  background: var(--accent-grad);
  opacity: .85;
}
.profile-card > * { position: relative; }
.profile-card .avatar-lg { margin: 0 auto 12px; border: 3px solid var(--surface-solid); }
.profile-name { font-size: 1.15rem; font-weight: 900; }
.profile-user { color: var(--muted); font-size: .78rem; margin: 4px 0 12px; direction: ltr; }

.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 8px;
  text-align: center;
}
.pstat .num-v { font-size: 1.05rem; font-weight: 900; }
.pstat .lbl { font-size: .64rem; color: var(--muted); margin-top: 4px; }

/* List rows */
.list-card { padding: 6px; display: flex; flex-direction: column; }
.list-row {
  position: relative; overflow: hidden;
  width: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 12px;
  border-radius: var(--r-md);
  text-align: start;
  transition: background .2s;
}
.list-row:hover { background: var(--surface-2); }
.list-row .row-ico {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: .85rem; font-weight: 700; }
.list-row .s { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.list-row .chev { color: var(--muted); flex: none; }
.list-sep { height: 1px; background: var(--border); margin: 2px 12px; }

/* Toggle switch */
.switch {
  width: 46px; height: 26px; flex: none;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background .3s var(--ease), border-color .3s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; inset-inline-start: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .3s var(--spring);
}
.switch.on { background: var(--primary); border-color: var(--primary); }
.switch.on::after { transform: translateX(-19px); }

/* ---------- Support ---------- */
.support-hero { text-align: center; padding: 28px 20px; }
.support-hero .big-ico {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--glow);
  animation: floatY 3.4s ease-in-out infinite;
}
.support-hero h2 { font-size: 1.1rem; font-weight: 900; margin-bottom: 6px; }
.support-hero p { color: var(--muted); font-size: .78rem; }

.faq-item { overflow: hidden; }
.faq-q {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 15px 4px;
  text-align: start;
  font-size: .85rem; font-weight: 700;
}
.faq-q .chev { margin-inline-start: auto; color: var(--muted); transition: transform .3s var(--ease); flex: none; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); color: var(--accent-2); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.faq-a p { color: var(--muted); font-size: .78rem; line-height: 2; padding: 0 4px 15px; }
.faq-item.open .faq-a { max-height: 220px; }

.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.step:last-child { padding-bottom: 4px; }
.step::before {
  content: "";
  position: absolute;
  top: 38px; bottom: 2px;
  inset-inline-start: 18px;
  width: 2px;
  background: linear-gradient(var(--border-strong), transparent);
}
.step:last-child::before { display: none; }
.step-num {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-weight: 900; font-size: .85rem;
  color: var(--accent-2);
  position: relative; z-index: 1;
}
.step-body .t { font-weight: 800; font-size: .86rem; margin-bottom: 4px; padding-top: 8px; }
.step-body .s { color: var(--muted); font-size: .74rem; line-height: 1.9; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop.closing { animation: fadeOut .22s ease both; }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: 100%; max-width: var(--shell-w);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .4s var(--spring) both;
  box-shadow: 0 -12px 50px rgba(0, 0, 0, .45);
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-backdrop.closing .modal { animation: sheetDown .25s ease both; }
@keyframes sheetDown { to { transform: translateY(70px); opacity: 0; } }
.modal-handle {
  width: 42px; height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 6px auto 16px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 1.02rem; font-weight: 800; }
.modal-close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: all .2s;
}
.modal-close:hover { color: var(--text); }
.modal-body { display: flex; flex-direction: column; gap: 12px; }

.modal-success-ico {
  width: 76px; height: 76px;
  margin: 6px auto 4px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-grad);
  color: #fff;
  box-shadow: var(--shadow);
  animation: popIn .45s var(--spring) both;
}

/* Config rows inside modal */
.config-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 12px;
}
.config-row .grow { flex: 1; min-width: 0; }
.config-row .lbl { font-size: .64rem; color: var(--muted); }
.config-row .val { font-size: .8rem; font-weight: 700; direction: ltr; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: min(92vw, var(--shell-w) - 24px);
  z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 13px 15px;
  box-shadow: var(--shadow);
  font-size: .82rem; font-weight: 700;
  backdrop-filter: blur(18px);
  animation: toastIn .4s var(--spring) both;
}
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-18px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
.toast .t-ico {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
}
.toast-success .t-ico { background: var(--success-soft); color: var(--success); }
.toast-info .t-ico { background: rgba(168, 85, 247, .15); color: var(--primary); }
.toast-error .t-ico { background: var(--destructive-soft); color: var(--destructive); }

/* ---------- Skeleton ---------- */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface) 25%, var(--shimmer) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skel 1.3s linear infinite;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { height: 120px; border-radius: var(--r-lg); }
.skel-line { height: 14px; }

/* ---------- Utilities ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.center { text-align: center; }

/* Scrollbar */
::-webkit-scrollbar { width: 0; height: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
