/* ═══════════════════════════════════════════════════
   SwapAgg v2 — Styles
   ═══════════════════════════════════════════════════ */

:root {
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, .45);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, .35);
  --blur: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg-img: url('asset/bg-dark.gif');
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --card: rgba(10, 16, 26, .72);
  --card-border: rgba(255,255,255,.12);
  --panel: rgba(0,0,0,.36);
  --panel-border: rgba(255,255,255,.10);
  --input: rgba(0,0,0,.20);
  --input-border: rgba(255,255,255,.10);
  --pill: rgba(255,255,255,.08);
  --pill-border: rgba(255,255,255,.14);
  --toggle: rgba(0,0,0,.35);
  --toggle-border: rgba(255,255,255,.14);

  --grad-a: #8b5cf6;
  --grad-b: #3b82f6;
  --focus: rgba(99, 102, 241, .55);
}

body[data-theme="light"] {
  --bg-img: url('asset/bg-light.gif');
  --text: rgba(10, 14, 22, .92);
  --muted: rgba(10, 14, 22, .55);
  --card: rgba(255, 255, 255, .72);
  --card-border: rgba(10,14,22,.10);
  --panel: rgba(255,255,255,.55);
  --panel-border: rgba(10,14,22,.10);
  --input: rgba(255,255,255,.75);
  --input-border: rgba(10,14,22,.10);
  --pill: rgba(10,14,22,.06);
  --pill-border: rgba(10,14,22,.12);
  --toggle: rgba(255,255,255,.55);
  --toggle-border: rgba(10,14,22,.12);

  --shadow: 0 28px 80px rgba(0, 0, 0, .22);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, .18);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #000;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--grad-a), var(--grad-b));
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9b6ff7, #5b9cf7);
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--grad-b) #000;
}

.bg {
  position: fixed;
  inset: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
  z-index: -2;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  display: none;
}

body:not([data-theme="light"]) .bg { display: none; }
body:not([data-theme="light"]) .bg-video--dark { display: block; }

body[data-theme="light"] .bg { display: none; }
body[data-theme="light"] .bg-video--light { display: block; }

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.30), rgba(0,0,0,.44));
  z-index: -1;
  pointer-events: none;
}

body[data-theme="light"] .bg-overlay {
  background:

    linear-gradient(to bottom, rgba(255,255,255,.08), rgba(0,0,0,.14));
}

.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 10;
}

.topbar > :last-child {
  justify-self: end;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px;
}

body[data-theme="light"] .topnav {
  background: rgba(255,255,255,.4);
}

.topnav-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 18px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}

.topnav-link:hover {
  color: var(--text);
}

.topnav-link--active {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.brand a {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 56px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 18px;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.theme-toggle:active { transform: scale(.98); }

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), var(--shadow-soft);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: transform .3s ease, opacity .25s ease;
}

.theme-icon .sun  { opacity: 1; transform: scale(1) rotate(0); }
.theme-icon .moon { opacity: 0; transform: scale(.6) rotate(-30deg); }

body[data-theme="dark"] .theme-icon .sun  {
  opacity: 0;
  transform: scale(.6) rotate(30deg);
}

body[data-theme="dark"] .theme-icon .moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.wrap {
  min-height: 100vh;
  padding: 100px 18px 34px;
}

