:root {
  --bg: #f0f9ff;
  --bg-card: #ffffff;
  --bg-elevated: #e0f2fe;
  --bg-sidebar: #ffffff;
  --border: #bae6fd;
  --border-light: #e0f2fe;
  --text: #0c4a6e;
  --text-secondary: #075985;
  --text-muted: #64748b;
  --primary: #0ea5e9;
  --primary-light: #e0f2fe;
  --primary-hover: #0284c7;
  --accent: #38bdf8;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  --gradient-soft: linear-gradient(160deg, #ffffff 0%, #f0f9ff 50%, #e0f2fe 100%);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(14, 165, 233, 0.05);
  --shadow: 0 2px 8px rgba(14, 165, 233, 0.07), 0 8px 24px rgba(14, 165, 233, 0.06);
  --shadow-lg: 0 8px 32px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.06);
  --shadow-glow: 0 0 0 1px rgba(14, 165, 233, 0.08), 0 12px 40px rgba(14, 165, 233, 0.14);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --nav-height: 60px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 45%, #e0f2fe 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
body.mobile-nav-open .navbar {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.1);
}
.nav-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-left {
  display: flex; align-items: center; gap: 12px;
}
.nav-menu-btn {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-menu-btn:hover { background: var(--bg-elevated); border-color: #d1d5db; }
.nav-menu-line {
  display: block; width: 18px; height: 2px;
  background: var(--text-secondary); border-radius: 1px;
  margin: 0 auto; transition: transform 0.2s, opacity 0.2s;
}
body.mobile-nav-open .nav-menu-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.mobile-nav-open .nav-menu-line:nth-child(2) { opacity: 0; }
body.mobile-nav-open .nav-menu-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.125rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; text-decoration: none;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.logo-mark::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, transparent 55%);
}
.logo-mark-inner {
  font-size: 0.875rem; font-weight: 800; color: #fff;
  position: relative; z-index: 1; letter-spacing: -0.04em;
}
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--text-muted); font-weight: 500; font-size: 0.875rem; text-decoration: none; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-user {
  color: var(--text-secondary); font-size: 0.8125rem; font-weight: 600;
  padding: 6px 14px; background: var(--gradient-soft);
  border: 1px solid var(--border-light); border-radius: 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.875rem; border: none; cursor: pointer;
  transition: all 0.18s ease; text-decoration: none; font-family: inherit;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 1px 2px rgba(14,165,233,0.2), 0 4px 12px rgba(14,165,233,0.18);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(14,165,233,0.28), 0 8px 20px rgba(14,165,233,0.22);
  text-decoration: none; color: #fff;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elevated); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-xs { padding: 5px 10px; font-size: 0.75rem; border-radius: 6px; }
.btn-lg { padding: 13px 24px; font-size: 0.9375rem; }
.btn-full { width: 100%; }

/* ── Flash ── */
.flash-container { max-width: 1200px; margin: 12px auto; padding: 0 24px; }
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: 0.875rem; font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

/* ── Landing ── */
.hero {
  position: relative; padding: 96px 0 72px; overflow: hidden; text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero-glow {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(14,165,233,0.12), transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  background: var(--primary-light); border: 1px solid #bae6fd;
  font-size: 0.75rem; font-weight: 600; color: var(--primary);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 800;
  line-height: 1.08; margin-bottom: 20px; letter-spacing: -0.03em;
}
.gradient-text {
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: 1.0625rem; color: var(--text-muted); max-width: 480px; margin: 0 auto 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.live-prices { padding: 64px 0; background: var(--bg); }
.section-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 32px; text-align: center; letter-spacing: -0.02em; }
.price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.price-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s ease; box-shadow: var(--shadow-xs);
}
.price-card:hover { border-color: #7dd3fc; box-shadow: var(--shadow); transform: translateY(-2px); }

.coin-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
}
.coin-logo-xs {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.18);
}
.assets-held-stack .coin-logo-xs {
  margin-left: -10px;
  position: relative;
}
.assets-held-stack .coin-logo-xs:first-child { margin-left: 0; z-index: 5; }
.assets-held-stack .coin-logo-xs:nth-child(2) { z-index: 4; }
.assets-held-stack .coin-logo-xs:nth-child(3) { z-index: 3; }
.assets-held-stack .coin-logo-xs:nth-child(4) { z-index: 2; }
.assets-held-stack .coin-logo-xs:nth-child(5) { z-index: 1; }
.coin-logo-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.12);
}
.coin-logo-md {
  width: 44px; height: 44px;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.14);
}
.coin-logo-lg {
  width: 52px; height: 52px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.coin-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
}
.coin-btc { background: #fef3c7; color: #d97706; }
.coin-eth { background: #e0f2fe; color: #0284c7; }
.coin-sol { background: #bae6fd; color: #0369a1; }
.coin-ada { background: #dbeafe; color: #2563eb; }
.coin-xrp { background: #f3f4f6; color: #374151; }
.coin-dot { background: #fce7f3; color: #db2777; }
.coin-doge { background: #fef9c3; color: #ca8a04; }
.coin-avax { background: #fee2e2; color: #dc2626; }
.coin-link { background: #e0f2fe; color: #0284c7; }
.coin-ltc { background: #f3f4f6; color: #6b7280; }
.coin-icon-sm {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.6875rem; flex-shrink: 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
}

.price-info { flex: 1; }
.coin-name { display: block; font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; }
.coin-symbol { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.price-value { text-align: right; }
.usd { display: block; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; }
.change { font-size: 0.75rem; font-weight: 600; }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.features { padding: 64px 0 80px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: all 0.2s ease;
}
.feature-card:hover { box-shadow: var(--shadow); border-color: #d1d5db; }
.feature-icon-num {
  font-size: 0.75rem; font-weight: 700; color: var(--primary);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; letter-spacing: 0.02em;
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature-card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.65; }

.cta { padding: 48px 0 80px; }
.cta-inner {
  text-align: center; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 56px 32px; box-shadow: var(--shadow-xs);
}
.cta-inner h2 { font-size: 1.625rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.cta-inner p { color: var(--text-muted); margin-bottom: 28px; }

/* ── Auth ── */
.auth-page { display: flex; flex-direction: column; background: var(--bg); }
.auth-container {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(14,165,233,0.08) 0%, transparent 55%);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--gradient);
}
.auth-logo {
  display: flex; justify-content: center; margin-bottom: 20px;
}
.auth-logo .logo-mark { width: 48px; height: 48px; border-radius: 14px; }
.auth-logo .logo-mark-inner { font-size: 1.25rem; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 1.375rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-header p { color: var(--text-muted); font-size: 0.875rem; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.label-optional { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.form-group input, .form-group select, .form-group textarea {
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--border);
  color: var(--text); font-size: 0.9375rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.form-group input:hover, .form-group select:hover { border-color: #d1d5db; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.input-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.875rem; letter-spacing: 0.02em; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.875rem; color: var(--text-muted); }

/* Auth login / logout loading box */
body.auth-loading-active {
  overflow: hidden;
  touch-action: none;
}
.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.auth-loading-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.auth-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-width: 260px;
  padding: 36px 44px 40px;
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-glow), 0 20px 50px rgba(14, 165, 233, 0.18);
  animation: auth-loading-box-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes auth-loading-box-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.auth-loading-label {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
}
.auth-loading-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #e0f2fe;
  border-top-color: var(--primary);
  border-right-color: #38bdf8;
  animation: auth-loading-spin 0.75s linear infinite;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.08);
}
@keyframes auth-loading-spin {
  to { transform: rotate(360deg); }
}

/* ── App shell ── */
.app-page { display: flex; flex-direction: column; }
.app-page .footer-app { display: none; }

.app-shell { display: flex; flex: 1; min-height: calc(100vh - var(--nav-height)); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; top: var(--nav-height);
  background: rgba(17, 24, 39, 0.45);
  z-index: 140;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
body.mobile-nav-open .sidebar-overlay { display: block; }

.sidebar-mobile-header {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.sidebar-mobile-title {
  font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em;
}
.sidebar-close-btn {
  background: none; border: none; font-size: 1.5rem; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px;
}

.app-sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 0;
}
.sidebar-brand-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.9375rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.03em; text-decoration: none;
}
.sidebar-brand-link:hover { color: var(--primary); text-decoration: none; }
.logo-mark-sm { width: 26px; height: 26px; border-radius: 8px; }
.logo-mark-sm .logo-mark-inner { font-size: 0.75rem; }

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 20px; margin: 12px 12px 4px;
  background: var(--gradient-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}
.sidebar-user-info strong {
  display: block; font-size: 0.8125rem; font-weight: 600;
  letter-spacing: -0.01em;
}
.sidebar-user-info .muted {
  font-size: 0.6875rem; display: block; max-width: 148px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section {
  font-size: 0.6875rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 16px 12px 6px;
}
.sidebar-section:first-child { padding-top: 8px; }

.sidebar-link {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 0.875rem;
  text-decoration: none; transition: all 0.15s ease;
  border-left: 3px solid transparent; margin-left: -3px;
}
.sidebar-link:hover {
  background: var(--bg-elevated); color: var(--text-secondary); text-decoration: none;
}
.sidebar-link.active {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600; border-left-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.12);
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-light); }
.sidebar-logout { color: var(--text-muted); }
.sidebar-logout:hover { color: var(--danger); background: var(--danger-bg); }

.app-main {
  flex: 1; padding: 32px 36px 48px;
  overflow-x: auto; min-width: 0;
  max-width: calc(100vw - 248px);
}

.flash-container-app {
  max-width: none; margin: 0;
  padding: 12px 36px 0 284px;
}

/* ── Page header ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 20px;
}
.page-header-text { flex: 1; }
.page-eyebrow {
  display: block; font-size: 0.6875rem; font-weight: 700;
  color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 6px;
}
.page-header h1 {
  font-size: 1.625rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.2;
}
.page-sub { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

.balance-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  text-align: right; box-shadow: var(--shadow-xs);
}
.balance-pill-label { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.balance-pill-value { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.balance-pill-crypto { text-align: right; }
.balance-pill-crypto .crypto-balance-amt {
  display: block; font-size: 1.125rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}
.balance-pill-usd {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-muted); margin-top: 2px;
}
.balance-pill-wide { min-width: 180px; }
.balance-pill-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.crypto-balances { display: flex; flex-direction: column; gap: 12px; }
.crypto-balances-stat { margin-top: 4px; }
.crypto-balances-compact { gap: 8px; }
.crypto-balance-item { display: flex; flex-direction: column; gap: 2px; }
.crypto-balance-amt {
  font-weight: 700; font-size: 1rem; letter-spacing: -0.02em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text);
}
.crypto-balances-stat .crypto-balance-amt { font-size: 1.25rem; }
.crypto-balance-usd {
  font-size: 0.8125rem; font-weight: 500; color: var(--text-muted);
}
.crypto-balance-empty { font-size: 0.875rem; padding: 4px 0; }
.info-value-stack {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.td-balance {
  display: flex; flex-direction: column; gap: 3px;
}
.td-balance .crypto-balance-amt { font-size: 0.9375rem; }
.td-balance .crypto-balance-usd { font-size: 0.75rem; }
.summary-item-crypto { flex-direction: column; align-items: flex-start; gap: 8px; }
.summary-item-crypto .crypto-balances { width: 100%; }

/* Asset picker on dashboard */
.stat-card-picker {
  position: relative; padding: 0; overflow: visible;
  background: linear-gradient(160deg, #ffffff 0%, #f8fcff 100%);
  border-color: #bae6fd;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.stat-card-picker:hover { box-shadow: var(--shadow); border-color: #7dd3fc; }
.stat-card-picker.open {
  z-index: 60;
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}
.stat-card-trigger {
  width: 100%; height: 100%; min-height: 100%;
  padding: 20px 22px 18px; border: none; background: transparent;
  cursor: pointer; text-align: left; font-family: inherit;
  border-radius: var(--radius-lg);
  transition: background var(--transition);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.stat-card-trigger:hover { background: rgba(240, 249, 255, 0.65); }
.stat-card-picker.open .stat-card-trigger {
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
}
.stat-card-trigger .stat-label { pointer-events: none; margin-bottom: 0; }
.assets-held-top {
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.assets-held-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  color: var(--primary); background: var(--primary-light);
  border: 1px solid #bae6fd;
}
.stat-chevron-btn {
  margin-left: auto;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-light);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.stat-card-trigger:hover .stat-chevron-btn,
.stat-card-picker.open .stat-chevron-btn {
  background: var(--primary-light); border-color: #7dd3fc;
}
.stat-chevron {
  width: 7px; height: 7px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg); margin-top: -2px;
  transition: transform var(--transition);
}
.stat-card-picker.open .stat-chevron { transform: rotate(-135deg); margin-top: 2px; }
.assets-held-preview {
  display: flex; flex-direction: column; gap: 8px;
}
.assets-held-stack {
  display: flex; align-items: center; min-height: 32px;
}
.coin-icon-xs {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.625rem; flex-shrink: 0;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.18);
  margin-left: -10px; position: relative;
  transition: transform var(--transition);
}
.assets-held-more {
  margin-left: 6px; font-size: 0.6875rem; font-weight: 700;
  color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border-light); border-radius: 999px;
  padding: 4px 8px;
}
.stat-card-trigger:hover .assets-held-stack .coin-logo-xs { transform: translateY(-1px); }
.assets-held-empty-stack {
  font-size: 1.125rem; color: var(--text-muted); font-weight: 300; line-height: 1;
}
.assets-held-active {
  font-size: 0.8125rem; color: var(--text-muted); margin: 0; line-height: 1.4;
}
.assets-held-active strong {
  color: var(--text); font-weight: 700; letter-spacing: -0.01em;
}
.stat-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.6875rem; color: var(--primary);
  font-weight: 600; letter-spacing: 0.01em;
}
.stat-hint::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); opacity: 0.7;
  animation: assets-hint-pulse 2s ease-in-out infinite;
}
@keyframes assets-hint-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.asset-picker-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(12, 74, 110, 0.5);
  z-index: 280;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.asset-picker-backdrop.visible {
  display: block;
  opacity: 1;
}

.asset-picker {
  position: fixed;
  z-index: 290;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-height: min(480px, 65vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.asset-picker.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.asset-picker-mobile {
  left: 12px !important;
  right: 12px !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  width: auto !important;
  max-height: min(75vh, 560px);
  transform: translateY(100%);
}
.asset-picker-mobile.visible {
  transform: translateY(0);
}
.asset-picker-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px;
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.asset-picker-head-text { flex: 1; min-width: 0; }
.asset-picker-title {
  font-size: 0.9375rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; margin: 0;
}
.asset-picker-sub {
  font-size: 0.75rem; color: var(--text-muted); margin: 3px 0 0;
}
.asset-picker-close {
  display: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-light); background: #fff;
  color: var(--text-muted); font-size: 1.375rem; line-height: 1;
  cursor: pointer; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.asset-picker-close:hover { background: var(--primary-light); color: var(--text); }
.asset-picker-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 0 8px;
}
.asset-picker-section-label {
  padding: 10px 18px 6px; margin: 0;
  font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.asset-picker-section-label:not(:first-child) {
  margin-top: 4px; padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.asset-picker-item {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 12px;
  width: 100%; padding: 12px 18px; border: none; background: #fff;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background var(--transition);
  position: relative;
}
.asset-picker-item:hover { background: #f0f9ff; }
.asset-picker-item.active {
  background: linear-gradient(90deg, #e0f2fe 0%, #f0f9ff 100%);
}
.asset-picker-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.asset-picker-item-empty { opacity: 0.82; }
.asset-picker-item-empty:hover { opacity: 1; }
.asset-picker-info { flex: 1; min-width: 0; }
.asset-picker-info strong {
  display: block; font-size: 0.875rem; font-weight: 600;
  letter-spacing: -0.01em;
}
.asset-picker-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.asset-picker-meta .muted { font-size: 0.6875rem; font-weight: 600; }
.asset-picker-change {
  font-size: 0.6875rem; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
}
.asset-picker-change.positive { background: var(--success-bg); color: var(--success); }
.asset-picker-change.negative { background: var(--danger-bg); color: var(--danger); }
.asset-picker-balance { text-align: right; flex-shrink: 0; min-width: 0; }
.asset-picker-balance .crypto-balance-amt {
  font-size: 0.8125rem; display: block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 140px;
  margin-left: auto;
}
.asset-picker-balance .crypto-balance-usd { font-size: 0.6875rem; display: block; }
.asset-picker-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff;
  flex-shrink: 0; position: relative;
  transition: border-color var(--transition), background var(--transition);
}
.asset-picker-item.active .asset-picker-check {
  border-color: var(--primary); background: var(--primary);
}
.asset-picker-item.active .asset-picker-check::after {
  content: ''; position: absolute; left: 6px; top: 3px;
  width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.stat-main-body .crypto-balance-single .crypto-balance-amt { font-size: 1.625rem; }
.crypto-balance-single .crypto-balance-amt { font-size: 1.5rem; }
.holding-row-active {
  background: linear-gradient(90deg, #f0f9ff 0%, #fff 100%) !important;
}
.holding-row-active td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* ── Panels ── */
.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.panel-elevated {
  box-shadow: var(--shadow);
  border-color: var(--border-light);
  transition: box-shadow var(--transition);
}
.panel-elevated:hover { box-shadow: var(--shadow-lg); }
.panel-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border-light);
}
.panel-header h2 { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.panel-header-accent {
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
}
.panel-header-row {
  display: flex; align-items: center; justify-content: space-between;
}
.panel-desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.panel-link { font-size: 0.8125rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.content-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px;
}

/* ── Stats ── */
.stats-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-bottom: 24px;
  overflow: visible; position: relative; z-index: 5;
}
.stat-card { position: relative; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.stat-card-muted:hover {
  border-color: #7dd3fc; box-shadow: var(--shadow);
}
.stat-main {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 55%, #bae6fd 100%);
  border-color: #7dd3fc;
  box-shadow: var(--shadow-glow);
  overflow: hidden; position: relative;
}
.stat-main::before {
  content: ''; position: absolute; top: -50%; right: -5%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 68%);
  pointer-events: none;
}
.stat-main-inner {
  display: flex; align-items: flex-start; gap: 18px;
  position: relative; z-index: 1;
}
.stat-main-coin {
  width: 52px; height: 52px; border-radius: 16px;
  font-size: 1.125rem; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}
.stat-main-body { flex: 1; min-width: 0; }
.stat-link {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; font-size: 0.8125rem; font-weight: 600;
  color: var(--primary); text-decoration: none;
}
.stat-link::after {
  content: '→'; font-size: 0.875rem; transition: transform var(--transition);
}
.stat-link:hover { text-decoration: none; color: var(--primary-hover); }
.stat-link:hover::after { transform: translateX(3px); }
.stat-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.stat-value { display: block; font-size: 1.875rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-value-sm { font-size: 1.5rem; }
.stat-badge {
  display: inline-block; margin-top: 8px;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.stat-badge.positive { background: var(--success-bg); color: var(--success); }
.stat-badge.negative { background: var(--danger-bg); color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
.holdings-table { width: 100%; border-collapse: collapse; }
.holdings-table th {
  text-align: left; padding: 10px 22px; font-size: 0.6875rem;
  color: var(--text-muted); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}
.holdings-table td {
  padding: 14px 22px; font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}
.holdings-table tbody tr { transition: background 0.12s; }
.holdings-table tbody tr:hover { background: #fafbfc; }
.holdings-table tr:last-child td { border-bottom: none; }
.td-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8125rem; }
.asset-cell { display: flex; align-items: center; gap: 10px; }
.asset-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; transition: opacity 0.15s;
}
.asset-link:hover { opacity: 0.8; text-decoration: none; }
.asset-link:hover strong { color: var(--primary); }
.asset-cell strong { display: block; font-size: 0.875rem; font-weight: 600; }
.asset-cell .muted { font-size: 0.75rem; color: var(--text-muted); }
.value-cell { font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); }

/* ── Market & Activity ── */
.sidebar-panels { display: flex; flex-direction: column; gap: 20px; }
.market-list { max-height: 480px; overflow-y: auto; }
.market-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 22px; border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
.market-item-link {
  text-decoration: none; color: inherit; cursor: pointer;
}
.market-item-link:hover {
  background: var(--primary-light); text-decoration: none; color: inherit;
}
.market-item-link:hover strong { color: var(--primary); }
.market-item:last-child { border-bottom: none; }
.market-price { text-align: right; font-size: 0.875rem; }
.market-price span { display: block; }
.market-price span:first-child { font-weight: 600; letter-spacing: -0.01em; }
.market-price span:last-child { font-size: 0.75rem; font-weight: 600; }

.activity-list { max-height: 280px; overflow-y: auto; }
.activity-list-full { max-height: none; }
.activity-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
.activity-item:hover { background: #fafbfc; }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--border-light);
}
.activity-deposit .activity-icon { background: var(--success-bg); border-color: #a7f3d0; color: var(--success); }
.activity-withdraw .activity-icon { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.activity-bank_withdraw .activity-icon { background: var(--primary-light); border-color: #bae6fd; color: var(--primary); }
.activity-icon-label { font-size: 0.625rem; font-weight: 800; letter-spacing: 0.04em; }
.activity-info { flex: 1; min-width: 0; }
.activity-info strong { display: block; font-size: 0.875rem; font-weight: 600; }
.activity-info .muted { font-size: 0.75rem; display: block; margin-top: 1px; }
.activity-amount { text-align: right; font-size: 0.875rem; font-weight: 700; flex-shrink: 0; }
.activity-amount small { display: block; color: var(--text-muted); font-weight: 500; font-size: 0.75rem; }

/* ── Forms (app pages) ── */
.form-page-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 960px;
}
.vault-page-form { padding: 0 22px 22px; }
.vault-page-form-spacious { padding: 22px; }
.form-panel .panel-header + .vault-page-form,
.form-panel .panel-header + .vault-page-form-spacious { padding-top: 0; }

.form-section {
  border: none; padding: 0; margin: 0 0 24px;
}
.form-section legend {
  font-size: 0.6875rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 12px; width: 100%;
  border-bottom: 1px solid var(--border-light); margin-bottom: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; display: block; }
.form-actions { padding-top: 8px; }

.input-with-prefix {
  display: flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.input-with-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.input-prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--bg-elevated); color: var(--text-muted);
  font-weight: 600; font-size: 0.9375rem;
  border-right: 1px solid var(--border);
}
.input-with-prefix input {
  flex: 1; border: none; padding: 11px 14px;
  font-size: 0.9375rem; font-family: inherit; outline: none;
}

.info-list { padding: 4px 0; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 22px; border-bottom: 1px solid var(--border-light); gap: 16px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 0.875rem; }
.info-value { font-weight: 600; font-size: 0.875rem; text-align: right; }
.info-value-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8125rem; }

.balance-highlight { padding: 22px; border-bottom: 1px solid var(--border-light); }

/* ── Withdraw layout ── */
.withdraw-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start;
}
.withdraw-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }

.panel-summary .summary-stack { padding: 8px 0; }
.summary-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; border-bottom: 1px solid var(--border-light);
}
.summary-item:last-child { border-bottom: none; }
.summary-label { font-size: 0.8125rem; color: var(--text-muted); }
.summary-value { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.summary-value-sm { font-size: 0.875rem; font-weight: 600; }

.panel-note { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff, #fff); }
.note-block { padding: 22px; }
.note-block h3 { font-size: 0.875rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.note-list { list-style: none; }
.note-list li {
  font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5;
  padding: 6px 0 6px 16px; position: relative;
}
.note-list li::before {
  content: ''; position: absolute; left: 0; top: 13px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

.empty-text { padding: 16px 22px; font-size: 0.875rem; }

/* ── Top Up page ── */
.topup-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px; flex-wrap: wrap;
}
.topup-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
}
.topup-step span {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-muted);
}
.topup-step.active { color: var(--text); }
.topup-step.active span {
  background: var(--gradient); border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}
.topup-step.completed { color: var(--text-secondary); }
.topup-step.completed span {
  background: var(--success-bg); border-color: #a7f3d0; color: var(--success);
}
.topup-step-line {
  flex: 1; min-width: 24px; max-width: 48px; height: 2px;
  background: var(--border); margin: 0 12px;
}
.topup-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start;
}
.topup-main { display: flex; flex-direction: column; gap: 20px; }
.topup-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }

.coin-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; padding: 18px 22px 22px;
}
.coin-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1.5px solid var(--border-light);
  border-radius: var(--radius); background: #fff; cursor: pointer;
  text-align: left; font-family: inherit; transition: all 0.18s ease;
}
.coin-pick:hover {
  border-color: #7dd3fc; background: #f0f9ff;
  box-shadow: var(--shadow-xs);
}
.coin-pick.selected {
  border-color: var(--primary); background: linear-gradient(135deg, #f0f9ff, #fff);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), var(--shadow-xs);
}
.coin-pick-unavailable {
  opacity: 0.72;
  cursor: not-allowed;
  background: var(--bg-elevated);
}
.coin-pick-unavailable:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  transform: none;
}
.coin-pick-unavailable-msg {
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--danger);
  line-height: 1.3;
}
.pay-coin-item-unavailable { opacity: 0.55; }
.pay-coin-unavailable {
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.coin-pick-info { flex: 1; min-width: 0; }
.coin-pick-info strong {
  display: block; font-size: 0.875rem; font-weight: 600;
  letter-spacing: -0.01em; color: var(--text);
}
.coin-pick-info span { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.coin-pick-price { text-align: right; flex-shrink: 0; }
.coin-pick-price span { display: block; font-size: 0.8125rem; font-weight: 700; letter-spacing: -0.01em; }
.coin-pick-price small { font-size: 0.6875rem; font-weight: 600; }
.coin-pick-balance {
  text-align: right; flex-shrink: 0; min-width: 0;
}
.coin-pick-balance .crypto-balance-amt {
  display: block; font-size: 0.8125rem; font-weight: 700;
  letter-spacing: -0.02em; white-space: nowrap;
}
.coin-pick-balance .crypto-balance-usd {
  display: block; font-size: 0.6875rem; font-weight: 600;
  margin-top: 2px;
}
.coin-pick-balance .crypto-balance-usd:empty,
.coin-pick-balance .crypto-balance-amt:empty { display: none; }

/* ── Withdraw v2 ── */
.withdraw-layout-v2 {
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.withdraw-main {
  display: flex; flex-direction: column; gap: 20px;
}
.withdraw-steps { margin-bottom: 28px; }
.withdraw-amount-panel { padding: 22px; }
.withdraw-summary { margin-top: 0; }
.withdraw-coin-picker .coin-pick-balance .crypto-balance-usd {
  color: var(--text-muted);
}
.withdraw-coin-picker .coin-pick.selected .coin-pick-balance .crypto-balance-amt {
  color: var(--primary);
}

/* Withdraw — desktop shell (mobile overrides below) */
.withdraw-fullscreen {
  width: 100%;
}

.topup-form { padding: 22px; }
.amount-mode-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-elevated); border-radius: var(--radius-sm);
  margin-bottom: 20px; border: 1px solid var(--border-light);
}
.amount-tab {
  padding: 8px 20px; border: none; border-radius: 6px;
  font-size: 0.8125rem; font-weight: 600; font-family: inherit;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: all 0.15s ease;
}
.amount-tab.active {
  background: #fff; color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.amount-tab:hover:not(.active) { color: var(--text); }

.amount-input-block { margin-bottom: 24px; }
.amount-input-block label {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
}
.input-amount-lg input {
  font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em;
  padding: 14px 16px;
}
.input-amount-lg .input-prefix {
  font-size: 0.9375rem; min-width: 56px; justify-content: center;
}
.quick-amounts {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.quick-amt {
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 20px; background: #fff;
  font-size: 0.8125rem; font-weight: 600; font-family: inherit;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s ease;
}
.quick-amt:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}

.topup-summary {
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 0; margin-bottom: 20px;
}
.topup-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; font-size: 0.875rem;
}
.topup-summary-row span { color: var(--text-muted); }
.topup-summary-row strong { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.topup-summary-total {
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 16px;
}
.topup-summary-total span { font-weight: 600; color: var(--text-secondary); }
.topup-summary-total strong {
  font-size: 1.125rem; font-weight: 700; color: var(--primary);
}
.muted-row strong { font-weight: 500; font-size: 0.8125rem; }

.topup-secure-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; margin-bottom: 20px;
  background: var(--success-bg); border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
}
.secure-icon {
  flex-shrink: 0; font-size: 0.5625rem; font-weight: 800;
  letter-spacing: 0.06em; color: var(--success);
  padding: 6px 8px; background: #fff; border-radius: 4px;
  border: 1px solid #a7f3d0;
}
.topup-secure-note p {
  font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; margin: 0;
}

/* Top-up payment (QR) step */
.topup-pay-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start;
}
.topup-pay-main { padding-bottom: 22px; }
.pay-coin-head { display: flex; align-items: center; gap: 14px; }
.pay-coin-head .coin-logo-md { width: 48px; height: 48px; }
.pay-amount-banner {
  text-align: center; padding: 28px 22px;
  background: linear-gradient(180deg, #f0f9ff, #fff);
  border-bottom: 1px solid var(--border-light);
}
.pay-amount-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.pay-amount-crypto {
  display: block; font-size: 1.75rem; font-weight: 700;
  letter-spacing: -0.03em; color: var(--text); margin-bottom: 4px;
}
.pay-amount-usd { font-size: 0.9375rem; color: var(--text-muted); font-weight: 500; }
.pay-qr-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 22px; border-bottom: 1px solid var(--border-light);
}
.pay-qr-wrap {
  padding: 16px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.pay-qr-wrap canvas { display: block; border-radius: var(--radius-sm); }
.pay-qr-hint {
  margin-top: 14px; font-size: 0.8125rem; color: var(--text-muted); text-align: center;
}
.pay-address-block { padding: 22px; }
.pay-address-label {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
}
.pay-address-row {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.pay-address {
  flex: 1; min-width: 0; word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8125rem;
  padding: 12px 14px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); line-height: 1.5;
}
.topup-pay-main .topup-summary { margin: 0 22px 20px; }
.topup-pay-main .topup-secure-note { margin: 0 22px 20px; }
.topup-pay-main .btn-full { margin: 0 22px; width: calc(100% - 44px); }
.pay-coin-list { padding: 8px 0; max-height: 360px; overflow-y: auto; }
.pay-coin-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; font-size: 0.875rem; font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}
.pay-coin-item:last-child { border-bottom: none; }
.pay-coin-item.active { background: var(--primary-light); color: var(--primary); }
.pay-coin-current {
  margin-left: auto; font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--primary);
}

/* ── Chart page ── */
.chart-page .app-main {
  padding: 24px 36px 28px;
  display: flex;
  flex-direction: column;
}

.chart-page-layout {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  gap: 16px;
}

.chart-page-header { margin-bottom: 0; flex-shrink: 0; }

.back-link {
  display: inline-block; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none; margin-bottom: 12px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

.chart-title-row {
  display: flex; align-items: center; gap: 14px;
}
.chart-title-row .coin-logo-md { width: 48px; height: 48px; }
.chart-pair { font-weight: 500; color: var(--text-muted); font-size: 1.125rem; }

.chart-price-block { text-align: right; flex-shrink: 0; }
.chart-live-price {
  display: block; font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 6px;
}

.chart-panel {
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}
.chart-panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated); flex-shrink: 0;
}
.chart-interval-badge {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--primary);
  padding: 4px 10px; background: #fff; border: 1px solid var(--border);
  border-radius: 20px;
}
.chart-panel-hint {
  font-size: 0.6875rem; color: var(--text-muted); font-weight: 500;
}
.chart-panel .tradingview-widget-copyright {
  display: none !important;
}

.chart-widget-wrap {
  flex: 0 0 auto;
  width: 100%;
  height: 340px;
  position: relative;
}

#price-chart {
  width: 100%;
  height: 100%;
}

.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chart-panel .tradingview-widget-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chart-panel .tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
}

.chart-panel .tradingview-widget-container iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
}

