:root {
  --bg-deep: #0a0f1e;
  --bg-card: #0f1729;
  --bg-card-hover: #162135;
  --bg-nav: rgba(10, 15, 30, 0.95);
  --border-subtle: rgba(147, 197, 253, 0.08);
  --border-card: rgba(147, 197, 253, 0.12);
  --text-primary: #eef2f8;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --blue: #93c5fd;
  --blue2: #6db3f2;
  --green: #6ee7b7;
  --red: #fca5a5;
  --purple: #a78bfa;
  --glass-bg: rgba(15, 23, 41, 0.8);
  --glass-border: rgba(147, 197, 253, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Navigation ─────────────────────────────────────── */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue), #6db3f2);
  border-radius: 10px;
  color: #000;
  font-size: 1.1rem;
}

.text-blue { color: var(--blue); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--blue); background: rgba(147, 197, 253, 0.1); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-outline-blue {
  border: 1px solid rgba(147, 197, 253, 0.3);
  color: var(--blue);
  background: transparent;
  transition: all 0.2s;
}

.btn-outline-blue:hover {
  background: var(--blue);
  color: #000;
  border-color: var(--blue);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
}

/* ─── Main Content ───────────────────────────────────── */

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Flash Messages ─────────────────────────────────── */

.flash-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.flash-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(10px);
}

.flash-alert button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.flash-success { background: rgba(0, 200, 83, 0.15); border: 1px solid rgba(0, 200, 83, 0.3); color: var(--green); }
.flash-error { background: rgba(255, 23, 68, 0.15); border: 1px solid rgba(255, 23, 68, 0.3); color: var(--red); }
.flash-warning { background: rgba(147, 197, 253, 0.15); border: 1px solid rgba(147, 197, 253, 0.3); color: var(--blue); }
.flash-info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--blue); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Cards ──────────────────────────────────────────── */

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.glass-card-sm {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
}

/* ─── Dashboard Stats ────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(26, 34, 53, 0.9));
  border: 1px solid var(--border-card);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.5;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-change { font-size: 0.85rem; margin-top: 4px; }
.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

.stat-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: 0.1;
  color: var(--blue);
}

/* ─── Buttons ────────────────────────────────────────── */

.btn-blue {
  background: linear-gradient(135deg, var(--blue), #6db3f2);
  border: none;
  color: #000;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-blue:hover {
  background: linear-gradient(135deg, var(--blue2), #5ab0d0);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(147, 197, 253, 0.3);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ─── Tables ─────────────────────────────────────────── */

.invest-table {
  width: 100%;
  border-collapse: collapse;
}

.invest-table th {
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  text-align: left;
  font-weight: 600;
}

.invest-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.invest-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Status Badges ──────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-pending { background: rgba(147, 197, 253, 0.15); color: var(--blue); }
.status-approved { background: rgba(0, 200, 83, 0.15); color: var(--green); }
.status-rejected { background: rgba(255, 23, 68, 0.15); color: var(--red); }

/* ─── Forms ──────────────────────────────────────────── */

.invest-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s;
}

.invest-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.1);
}

.invest-input::placeholder { color: var(--text-muted); }

.invest-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text-primary);
  width: 100%;
}

.invest-select:focus {
  outline: none;
  border-color: var(--blue);
}

/* ─── Rate Display ───────────────────────────────────── */

.rate-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.rate-ticker .ticker { font-weight: 600; color: var(--text-primary); }
.rate-ticker .price { font-weight: 500; color: var(--text-secondary); }
.rate-ticker .change { font-size: 0.8rem; }
.rate-ticker .change.up { color: var(--green); }
.rate-ticker .change.down { color: var(--red); }

/* ─── Pagination ─────────────────────────────────────── */

.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.page-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.page-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.page-btn.active { background: var(--blue); color: #000; border-color: var(--blue); }

/* ─── Footer ─────────────────────────────────────────── */

.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 24px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 16px;
}

.footer-links a:hover { color: var(--blue); }