.main-content {
  display: grid;
  grid-template-columns: 3fr 1fr minmax(0, 420px) minmax(0, 500px) 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.main-content > :first-child {
  grid-column: 3;
}

.main-content > :last-child {
  grid-column: 4;
}

.swap-card {
  width: min(420px, 92vw);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.panel {
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 12px 12px 10px;
}

.panel + .panel { margin-top: 12px; }

.panel--single { margin-top: 12px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-label {
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 800;
  color: var(--muted);
}

.cur-switch {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,.28);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--panel-border);
}

body[data-theme="light"] .cur-switch {
  background: rgba(255,255,255,.4);
}

.cur-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.cur-btn--active {
  background: var(--accent);
  color: #fff;
}

.panel-body {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.panel--single .panel-body {
  grid-template-columns: 1fr;
}

.breakdown {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.18);
  border: 1px solid var(--panel-border);
  padding: 10px 12px;
}

body[data-theme="light"] .breakdown {
  background: rgba(255,255,255,.44);
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

body[data-theme="light"] .breakdown-row {
  border-bottom: 1px solid rgba(10,14,22,.08);
}

.breakdown-row:last-child { border-bottom: none; }

.b-key {
  font-size: 12px;
  color: var(--muted);
}

.b-val {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}

.breakdown-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.breakdown-exp {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.amount-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.currency-prefix {
  font-size: 40px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  flex-shrink: 0;
}

.amount {
  min-width: 0;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 40px;
  font-weight: 750;
  letter-spacing: -0.02em;
  outline: none;
  padding: 2px 0;
  width: 100%;
}

.amount::placeholder { color: rgba(255,255,255,.28); }

body[data-theme="light"] .amount::placeholder { color: rgba(10,14,22,.26); }

.amount--readonly {
  user-select: none;
  opacity: .9;
}

.panel-foot {
  margin-top: 8px;
}

.approx {
  font-size: 12px;
  color: var(--muted);
}


.help {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.token-pill {
  border: 1px solid var(--pill-border);
  background: var(--pill);
  color: var(--text);
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(calc(var(--blur) / 1.2));
  -webkit-backdrop-filter: blur(calc(var(--blur) / 1.2));
  transition: transform .15s ease, border-color .2s ease;
}

.token-pill:active { transform: scale(.98); }

.token-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.token-badge {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(59, 130, 246, .28);
  border: 1px solid rgba(255,255,255,.16);
}

.token-badge--b { background: rgba(245, 158, 11, .26); }
.token-badge--e { background: rgba(168, 85, 247, .22); }
.token-badge--u { background: rgba(16, 185, 129, .22); }
.token-badge--x { background: rgba(59, 130, 246, .22); }
.token-badge--d { background: rgba(255, 185, 50, .26); }
.token-badge--l { background: rgba(180, 180, 180, .22); }
.token-badge--a { background: rgba(0, 51, 173, .26); }
.token-badge--xlm { background: rgba(20, 180, 240, .22); }
.token-badge--t { background: rgba(255, 6, 10, .22); }
.token-badge--dot { background: rgba(230, 0, 122, .22); }
.token-badge--ton { background: rgba(0, 136, 204, .26); }

.token-symbol {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}

.chev {
  font-size: 12px;
  color: var(--muted);
  transform: translateY(-1px);
}

.mid {
  display: grid;
  place-items: center;
  margin: 10px 0;
}

.flip {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--pill-border);
  background: var(--pill);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s ease, color .18s ease, border-color .18s ease;
}

.flip:hover { color: var(--text); border-color: rgba(255,255,255,.24); }
.flip:active { transform: rotate(180deg) scale(.98); }

.wallet {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input);
  border-radius: 14px;
  padding: 12px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.wallet::placeholder { color: rgba(255,255,255,.26); }
body[data-theme="light"] .wallet::placeholder { color: rgba(10,14,22,.30); }

.wallet:focus-visible {
  box-shadow: 0 0 0 4px var(--focus);
}

.privacy-note {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  line-height: 1.45;
}

body[data-theme="light"] .privacy-note {
  color: rgba(10,14,22,.62);
}

.privacy-mark {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(16, 185, 129, .28);
  border: 1px solid rgba(16, 185, 129, .36);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

body[data-theme="light"] .privacy-mark {
  color: #0f172a;
  background: rgba(16, 185, 129, .18);
}

.cta {
  margin-top: 14px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  color: rgba(255,255,255,.96);
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 14px 30px rgba(59, 130, 246, .28);
  transition: transform .14s ease, filter .2s ease;
}

.cta:active { transform: scale(.99); }
.cta:hover { filter: brightness(1.05); }

.cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 14px 30px rgba(59, 130, 246, .28);
}

.card-footer {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted);
}

.token-menu {
  position: fixed;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 20;
}

.token-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.token-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  cursor: pointer;
}

.token-item:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

body[data-theme="light"] .token-item:hover {
  background: rgba(10,14,22,.05);
  border-color: rgba(10,14,22,.08);
}

.token-item .token-badge {
  grid-row: 1 / span 2;
  grid-column: 1;
}

.token-item-name {
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 12px;
  grid-column: 2;
  grid-row: 1;
}

.token-item-sub {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  color: var(--muted);
}

.language-toggle-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}