.chart-coin-nav {
  flex-shrink: 0;
  padding: 14px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.chart-coin-nav-label {
  display: block; font-size: 0.6875rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 12px;
}
.chart-coin-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.chart-coin-pill {
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.8125rem; font-weight: 600;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); text-decoration: none;
  transition: all 0.15s;
}
.chart-coin-pill:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-light); text-decoration: none;
}
.chart-coin-pill.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ── Support & Settings ── */
.support-chat-panel { margin-bottom: 24px; }
.support-chat-header .panel-desc { margin-top: 4px; }
.support-chat-badge {
  flex-shrink: 0;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--success); background: var(--success-bg);
  border: 1px solid #a7f3d0;
  padding: 6px 12px; border-radius: 20px;
}
.support-chat {
  display: flex; flex-direction: column;
  min-height: 420px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.support-chat-messages {
  flex: 1;
  min-height: 280px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.support-chat-msg {
  display: flex;
  max-width: 88%;
}
.support-chat-msg-user { align-self: flex-end; }
.support-chat-msg-bot { align-self: flex-start; }
.support-chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.55;
  word-break: break-word;
}
.support-chat-msg-user .support-chat-bubble {
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}
.support-chat-msg-bot .support-chat-bubble {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-xs);
}
.support-chat-msg-typing .support-chat-bubble {
  padding: 14px 18px;
}
.support-chat-dots {
  display: inline-flex; gap: 5px; align-items: center;
}
.support-chat-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: support-chat-dot 1.2s ease-in-out infinite;
}
.support-chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.support-chat-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes support-chat-dot {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.support-chat-composer {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-light);
  background: #fff;
}
.support-chat-composer input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.support-chat-composer input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.support-chat-composer .btn {
  flex-shrink: 0;
  min-width: 88px;
  padding-left: 20px;
  padding-right: 20px;
}
.support-chat-composer.is-loading .btn { opacity: 0.7; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.support-content { padding: 22px; }
.support-content p { color: var(--text-muted); margin-bottom: 16px; font-size: 0.875rem; line-height: 1.65; }
.faq-list { padding: 8px 22px 22px; }
.faq-item { border-bottom: 1px solid var(--border-light); padding: 14px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin-top: 8px; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.65; }

.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border-light); cursor: pointer;
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-row strong { display: block; font-size: 0.875rem; font-weight: 600; }
.toggle-row .muted { font-size: 0.75rem; }
.toggle-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ── Empty states ── */
.empty-state {
  text-align: center; padding: 56px 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--primary-light);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem;
}
.empty-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 20px; }
.empty-text { padding: 24px 22px; text-align: center; font-size: 0.875rem; }