/* ─── Login Page ─────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.08) 0%, transparent 70%);
  top: -200px;
  left: -200px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  text-align: center;
}

.login-logo {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.tg-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: #2AABEE;
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}

.tg-login-btn:hover { background: #229ed9; color: #fff; transform: translateY(-1px); }

.login-divider {
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-divider::before, .login-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border-subtle); }

/* ─── Section Headers ────────────────────────────────── */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Balance Card ───────────────────────────────────── */

.balance-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.1), transparent);
  border-radius: 50%;
}

.balance-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.balance-amount {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.balance-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 991px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: -280px;
    width: 280px;
    bottom: 0;
    background: var(--bg-deep);
    border-right: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    transition: left 0.3s ease;
    z-index: 999;
  }

  .nav-links.open { left: 0; }
  .mobile-overlay.active { display: block; }
  .nav-toggle { display: block; }
  .nav-label { display: inline; }
  .nav-right { margin-left: auto; }
  .nav-user span { display: none; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .main-content { padding: 16px; }

  .balance-amount { font-size: 1.75rem; }
}

@media (max-width: 576px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; margin: 16px; }
  .nav-container { padding: 0 16px; gap: 16px; }
}

/* ─── Charts ─────────────────────────────────────────── */

.chart-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.chart-timeframes {
  display: flex;
  gap: 4px;
}

.tf-btn {
  padding: 4px 10px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tf-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.05); }
.tf-btn.active { color: var(--blue); background: rgba(147,197,253,0.1); }

/* ─── Method Cards ───────────────────────────────────── */

.method-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.method-card:hover { background: rgba(255,255,255,0.06); border-color: var(--blue); }
.method-card.selected { border-color: var(--blue); background: rgba(147,197,253,0.08); }

.method-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.2rem;
  background: rgba(147,197,253,0.1);
  color: var(--blue);
}

.method-info { flex: 1; }
.method-name { font-weight: 600; font-size: 0.95rem; }
.method-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* ─── Price Ticker Bar ───────────────────────────────── */

.ticker-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 24px;
  scrollbar-width: none;
}

.ticker-bar::-webkit-scrollbar { display: none; }

.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-size: 0.85rem;
}

.ticker-symbol { font-weight: 700; color: var(--text-primary); }
.ticker-price { color: var(--text-secondary); }
.ticker-change { font-weight: 500; }
.ticker-change.up { color: var(--green); }
.ticker-change.down { color: var(--red); }

/* ─── Filter Bar ─────────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.filter-bar .invest-input,
.filter-bar .invest-select {
  width: auto;
  min-width: 140px;
}

/* ─── Skeleton Loader ────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Animations ─────────────────────────────────────── */

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.pulse-dot.green { background: var(--green); box-shadow: 0 0 8px rgba(0,200,83,0.5); }
.pulse-dot.blue { background: var(--blue); box-shadow: 0 0 8px rgba(147,197,253,0.5); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ════════════════════════════════════════════════════════
   TMA — Premium Telegram Mini App Design System
   ════════════════════════════════════════════════════════ */

:root {
  --tma-bg: #080c1a;
  --tma-surface: #0f1320;
  --tma-surface2: #161b2b;
  --tma-border: rgba(255,255,255,0.06);
  --tma-border-soft: rgba(255,255,255,0.04);
  --tma-text: #f0f2f5;
  --tma-text2: #9ca3af;
  --tma-text3: #4b5563;
  --accent: #93c5fd;
  --accent-soft: rgba(147,197,253,0.12);
  --green: #6ee7b7;
  --red: #fca5a5;
  --blue: #93c5fd;
  --purple: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-full: 999px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--tma-bg);
  color: var(--tma-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ─── Splash ─────────────────────────────────────── */

.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--tma-bg);
  gap: 14px; transition: opacity .35s ease;
}

.splash-ring {
  position: absolute; width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147,197,253,0.06) 0%, transparent 70%);
  animation: splashPulse 2s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.15); opacity: .2; }
}