.language-toggle {
  width: 80px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all .3s ease;
  overflow: hidden;
  position: relative;
  padding: 2px;
}

.language-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
}

.language-toggle:active {
  transform: translateY(0) scale(.98);
}

.language-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), var(--shadow-soft);
}

.language-slider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  overflow: hidden;
}

.language-option {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  transition: color .3s ease;
  cursor: pointer;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.language-option.active {
  color: var(--text);
}

.language-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 36px;
  height: 32px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-radius: 8px;
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-toggle[data-lang="en"]::before {
  transform: translateX(36px);
}


.language-option::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 14px;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 1;
}

.language-option[data-lang="fr"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 3 2'%3E%3Crect width='1' height='2' x='0' fill='%230055A4'/%3E%3Crect width='1' height='2' x='1' fill='%23FFFFFF'/%3E%3Crect width='1' height='2' x='2' fill='%23EF4135'/%3E%3C/svg%3E");
}

.language-option[data-lang="en"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 190 100'%3E%3Crect width='190' height='100' fill='%23B22234'/%3E%3Cg fill='%23FFFFFF'%3E%3Crect y='8' width='190' height='8'/%3E%3Crect y='24' width='190' height='8'/%3E%3Crect y='40' width='190' height='8'/%3E%3Crect y='56' width='190' height='8'/%3E%3Crect y='72' width='190' height='8'/%3E%3Crect y='88' width='190' height='8'/%3E%3C/g%3E%3Crect width='76' height='56' fill='%233C3B6E'/%3E%3C/svg%3E");
}

.language-option.show-flag::before {
  opacity: 1;
}

.language-option.show-flag .language-text {
  opacity: 0;
}

/* Crypto Details Section */
.crypto-details {
  width: min(500px, 100%);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 20px;
}

.crypto-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.crypto-title h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

.crypto-symbol {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.crypto-price {
  text-align: right;
}

.price-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: block;
}