/* ── Modal ── */
.modal { display: none; position: fixed; inset: 0; z-index: 200; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,0.4); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; width: 90%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.0625rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-content-wide { max-width: 520px; width: 92%; }

/* App error table modal */
body.app-error-open { overflow: hidden; }
.app-error-modal-wrap { z-index: 400; }
.app-error-modal-wrap .modal-backdrop {
  background: rgba(12, 74, 110, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.app-error-modal {
  padding: 0;
  overflow: hidden;
  border-color: #fecaca;
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.12), var(--shadow-lg);
}
.app-error-header {
  margin-bottom: 0;
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
  border-bottom: 1px solid #fecaca;
}
.app-error-header h3 { color: var(--danger); font-size: 1.125rem; }
.app-error-sub {
  font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px;
}
.app-error-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px; background: #fffbeb;
  border-bottom: 1px solid #fde68a; font-size: 0.75rem;
}
.app-error-meta-label {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #b45309;
}
.app-error-meta-value { font-weight: 600; color: var(--text-secondary); font-family: 'SF Mono', 'Fira Code', monospace; }
.app-error-table-wrap { padding: 0; max-height: min(50vh, 320px); overflow: auto; }
.app-error-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
.app-error-table thead {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-elevated);
}
.app-error-table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}
.app-error-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.app-error-table tbody tr:last-child td { border-bottom: none; }
.app-error-table tbody tr:hover { background: #fef2f2; }
.app-error-num {
  width: 40px; font-weight: 700; color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8125rem;
}
.app-error-code {
  width: 52px; font-size: 0.6875rem; font-weight: 800;
  color: var(--danger); letter-spacing: 0.04em;
}
.app-error-msg { color: var(--text); line-height: 1.45; word-break: break-word; }
.app-error-modal .modal-actions {
  margin: 0; padding: 16px 22px 20px;
  border-top: 1px solid var(--border-light); background: #fff;
}

/* ── Footer ── */
.footer {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: 0.8125rem;
  border-top: 1px solid var(--border); background: var(--bg-card);
}

/* ── Cash asset ── */
.coin-logo-cash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  line-height: 1;
  flex-shrink: 0;
}
.coin-logo-cash.coin-logo-xs { width: 22px; height: 22px; font-size: 0.75rem; }
.coin-logo-cash.coin-logo-sm { width: 32px; height: 32px; font-size: 1rem; }
.coin-logo-cash.coin-logo-lg { width: 48px; height: 48px; font-size: 1.35rem; }
.stat-badge-muted { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.asset-picker-item-cash .asset-picker-check { border-color: #10b981; }
.holding-row-cash { background: rgba(16, 185, 129, 0.04); }
.asset-link-static { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.asset-picker-cash-scroll {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.asset-picker-item-cash .crypto-balance-amt { font-size: 0.9375rem; }
.asset-picker-cash-flag {
  object-fit: cover;
  border-radius: 50%;
}
.asset-picker-empty {
  padding: 12px 18px 16px;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.main-coin-icon--cash {
  object-fit: cover;
  border-radius: 12px;
}

/* ── Exchange page ── */
.exchange-page .page-header { display: none; }
.exchange-page .app-main {
  overflow-x: hidden;
  max-width: 100%;
}

.exchange-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(16, 185, 129, 0.12), transparent),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(14, 165, 233, 0.16), transparent),
    var(--bg-card);
  border: 1px solid rgba(14, 165, 233, 0.22);
  box-shadow: var(--shadow-xs);
}
.exchange-hero .page-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.exchange-hero h1 {
  margin: 6px 0 6px;
  font-size: 1.875rem;
  letter-spacing: -0.03em;
}
.exchange-hero .page-sub {
  margin: 0;
  max-width: 36ch;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.exchange-hero-stat {
  text-align: right;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #fff 0%, #f0f9ff 100%);
  border: 1px solid var(--border);
  min-width: 200px;
  box-shadow: var(--shadow-xs);
}
.exchange-hero-stat-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.exchange-hero-stat-value {
  display: block;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 6px 0 2px;
}
.exchange-hero-stat-hint { font-size: 0.75rem; color: var(--text-muted); }

.exchange-card {
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}
.exchange-form { padding: 28px 32px 32px; }

.exchange-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
}
.exchange-slot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.exchange-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.exchange-slot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.exchange-type-menu {
  position: relative;
}
.exchange-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.exchange-type-toggle:hover,
.exchange-type-toggle.open {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
}
.exchange-slot-to .exchange-type-toggle:hover,
.exchange-slot-to .exchange-type-toggle.open {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}
.exchange-type-chevron {
  transition: transform 0.15s;
}
.exchange-type-toggle.open .exchange-type-chevron {
  transform: rotate(180deg);
}
.exchange-type-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 120px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.exchange-type-dropdown[hidden] {
  display: none;
}
.exchange-type-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.exchange-type-dropdown button:hover:not(:disabled) {
  background: var(--bg-elevated);
}
.exchange-type-dropdown button.active {
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary);
}
.exchange-slot-to .exchange-type-dropdown button.active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.exchange-type-dropdown button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.exchange-slot-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}
.exchange-slot-badge-to {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.exchange-slot-balance {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  max-width: 55%;
}
.exchange-slot-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.04) 0%, transparent 70%);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--slot-accent, var(--accent));
}
.exchange-slot-to .exchange-slot-preview {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
}
.exchange-slot-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  flex-shrink: 0;
}
.exchange-slot-to .exchange-slot-icon { background: rgba(16, 185, 129, 0.12); }
.exchange-slot-labels strong { display: block; font-size: 1rem; }
.exchange-slot-labels .muted { font-size: 0.8125rem; }