.splash-logo { position: relative; z-index: 1; }
.splash-logo circle { transition: stroke-dashoffset .7s ease; }
.splash-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.04em; margin-top: 4px; }
.splash-sub { font-size: .78rem; color: var(--tma-text2); letter-spacing: .04em; text-transform: uppercase; }

/* ─── Topbar ─────────────────────────────────────── */

.topbar {
  display: flex; align-items: center;
  padding: 10px 16px 6px;
  flex-shrink: 0;
  background: var(--tma-bg);
}

.topbar-left { flex: 1; }
.topbar-greeting { font-weight: 600; font-size: .9rem; color: var(--tma-text); }
.topbar-center { text-align: center; }
.topbar-brand { font-weight: 700; font-size: .95rem; letter-spacing: -.03em; color: var(--tma-text); }
.text-accent { color: var(--accent) !important; }
.topbar-right { flex: 1; text-align: right; }
.topbar-btn {
  background: none; border: none; color: var(--tma-text2);
  padding: 6px; cursor: pointer; border-radius: 8px;
  transition: background .15s;
}
.topbar-btn:active { background: var(--tma-surface2); }

/* ─── Scroller ───────────────────────────────────── */

.scroller {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 14px 8px;
  transition: opacity .18s ease, transform .18s ease;
}

.scroller::-webkit-scrollbar { width: 3px; }
.scroller::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.panel { padding: 4px 0 12px; }

/* ─── Navbar ─────────────────────────────────────── */

.navbar {
  position: relative;
  display: flex; flex-shrink: 0;
  background: var(--tma-surface);
  border-top: 1px solid var(--tma-border);
  padding: 4px 0;
  padding-bottom: calc(4px + var(--safe-b));
  z-index: 10;
}

.nav-indicator {
  position: absolute; top: 0; left: 0;
  width: 20%; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}

.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 5px 0 4px;
  background: none; border: none;
  color: var(--tma-text3);
  font-size: .6rem; font-weight: 500;
  cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-btn svg { transition: color .15s; }