.price-change {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.price-change.positive {
  color: #10b981;
}

.price-change.negative {
  color: #ef4444;
}

/* Chart Container */
.chart-container {
  margin-bottom: 24px;
}

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

.chart-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

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

.timeframe-btn {
  padding: 6px 10px;
  border: 1px solid var(--pill-border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.timeframe-btn:hover {
  background: var(--pill);
  color: var(--text);
}

.timeframe-btn.active {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: white;
  border-color: transparent;
}

.chart-wrapper {
  position: relative;
  height: 200px;
  background: var(--panel);
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 10;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-soft);
}

.chart-tooltip.visible {
  opacity: 1;
}

.tooltip-price {
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
}

.tooltip-change {
  font-size: 11px;
  margin-top: 2px;
}

.tooltip-change.positive {
  color: #10b981;
}

.tooltip-change.negative {
  color: #ef4444;
}

.tooltip-date {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-crosshair {
  position: absolute;
  background: rgba(139, 92, 246, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.chart-crosshair.vertical {
  width: 1px;
  height: 100%;
  top: 0;
}

.chart-crosshair.horizontal {
  width: 100%;
  height: 1px;
  left: 0;
}

.chart-wrapper:hover .chart-crosshair {
  opacity: 1;
}

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

.chart-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  gap: 12px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--muted);
  border-top: 2px solid var(--grad-a);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Crypto Stats */
.crypto-stats {
  margin-top: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 968px) {
  .main-content {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  
  .crypto-details {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .swap-card { width: 94vw; padding: 16px 16px 12px; }
  .amount { font-size: 36px; }
  
  .crypto-details {
    padding: 16px;
  }
  
  .crypto-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .crypto-price {
    text-align: left;
  }
  
  .chart-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .chart-timeframes {
    width: 100%;
    justify-content: space-between;
  }
  
  .timeframe-btn {
    flex: 1;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .language-toggle-wrapper {
    bottom: 20px;
    right: 20px;
  }
  
  .language-toggle {
    width: 72px;
    height: 36px;
  }
  
  .language-option {
    width: 32px;
    height: 28px;
    font-size: 10px;
  }
  
  .language-toggle::before {
    width: 32px;
    height: 28px;
  }
  
  .language-toggle[data-lang="en"]::before {
    transform: translateX(32px);
  }
}

/* ═══ Deposit Overlay (ChangeNow style) ═══════════════════════════ */
.deposit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.deposit-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.deposit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.deposit-card {
  position: relative;
  width: min(540px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px;
  background: rgba(16, 20, 34, .96);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .65);
  padding: 24px 28px 28px;
  transform: translateY(18px) scale(.97);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  color: rgba(255,255,255,.92);
}
.deposit-overlay.open .deposit-card {
  transform: translateY(0) scale(1);
}
.deposit-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.deposit-close:hover {
  color: #fff;
  border-color: rgba(255,255,255,.28);
}

/* Transaction ID row */
.dep-txid-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.dep-txid-label {
  font-size: 12px;
  color: rgba(255,255,255,.4);
}
.dep-txid {
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.06);
  padding: 4px 10px;
  border-radius: 6px;
}
.dep-txid-copy {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.45);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.dep-txid-copy:hover {
  color: #fff;
  background: rgba(255,255,255,.10);
}

/* Title */
.dep-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Main zone: left + right */
.dep-main {
  display: flex;
  gap: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.dep-left {
  flex: 1;
  min-width: 0;
}
.dep-field-label {
  font-size: 12px;
  color: rgba(255,255,255,.40);
  margin-bottom: 4px;
}
.dep-field-label--addr {
  margin-top: 18px;
}
.dep-amount {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.dep-addr-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.dep-addr {
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  word-break: break-all;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
  user-select: all;
}
.dep-copy-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.45);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, background .15s;
  margin-top: 2px;
}
.dep-copy-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.dep-copied {
  font-size: 11px;
  color: #10b981;
  font-weight: 700;
  margin-top: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.dep-copied.show {
  opacity: 1;
}

/* QR box */
.dep-qr-box {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dep-qr {
  width: 150px;
  height: 150px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ─── Stepper ─── */
.dep-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 4px;
}
.dep-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.dep-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.15);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  background: rgba(16, 20, 34, 1);
}
.dep-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}
.dep-step-icon--spin {
  border-color: #10b981;
  color: #10b981;
}
.dep-step-icon--spin svg {
  width: 18px;
  height: 18px;
  animation: spin 1.2s linear infinite;
}
.dep-step-line {
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(255,255,255,.10);
  z-index: 1;
}
.dep-step:last-child .dep-step-line {
  display: none;
}
.dep-step-text {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.35);
  text-align: center;
  white-space: nowrap;
}
.dep-step--active .dep-step-text {
  color: #10b981;
  font-weight: 700;
}
.dep-step--done .dep-step-icon {
  border-color: #10b981;
  background: #10b981;
}
.dep-step--done .dep-step-dot {
  background: #fff;
}
.dep-step--done .dep-step-text {
  color: rgba(255,255,255,.6);
}
.dep-step--done + .dep-step .dep-step-line,
.dep-step--done .dep-step-line {
  background: #10b981;
}

/* Bottom info */
.dep-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dep-bottom-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dep-bottom-label {
  font-size: 12px;
  color: rgba(255,255,255,.40);
}
.dep-bottom-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.dep-bottom-val--mono {
  font-size: 14px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 520px) {
  .dep-main {
    flex-direction: column;
    align-items: center;
  }
  .dep-left {
    width: 100%;
  }
  .dep-amount {
    font-size: 24px;
  }
  .dep-stepper {
    gap: 2px;
  }
  .dep-step-text {
    font-size: 9px;
  }
  .deposit-card {
    padding: 20px 16px 22px;
  }
}