.exchange-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 48px;
}
.exchange-swap-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.15s, border-color 0.15s;
}
.exchange-swap-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--accent);
  transform: rotate(180deg);
}

.exchange-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}

.exchange-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M11 11l3 3'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.exchange-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.exchange-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 165, 233, 0.4) transparent;
}
.exchange-picker-grid::-webkit-scrollbar {
  width: 6px;
}
.exchange-picker-grid::-webkit-scrollbar-track {
  background: transparent;
}
.exchange-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.35);
  border-radius: 999px;
}
.exchange-picker-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.55);
}
.exchange-picker-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}
.exchange-asset-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.exchange-asset-card:hover {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.06);
}
.exchange-asset-card.active {
  border-color: var(--card-accent, var(--accent));
  background: rgba(14, 165, 233, 0.1);
  box-shadow: 0 0 0 1px var(--card-accent, var(--accent));
}
.exchange-asset-card.is-cash.active {
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 0 1px var(--card-accent, #10b981);
}
.exchange-asset-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.12);
}
.exchange-asset-icon .exchange-asset-logo,
.exchange-asset-icon .coin-logo-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.exchange-asset-icon-fallback {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.exchange-slot-icon .exchange-slot-logo,
.exchange-slot-icon .coin-logo-md {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}
.exchange-slot-icon {
  overflow: hidden;
  background: #fff;
}
.exchange-asset-info { min-width: 0; }
.exchange-asset-info strong {
  display: block;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exchange-asset-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.exchange-asset-bal {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.exchange-amount-block {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
}
.exchange-amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.exchange-amount-head label { font-weight: 600; font-size: 0.875rem; margin: 0; }
.exchange-max-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.exchange-max-btn:hover { background: rgba(14, 165, 233, 0.1); }
.exchange-amount-input {
  display: flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}
.exchange-amount-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.exchange-amount-prefix {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}
.exchange-amount-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.exchange-amount-input input:focus { outline: none; }

.exchange-preview {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}
.exchange-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.9375rem;
}
.exchange-preview-row span { color: var(--text-muted); }
.exchange-preview-row strong { color: var(--text); text-align: right; }
.exchange-submit { margin-top: 20px; }

@media (max-width: 900px) {
  .exchange-columns {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .exchange-mid { padding: 0; order: 2; }
  .exchange-swap-btn { transform: rotate(90deg); }
  .exchange-swap-btn:hover { transform: rotate(270deg); }
  .exchange-slot-to { order: 3; }
  .exchange-hero { flex-direction: column; align-items: stretch; padding: 22px; }
  .exchange-hero-stat { text-align: left; }
}
@media (max-width: 480px) {
  .exchange-form { padding: 18px 16px 22px; }
}

/* ── Admin panel ── */
.admin-page .footer-app { display: none; }
.admin-sidebar { border-right-color: #7dd3fc; }
.admin-avatar { background: linear-gradient(135deg, #0284c7, #0ea5e9); }
.sidebar-link-admin {
  color: var(--primary) !important;
  font-weight: 600;
  background: var(--primary-light);
}
.admin-main { max-width: calc(100vw - 248px); }
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stats-row-compact .stat-value-xs { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; }
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: start;
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.admin-detail-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
.admin-tx-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-tx-date-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn-danger-outline { border-color: #c44; color: #e88; }
.btn-danger-outline:hover { background: rgba(200, 68, 68, 0.12); }
.admin-form-panel { max-width: 640px; }
.admin-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-search-form {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%;
}
.admin-search-input {
  flex: 1; min-width: 200px;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.875rem;
}
.admin-search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.admin-table td .block-sm { display: block; font-size: 0.75rem; margin-top: 2px; }
.admin-toggle { padding: 14px 0; margin: 0; }
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-right: 4px;
}
.status-online { background: var(--success-bg); color: var(--success); }
.status-offline { background: var(--bg-elevated); color: var(--text-muted); }
.status-active { background: var(--success-bg); color: var(--success); }
.status-disabled { background: var(--danger-bg); color: var(--danger); }
.notification-feed { padding: 8px 0; }
.notification-item {
  padding: 16px 22px; border-bottom: 1px solid var(--border-light);
}
.notification-item:last-child { border-bottom: none; }
.notification-item-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 8px;
}
.notification-item-head strong { font-size: 0.9375rem; }
.notification-item-body {
  font-size: 0.875rem; color: var(--text-secondary);
  line-height: 1.55; white-space: pre-wrap; margin-bottom: 8px;
}
.notification-item-meta { font-size: 0.75rem; }
.notification-unread {
  background: linear-gradient(90deg, #f0f9ff, #fff);
  border-left: 3px solid var(--primary);
}
.user-notification-feed .notification-item { padding-left: 22px; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1.5px solid var(--border-light);
  border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
}
.radio-card:has(input:checked) {
  border-color: var(--primary); background: #f0f9ff;
}
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card strong { display: block; font-size: 0.875rem; }
.radio-card .muted { font-size: 0.75rem; display: block; margin-top: 2px; }

/* Transaction & request status */
.tx-status {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-left: 8px; vertical-align: middle;
}
.tx-status-pending { background: #fef3c7; color: #b45309; }
.tx-status-approved { background: var(--success-bg); color: var(--success); }
.tx-status-rejected { background: var(--danger-bg); color: var(--danger); }
.tx-status-completed { background: var(--bg-elevated); color: var(--text-muted); }
.activity-pending { background: linear-gradient(90deg, #fffbeb, #fff); }
.activity-top_up .activity-icon { background: #fef3c7; border-color: #fde68a; color: #b45309; }

.sidebar-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 0.625rem; font-weight: 700; margin-left: 6px;
}

.request-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.request-list { padding: 8px 0; }
.request-card {
  padding: 18px 22px; border-bottom: 1px solid var(--border-light);
}
.request-card:last-child { border-bottom: none; }
.request-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 8px;
}
.request-type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 6px;
}
.request-type-top_up { background: #fef3c7; color: #b45309; }
.request-type-bank_withdraw { background: var(--primary-light); color: var(--primary); }
.request-amount { text-align: right; }
.request-amount strong { display: block; font-size: 0.875rem; }
.request-amount span { font-size: 1rem; font-weight: 700; color: var(--text); }
.request-meta { font-size: 0.75rem; margin-bottom: 10px; }
.request-details {
  font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5;
  background: var(--bg-elevated); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 12px; word-break: break-word;
}
.request-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 10px;
}
.request-actions .admin-search-input { flex: 1; min-width: 160px; margin: 0; }
.request-btns { flex-shrink: 0; }
.request-reject-form { margin-top: 6px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .withdraw-layout { grid-template-columns: 1fr; }
  .withdraw-layout-v2 { grid-template-columns: 1fr; }
  .withdraw-aside { position: static; }
  .withdraw-main { gap: 16px; }
  .topup-layout { grid-template-columns: 1fr; }
  .topup-aside { position: static; }
  .topup-pay-layout { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-detail-aside { position: static; }
  .admin-tx-panels { grid-template-columns: 1fr; }
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
    --nav-bar-offset: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  }

  /* Fixed top bar — stays above sidebar drawer on phone */
  body {
    padding-top: var(--nav-bar-offset);
  }
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 200;
    padding-top: env(safe-area-inset-top, 0px);
  }
  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Safe areas & touch */
  .nav-menu-btn {
    display: flex;
    min-width: 44px; min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-inner {
    padding: 0 12px 0 16px;
    height: 56px;
  }
  .nav-user { display: none; }
  .nav-links .btn-ghost { padding: 8px 12px; min-height: 40px; }
  .logo { font-size: 1rem; }

  .btn, .sidebar-link, .coin-pick, .quick-amt, .amount-tab {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .btn-xs { min-height: 36px; padding: 8px 12px; }

  /* Prevent iOS zoom on input focus */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .input-with-prefix input,
  #topup-amount {
    font-size: 16px;
  }

  .container { padding: 0 16px; }
  .flash-container, .flash-container-app { padding: 0 16px; }

  /* Landing */
  .hero { padding: 64px 0 48px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .live-prices, .features { padding: 48px 0; }
  .price-cards { grid-template-columns: 1fr; }
  .cta-inner { padding: 40px 20px; }

  /* Auth */
  .auth-container { padding: 32px 16px; }
  .auth-card { padding: 32px 24px; }

  /* App shell & nav drawer */
  .app-shell {
    flex-direction: row;
    min-height: calc(100dvh - var(--nav-bar-offset));
  }

  .sidebar-overlay {
    top: var(--nav-bar-offset);
    z-index: 150;
  }

  .app-sidebar {
    position: fixed;
    top: var(--nav-bar-offset);
    left: 0;
    width: min(300px, 92vw);
    height: calc(100dvh - var(--nav-bar-offset));
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border);
    border-bottom: none;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
  }
  body.mobile-nav-open .app-sidebar { transform: translateX(0); }

  .sidebar-mobile-header {
    display: flex;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-sidebar);
  }
  .sidebar-brand { display: block; flex-shrink: 0; }
  .sidebar-user { display: flex; flex-shrink: 0; }
  .sidebar-footer {
    display: block;
    flex-shrink: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-nav {
    flex: none;
    flex-grow: 0;
    overflow: visible;
    overflow-y: visible;
    min-height: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 8px 12px 16px;
    gap: 2px;
  }
  .sidebar-section { display: block; }
  .sidebar-link {
    white-space: normal;
    padding: 13px 14px;
    font-size: 0.9375rem;
    border-left: 3px solid transparent;
    margin-left: -3px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .sidebar-link.active { border-left-color: var(--primary); }

  .app-main {
    padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }
  .flash-container-app { padding: 12px 16px 0; }

  /* Page headers */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
  }
  .page-header h1 { font-size: 1.375rem; }
  .page-header .btn { width: 100%; justify-content: center; }
  .balance-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 14px 18px;
  }
  .balance-pill-label { margin-bottom: 0; }
  .balance-pill-value { font-size: 1.125rem; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { padding: 18px 20px; }
  .stat-value { font-size: 1.625rem; }
  .stat-value-sm { font-size: 1.375rem; }

  /* Assets Held — mobile */
  body.asset-picker-open {
    overflow: hidden;
    touch-action: none;
  }
  .stat-card-picker .stat-card-trigger {
    padding: 16px 18px;
    min-height: 48px;
  }
  .assets-held-preview {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .assets-held-stack {
    flex-shrink: 0;
    min-height: 30px;
  }
  .assets-held-active {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
  }
  .assets-held-active strong {
    word-break: break-word;
  }
  .stat-hint {
    font-size: 0.6875rem;
  }
  .asset-picker-mobile {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: min(85vh, 640px);
  }
  .asset-picker-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .asset-picker-head { padding: 16px 16px 12px; }
  .asset-picker-title { font-size: 1rem; }
  .asset-picker-body {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .asset-picker-item {
    grid-template-columns: auto 1fr auto;
    padding: 14px 16px;
    min-height: 52px;
  }
  .asset-picker-check { display: none; }
  .asset-picker-balance .crypto-balance-amt { max-width: none; }
  .asset-picker-section-label {
    padding-left: 16px;
    padding-right: 16px;
  }
  .asset-picker-cash-scroll {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 16px 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .asset-picker-cash-scroll::-webkit-scrollbar {
    display: none;
  }
  .asset-picker-cash-scroll .asset-picker-item-cash {
    flex: 0 0 min(92vw, 300px);
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
    padding: 14px;
    min-height: 72px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.07) 0%, #fff 55%);
  }
  .asset-picker-cash-scroll .asset-picker-item-cash:only-child {
    flex: 1 1 auto;
    width: calc(100% - 32px);
    max-width: none;
  }
  .asset-picker-item-cash .asset-picker-info {
    grid-column: 2;
    align-self: end;
  }
  .asset-picker-item-cash .asset-picker-balance {
    grid-column: 1 / -1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 56px;
    margin-top: -4px;
  }
  .asset-picker-item-cash .asset-picker-balance .crypto-balance-amt {
    font-size: 0.9375rem;
    white-space: normal;
    line-height: 1.3;
  }
  .asset-picker-item-cash .asset-picker-balance .crypto-balance-usd {
    font-size: 0.75rem;
  }
  .asset-picker-item-cash .asset-picker-cash-flag,
  .asset-picker-item-cash .coin-logo-cash {
    grid-row: span 2;
    width: 44px;
    height: 44px;
  }
  .asset-picker-item-cash.active::before {
    top: auto;
    bottom: 0;
    left: 8px;
    right: 8px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #10b981;
  }
  .asset-picker-empty {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 16px;
  }

  /* Holdings → mobile cards */
  .table-wrap {
    overflow: visible;
    -webkit-overflow-scrolling: touch;
  }
  .holdings-table thead { display: none; }
  .holdings-table tbody tr {
    display: block;
    margin: 0 12px 12px;
    padding: 6px 16px 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }
  .holdings-table tbody tr:last-child { margin-bottom: 4px; }
  .holdings-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: none;
    gap: 12px;
    font-size: 0.875rem;
  }
  .holdings-table td::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
  }
  .holdings-table td.td-asset {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 8px 14px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
  }
  .holdings-table td.td-asset::before { display: none; }
  .holdings-table td.td-asset .asset-cell {
    width: 100%;
    min-width: 0;
  }
  .holdings-table td.td-asset .asset-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }
  .holdings-table td.td-asset .coin-logo-sm {
    flex-shrink: 0;
    align-self: center;
  }
  .holdings-table td.td-asset .asset-link > div {
    flex: 1;
    min-width: 0;
  }
  .holdings-table td.td-balance {
    flex-direction: column; align-items: flex-start;
    padding: 10px 0;
  }
  .holdings-table td.td-balance::before { margin-bottom: 4px; }
  .holdings-table td.td-actions {
    flex-direction: column;
    align-items: stretch;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--border-light);
  }
  .holdings-table td.td-actions::before { display: none; }
  .holdings-table td.td-actions .btn { width: 100%; justify-content: center; }

  /* Panels */
  .panel-header { padding: 16px 18px; }
  .panel-header-row { flex-wrap: wrap; gap: 8px; }
  .coin-picker { grid-template-columns: 1fr; padding: 14px 16px 18px; gap: 8px; }
  .coin-pick { min-height: 64px; padding: 12px 14px; }
  .withdraw-coin-picker .coin-pick-balance { display: block; }

  /* Withdraw — full screen on phone, single scroll for entire page */
  html:has(body.withdraw-page),
  html.withdraw-page-active {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  body.withdraw-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding-top: 0 !important;
  }

  body.withdraw-page main {
    flex: 1;
    min-width: 0;
    display: block;
    overflow: visible;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  body.withdraw-page .navbar {
    display: none;
  }

  body.withdraw-page .app-sidebar {
    top: 0;
    height: 100dvh;
    z-index: 160;
  }

  body.withdraw-page .sidebar-overlay {
    z-index: 150;
  }

  body.withdraw-page .app-shell {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: visible;
    overflow-x: hidden;
  }

  body.withdraw-page .flash-container-app {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    z-index: 40;
    padding: 8px 16px 0;
    pointer-events: none;
  }

  body.withdraw-page .flash-container-app .flash {
    pointer-events: auto;
  }

  body.withdraw-page .app-main {
    padding: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    flex: 1;
    overflow: visible;
    overflow-x: hidden;
    display: block;
  }

  .withdraw-mobile-bar {
    display: none;
  }

  body.withdraw-page .withdraw-mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 8px;
    background: #fff;
    flex-shrink: 0;
  }

  body.withdraw-page .withdraw-mobile-menu {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  body.withdraw-page .withdraw-mobile-menu .nav-menu-line {
    width: 20px;
    background: var(--text);
  }

  body.withdraw-page .withdraw-mobile-title {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  body.withdraw-page .withdraw-mobile-header .page-header-text {
    display: none;
  }

  body.withdraw-page .withdraw-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 120;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--bg-elevated);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body.withdraw-page .withdraw-fullscreen-top {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
  }

  body.withdraw-page .withdraw-fullscreen-top .page-header h1 {
    display: none;
  }

  body.withdraw-page .withdraw-fullscreen-top .page-header {
    margin: 0;
    padding: 0 16px 12px;
    gap: 12px;
  }

  body.withdraw-page .withdraw-fullscreen-top .page-eyebrow {
    display: none;
  }

  body.withdraw-page .withdraw-fullscreen-top .page-sub {
    display: none;
  }

  body.withdraw-page .withdraw-fullscreen-top .balance-pill,
  body.withdraw-page .withdraw-fullscreen-top .balance-pill-wide {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
  }

  body.withdraw-page .withdraw-fullscreen-top .balance-pill-values {
    align-items: flex-end;
    min-width: 0;
    max-width: 100%;
  }

  body.withdraw-page .withdraw-fullscreen-top .balance-pill-value,
  body.withdraw-page .withdraw-fullscreen-top .balance-pill-usd {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  body.withdraw-page .withdraw-steps {
    margin: 0;
    padding: 10px 16px 12px;
    gap: 8px 10px;
    flex-wrap: wrap;
    max-width: 100%;
  }

  body.withdraw-page .withdraw-steps .topup-step-line {
    display: none;
  }

  body.withdraw-page .withdraw-steps .topup-step {
    width: auto;
    font-size: 0.75rem;
    gap: 8px;
  }

  body.withdraw-page .withdraw-steps .topup-step span {
    width: 24px;
    height: 24px;
    font-size: 0.6875rem;
  }

  body.withdraw-page .withdraw-fullscreen-scroll {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  body.withdraw-page .withdraw-layout-v2 {
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.withdraw-page .withdraw-main {
    gap: 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.withdraw-page .withdraw-aside {
    display: none;
  }

  body.withdraw-page .withdraw-main .panel {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.withdraw-page .withdraw-main .panel + .panel {
    border-top: 8px solid var(--bg-elevated);
  }

  body.withdraw-page .withdraw-main .panel-header {
    padding: 14px 16px;
  }

  body.withdraw-page .withdraw-main .panel-desc {
    display: none;
  }

  body.withdraw-page .withdraw-main .coin-picker {
    padding: 12px 14px 16px;
  }

  body.withdraw-page .withdraw-amount-panel,
  body.withdraw-page .vault-page-form-spacious {
    padding: 16px !important;
  }

  body.withdraw-page .withdraw-main .form-actions,
  body.withdraw-page .withdraw-form-actions {
    position: static;
    margin: 0;
    padding: 8px 0 20px;
    background: transparent;
    border-top: none;
    box-shadow: none;
  }

  body.withdraw-page .withdraw-main .form-actions .btn {
    min-height: 48px;
  }

  body.withdraw-page .withdraw-coin-picker .coin-pick {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
  }

  body.withdraw-page .withdraw-coin-picker .coin-pick .coin-logo-sm {
    grid-column: 1;
    flex-shrink: 0;
  }

  body.withdraw-page .withdraw-coin-picker .coin-pick-info {
    min-width: 0;
  }

  body.withdraw-page .withdraw-coin-picker .coin-pick-balance {
    text-align: right;
    max-width: 42%;
  }

  body.withdraw-page .withdraw-coin-picker .coin-pick-balance .crypto-balance-amt {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.withdraw-page .form-group input,
  body.withdraw-page .form-group textarea,
  body.withdraw-page #bank-amount,
  body.withdraw-page .input-mono {
    font-size: 16px;
    max-width: 100%;
  }

  body.withdraw-page .input-with-prefix,
  body.withdraw-page .amount-input-block,
  body.withdraw-page .topup-summary,
  body.withdraw-page .topup-summary-row {
    max-width: 100%;
    min-width: 0;
  }

  body.withdraw-page .topup-summary-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 58%;
    text-align: right;
  }

  body.withdraw-page .vault-page-form,
  body.withdraw-page .vault-page-form-spacious,
  body.withdraw-page .form-section {
    max-width: 100%;
    min-width: 0;
  }

  .topup-form { padding: 16px; }
  .topup-summary-row { padding: 11px 16px; font-size: 0.8125rem; }
  .topup-summary-total strong { font-size: 1rem; }

  /* Top up mobile */
  .topup-steps {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 20px;
  }
  .topup-step-line { display: none; }
  .topup-step { width: auto; font-size: 0.75rem; gap: 8px; }
  .topup-step span { width: 24px; height: 24px; font-size: 0.6875rem; }
  .amount-mode-tabs { display: flex; width: 100%; }
  .amount-tab { flex: 1; text-align: center; min-height: 44px; }
  .quick-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .quick-amt { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .input-amount-lg input { font-size: 1.25rem; padding: 12px 14px; }
  .topup-secure-note { flex-direction: column; gap: 10px; }
  .pay-amount-crypto { font-size: 1.375rem; }
  .pay-qr-wrap canvas { max-width: 100%; height: auto !important; }
  .pay-address-row { flex-direction: column; }
  .pay-address-row .btn { width: 100%; }
  .topup-pay-main .btn-full { width: calc(100% - 32px); margin: 0 16px 16px; }

  /* Activity / transactions */
  .activity-item {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 10px;
  }
  .activity-info { flex: 1 1 calc(100% - 52px); min-width: 0; }
  .activity-amount {
    flex: 1 1 100%;
    text-align: left;
    padding-left: 46px;
    margin-top: -4px;
  }

  /* Forms */
  .form-page-grid { grid-template-columns: 1fr; max-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .vault-page-form, .vault-page-form-spacious { padding: 16px !important; }
  .info-row { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .info-value { text-align: left; width: 100%; }

  /* Chart */
  .chart-page .app-main { padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .chart-page-layout { min-height: 0; gap: 12px; }
  .chart-page-header.page-header { flex-direction: column; align-items: stretch; }
  .chart-title-row { flex-wrap: wrap; gap: 10px; }
  .chart-title-row h1 { font-size: 1.25rem; line-height: 1.3; }
  .chart-pair { font-size: 0.9375rem; }
  .chart-price-block {
    text-align: left;
    width: 100%;
    padding-top: 4px;
  }
  .chart-live-price { font-size: 1.375rem; }
  .chart-widget-wrap { height: 300px; min-height: 300px; }
  .chart-panel-hint { display: none; }
  .chart-coin-nav { padding: 12px 14px; }
  .chart-coin-pills { gap: 6px; }
  .chart-coin-pill { min-height: 40px; display: inline-flex; align-items: center; }

  /* Modal → bottom sheet */
  .modal.active { align-items: flex-end; padding: 0; }
  .modal-content {
    width: 100%;
    max-width: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }

  /* Market list */
  .market-item { padding: 12px 16px; min-height: 56px; }
  .market-list { max-height: none; }

  /* Support / FAQ */
  .support-content, .faq-list { padding-left: 16px; padding-right: 16px; }
  .support-chat { min-height: 360px; }
  .support-chat-messages { max-height: 45vh; padding: 16px 14px 10px; }
  .support-chat-msg { max-width: 92%; }
  .support-chat-composer {
    flex-wrap: nowrap;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .support-chat-composer input { font-size: 16px; }
  .support-chat-composer .btn { min-width: 72px; }
  .support-chat-header.panel-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .toggle-row { padding: 16px 0; gap: 12px; }

  /* Empty states */
  .empty-state { padding: 40px 20px; }

  .admin-stats-row { grid-template-columns: 1fr; }
  .admin-header-actions { width: 100%; }
  .admin-header-actions form { width: 100%; }
  .admin-header-actions .btn { width: 100%; }
  .admin-search-form { flex-direction: column; align-items: stretch; }
  .admin-search-input { width: 100%; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table tbody tr {
    display: block; margin: 0 12px 12px; padding: 12px 14px;
    border: 1px solid var(--border-light); border-radius: var(--radius);
    background: #fff;
  }
  .admin-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border: none;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-size: 0.6875rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .admin-table td.td-asset::before,
  .admin-table td.td-actions::before { display: none; }
  .admin-table td.td-asset {
    flex-direction: column; align-items: flex-start;
    border-bottom: 1px solid var(--border-light); padding-bottom: 12px; margin-bottom: 4px;
  }
  .admin-table td.td-actions { padding-top: 10px; }
  .admin-table td.td-actions .btn { width: 100%; }
}

@media (max-width: 380px) {
  .stat-card-trigger { padding: 16px 18px; }
  .asset-picker-mobile { max-height: 88vh; }
  .asset-picker-cash-scroll .asset-picker-item-cash {
    flex-basis: calc(100vw - 48px);
  }
  .coin-pick-price { display: none; }
  .page-header h1 { font-size: 1.25rem; }
}