.nav-btn span { letter-spacing: .01em; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active svg { color: var(--accent); }

/* ─── Hero Card ──────────────────────────────────── */

.hero-card {
  position: relative;
  background: linear-gradient(135deg, #12162a 0%, #1a1a3e 50%, #0f2030 100%);
  border-radius: 18px;
  padding: 22px 20px 18px;
  margin-bottom: 14px;
  overflow: hidden;
  isolation: isolate;
}

.hero-card::before {
  content: ''; position: absolute;
  inset: 0; border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(147,197,253,.3), transparent 50%, rgba(147,197,253,.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.hero-glow {
  position: absolute; top: -30%; right: -20%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(147,197,253,0.08), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-label { font-size: .72rem; color: var(--tma-text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; position: relative; }
.hero-amount { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; position: relative; }
.hero-row { display: flex; gap: 18px; margin-top: 8px; font-size: .76rem; color: rgba(255,255,255,0.55); position: relative; }
.hero-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ─── Metric Grid ───────────────────────────────── */

.grid-4 {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 14px;
}

.metric {
  background: var(--tma-surface2);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  text-align: center;
  border: 1px solid var(--tma-border-soft);
}

.metric-val { display: block; font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.metric-lbl { display: block; font-size: .62rem; color: var(--tma-text3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ─── Card (generic) ─────────────────────────────── */

.card {
  background: var(--tma-surface2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--tma-border-soft);
}

/* ─── Section Label ──────────────────────────────── */

.section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--tma-text3);
  margin: 10px 0 8px;
}

/* ─── Ticker Strip ──────────────────────────────── */

.ticker-strip {
  display: flex; gap: 7px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.ticker-strip::-webkit-scrollbar { display: none; }

.ticker-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  background: var(--tma-surface2);
  border-radius: var(--radius-full);
  white-space: nowrap;
  font-size: .74rem;
  border: 1px solid var(--tma-border);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.ticker-pill:active { border-color: var(--accent); }

.tp-sym { font-weight: 700; color: var(--tma-text); }
.tp-prc { font-weight: 500; color: var(--tma-text2); }

/* ─── Transaction Row ───────────────────────────── */

.tx-list { display: flex; flex-direction: column; gap: 6px; }

.tx-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--tma-surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--tma-border-soft);
  transition: background .15s;
}
.tx-row:active { background: rgba(255,255,255,0.04); }

.tx-badge {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.tx-badge.ok { background: rgba(34,197,94,0.12); color: var(--green); }
.tx-badge.fail { background: rgba(239,68,68,0.12); color: var(--red); }
.tx-badge.pend { background: var(--accent-soft); color: var(--accent); }

.tx-body { flex: 1; min-width: 0; }
.tx-amount { font-weight: 600; font-size: .86rem; }
.tx-meta { font-size: .72rem; color: var(--tma-text2); }

.tx-date { font-size: .7rem; color: var(--tma-text3); flex-shrink: 0; }

/* ─── Converter ─────────────────────────────────── */

.conv-card {
  background: var(--tma-surface2);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--tma-border);
}

.conv-field { margin-bottom: 8px; }
.conv-label { font-size: .76rem; color: var(--tma-text2); margin-bottom: 6px; }

.conv-input-wrap {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--tma-border);
  overflow: hidden;
  transition: border-color .15s;
}
.conv-input-wrap:focus-within { border-color: var(--accent); }

.conv-input {
  flex: 1;
  background: none; border: none;
  padding: 11px 14px;
  font-size: 1.15rem; font-weight: 700;
  color: var(--tma-text);
  outline: none; min-width: 0;
  font-family: 'Inter', sans-serif;
}
.conv-input::-webkit-outer-spin-button,
.conv-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-input[type=number] { -moz-appearance: textfield; }

.conv-unit {
  padding-right: 14px;
  font-size: .8rem; font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
}

.conv-arrow { text-align: center; padding: 2px 0; color: var(--tma-text3); }
.conv-arrow svg { display: inline-block; vertical-align: middle; }

.conv-result {
  font-size: 1.3rem; font-weight: 700;
  color: var(--accent);
  padding: 4px 0;
}

.conv-rate { font-size: .74rem; color: var(--tma-text3); margin-top: 6px; }

/* ─── Method Strip ──────────────────────────────── */

.method-strip { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.method-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: var(--tma-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--tma-border);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.method-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.method-row:not(.sel):active { background: rgba(255,255,255,0.04); }

.method-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.method-body { flex: 1; }
.method-name { font-weight: 600; font-size: .86rem; }
.method-desc { font-size: .72rem; color: var(--tma-text2); }
.method-rate { font-size: .8rem; font-weight: 600; color: var(--accent); }

/* ─── Primary Button ────────────────────────────── */

.btn-action {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #6db3f2);
  border: none;
  color: #080c1a;
  font-weight: 800;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-align: center;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: -.01em;
}
.btn-action:active { transform: scale(.97); }
.btn-action:disabled { opacity: .4; pointer-events: none; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: #080c1a;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: .88rem;
  transition: opacity .15s;
}
.btn-primary:active { opacity: .8; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--tma-border);
  color: var(--tma-text2);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s;
}
.btn-ghost:active { border-color: var(--tma-text2); }

/* ─── Info Line ─────────────────────────────────── */

.info-line {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: .74rem;
  color: var(--tma-text2);
  margin-top: 12px;
  line-height: 1.4;
}
.info-line svg { flex-shrink: 0; margin-top: 1px; }

/* ─── Filter Strip ──────────────────────────────── */

.filter-strip {
  display: flex; gap: 6px;
  overflow-x: auto; margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-strip::-webkit-scrollbar { display: none; }

.flt-chip {
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: var(--tma-surface);
  border: 1px solid var(--tma-border);
  color: var(--tma-text2);
  font-size: .74rem;
  cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.flt-chip.active { background: var(--accent); color: #080c1a; border-color: var(--accent); font-weight: 600; }
.flt-chip:not(.active):active { background: var(--tma-surface2); }

/* ─── Calculator ────────────────────────────────── */

.calc-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.calc-row:last-of-type { margin-bottom: 0; }

.calc-lbl {
  font-size: .8rem; color: var(--tma-text2);
  min-width: 70px; flex-shrink: 0;
}

.calc-inp {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--tma-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--tma-text);
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s;
}
.calc-inp:focus { border-color: var(--accent); }
.calc-inp::-webkit-outer-spin-button,
.calc-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-inp[type=number] { -moz-appearance: textfield; }

.calc-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--tma-border);
  border-radius: 4px;
  outline: none;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--tma-bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.calc-val { font-size: .82rem; color: var(--tma-text2); min-width: 45px; text-align: right; }

.calc-divider { height: 1px; background: var(--tma-border); margin: 14px 0 10px; }

.calc-res { display: flex; flex-direction: column; }

.calc-res-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--tma-border-soft);
  font-size: .84rem;
}
.calc-res-item:last-child { border-bottom: none; }
.calc-res-item span { color: var(--tma-text2); }
.calc-res-item strong { font-weight: 700; color: var(--tma-text); }

/* ─── Mini Table ───────────────────────────────── */

.mini-tbl {
  width: 100%; border-collapse: collapse;
  font-size: .8rem;
}
.mini-tbl th {
  padding: 10px 14px;
  text-align: left;
  color: var(--tma-text3);
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--tma-border);
}
.mini-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tma-border-soft);
  color: var(--tma-text);
}
.mini-tbl tr:last-child td { border-bottom: none; }

/* ─── Profile ───────────────────────────────────── */

.profile-head {
  text-align: center;
  padding: 18px 0 14px;
}

.profile-avatar {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6db3f2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #080c1a;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.profile-name { font-size: 1.1rem; font-weight: 700; }
.profile-id { font-size: .76rem; color: var(--tma-text2); margin-top: 2px; }

.ref-row {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px;
  background: var(--tma-surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--tma-border-soft);
  cursor: pointer;
}
.ref-row:active { background: rgba(255,255,255,0.04); }

.ref-code {
  flex: 1; font-size: .7rem;
  color: var(--accent);
  word-break: break-all;
  background: none; border: none;
  font-family: 'Inter', monospace;
  line-height: 1.4;
}

.ref-copy { color: var(--tma-text3); flex-shrink: 0; display: flex; }

.info-rows { display: flex; flex-direction: column; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--tma-border-soft);
  font-size: .82rem;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--tma-text2); }
.info-row strong { color: var(--tma-text); font-weight: 700; }

.about-card {
  background: var(--tma-surface2);
  border-radius: var(--radius);
  padding: 14px;
  font-size: .8rem; line-height: 1.5;
  color: var(--tma-text2);
  border: 1px solid var(--tma-border-soft);
}

.about-links { display: flex; gap: 10px; margin-top: 10px; }

.about-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--accent);
  text-decoration: none;
  font-size: .78rem; font-weight: 600;
  transition: opacity .15s;
}
.about-link:active { opacity: .7; }

/* ─── Empty State ──────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--tma-text2);
}
.empty-state h3 { color: var(--tma-text); margin-bottom: 6px; font-size: .95rem; font-weight: 600; }
.empty-state p { font-size: .82rem; margin-bottom: 16px; color: var(--tma-text2); }
.empty-icon { margin-bottom: 12px; display: flex; justify-content: center; }

.empty-sm { text-align: center; padding: 18px; font-size: .76rem; color: var(--tma-text3); }

/* ─── Toast ─────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  z-index: 99999;
  opacity: 0;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
  max-width: 88vw;
  pointer-events: none;
  text-align: center;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.t-ok { background: rgba(34,197,94,0.92); color: #fff; }
.t-error { background: rgba(239,68,68,0.92); color: #fff; }
.t-info { background: rgba(59,130,246,0.92); color: #fff; }

/* ─── Loader ────────────────────────────────────── */

.loader-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}

.loader-ring {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.06);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dark mode overrides ───────────────────────── */

.dark .navbar { border-top-color: rgba(255,255,255,0.06); }

/* ─── Safe areas ────────────────────────────────── */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .navbar { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
}
