/* ================================================================
   CoinTrade — Global Styles
   Mobile-first, fully responsive
   ================================================================ */

/* ---------- Variables ---------- */
:root {
  --bg-deep:        #070a0f;
  --bg-surface:     #0d1219;
  --bg-elevated:    #121a24;
  --border:         rgba(255,255,255,.08);
  --text:           #e8edf5;
  --text-muted:     #8b98ab;
  --accent:         #3dffe0;
  --accent-dim:     rgba(61,255,224,.15);
  --danger:         #ff6b8a;
  --success:        #5cf0a8;
  --warning:        #ffc857;
  --radius:         14px;
  --radius-sm:      10px;
  --font:           "Outfit", system-ui, sans-serif;
  --mono:           "JetBrains Mono", ui-monospace, monospace;
  --shadow:         0 24px 80px rgba(0,0,0,.45);
  --accent-secondary: #8ec5ff;
  --header-h:       56px;
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
  --safe-top:       env(safe-area-inset-top, 0px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* ---------- Background grid ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(61,255,224,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,255,224,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% -10%, black, transparent);
  z-index: 0;
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  background: rgba(7,10,15,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: var(--header-h);
  padding-top: var(--safe-top);
}

.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: clamp(.95rem, 3vw, 1.15rem);
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark { color: var(--accent); font-size: 1.2em; }

/* Logo resmi */
.site-logo-img {
  height: 137px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Desktop nav */
.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  transition: color .15s;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--text); }
.nav-balance {
  color: var(--accent);
  font-family: var(--mono);
  font-size: .875rem;
  white-space: nowrap;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0;
  background: rgba(7,10,15,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 190;
  flex-direction: column;
  padding: 1.5rem 1.5rem calc(1.5rem + var(--safe-bottom));
  gap: .5rem;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.nav-mobile.open {
  display: flex;
  transform: translateY(0);
}
.nav-mobile a, .nav-mobile button {
  display: flex;
  align-items: center;
  padding: .9rem 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 52px;
}
.nav-mobile a:hover, .nav-mobile button:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.nav-mobile .nav-balance {
  padding: .9rem 1rem;
  font-size: .95rem;
  display: block;
}
.nav-mobile-sep {
  height: 1px;
  background: var(--border);
  margin: .5rem 0;
}

/* ================================================================
   MAIN
   ================================================================ */
.main-content {
  position: relative;
  z-index: 1;
  padding-bottom: 4rem;
}

.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); font-size: .875rem; margin: 0 0 1rem; }
.muted.small { font-size: .8rem; margin: 0 0 .75rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-sm  { padding: .45rem .9rem; font-size: .875rem; min-height: 36px; }
.btn-lg  { padding: .9rem 1.6rem; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #2ae4c8, #1ab89e);
  color: #041210;
  box-shadow: 0 8px 32px rgba(61,255,224,.25);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(61,255,224,.35); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: rgba(61,255,224,.35); }
.btn-outline { background: transparent; color: var(--accent); border-color: rgba(61,255,224,.45); }
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.15); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

/* ================================================================
   HERO
   ================================================================ */
.hero { padding: clamp(2rem, 6vw, 5rem) 0 2.5rem; }
.eyebrow {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin: 0 0 1rem;
}
.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 20ch;
}
.hero-lead {
  font-size: clamp(.95rem, 2.5vw, 1.1rem);
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 2rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

/* Ticker rail */
.ticker-rail {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.ticker-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: .85rem 1rem;
  animation: ticker-scroll 55s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-chip {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  padding: .5rem .85rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.ticker-pair  { font-weight: 600; font-size: .8rem; color: var(--text-muted); }
.ticker-price { font-weight: 600; font-size: .95rem; }
.ticker-ch.up   { color: var(--success); font-size: .9rem; }
.ticker-ch.down { color: var(--danger);  font-size: .9rem; }

/* ================================================================
   FEATURES
   ================================================================ */
.features { padding: 1.5rem 0 4rem; }
.grid-3 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature-card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.feature-card p  { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* ================================================================
   AUTH
   ================================================================ */
.auth-wrap {
  padding: clamp(2rem, 6vw, 4rem) 0;
  display: flex;
  justify-content: center;
}
.auth-card   { width: min(420px, 100%); }
.auth-title  { margin: 0 0 1.5rem; font-size: 1.5rem; }
.auth-footer { margin-top: 1.25rem; color: var(--text-muted); font-size: .95rem; }
.auth-footer a { color: var(--accent); }
.hint { margin-top: .75rem; font-size: .8rem; color: var(--text-muted); }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 1.1rem; }
.form-stack.tight { gap: .85rem; }
.form-stack label span {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.form-stack input,
.form-stack select {
  width: 100%;
  padding: .75rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem; /* prevents iOS zoom */
  min-height: 48px;
  -webkit-appearance: none;
}
.form-stack input:focus,
.form-stack select:focus {
  outline: none;
  border-color: rgba(61,255,224,.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Alert */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
  font-size: .9rem;
}
.alert-error {
  background: rgba(255,107,138,.12);
  border: 1px solid rgba(255,107,138,.35);
  color: #ffb3c4;
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.dashboard { padding: clamp(1rem, 3vw, 2rem) 0; }
.dash-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.page-title { margin: 0; font-size: clamp(1.4rem, 3vw, 1.75rem); }
.page-sub   { margin: .35rem 0 0; color: var(--text-muted); }

.balance-cards { display: flex; flex-wrap: wrap; gap: .75rem; }
.balance-card  { min-width: 130px; padding: .9rem 1.1rem; }
.balance-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.balance-value { font-size: 1.2rem; font-weight: 600; color: var(--accent); }

/* Trade layout — two-column on wide, single on narrow */
.trade-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: min(320px, 100%) 1fr;
  align-items: start;
  margin-bottom: 1.5rem;
}
.catalog-sidebar {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.catalog-title { margin: 0; font-size: 1.05rem; }
.catalog-count { font-size: .8rem; color: var(--text-muted); }
.catalog-search {
  width: 100%;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  min-height: 44px;
}
.catalog-search:focus { outline: none; border-color: rgba(61,255,224,.45); }
.catalog-list {
  max-height: min(68vh, 580px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  scrollbar-width: thin;
}
.catalog-loading { padding: 1rem; margin: 0; }
.catalog-row {
  display: grid;
  grid-template-columns: minmax(4rem, auto) 1fr minmax(4.5rem, auto);
  gap: .5rem .75rem;
  align-items: center;
  width: 100%;
  padding: .6rem .75rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.catalog-row:last-child { border-bottom: none; }
.catalog-row:hover, .catalog-row:active { background: rgba(61,255,224,.06); }
.catalog-row-active { background: var(--accent-dim); box-shadow: inset 3px 0 0 var(--accent); }
.catalog-sym  { font-weight: 700; color: var(--accent); }
.catalog-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-id   { font-size: .72rem; color: var(--text-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; }
.catalog-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.catalog-pageinfo { font-size: .85rem; color: var(--text-muted); }

.trade-right { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.deposit-always { padding: 1.1rem 1.25rem; }
.trade-empty { padding: 2rem 1.5rem; text-align: center; }
.trade-empty-title { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 600; }
.trade-active { display: flex; flex-direction: column; gap: 1rem; }
.trade-panels { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Coin toolbar */
.coin-toolbar { padding: 1.1rem 1.35rem; }
.coin-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.coin-pick { flex: 1; min-width: 180px; }
.coin-pick > label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .45rem;
}
.coin-input-wrap { display: flex; gap: .5rem; align-items: stretch; }
.coin-symbol-input {
  flex: 1;
  min-width: 0;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--mono);
  min-height: 44px;
}
.coin-symbol-input:focus {
  outline: none;
  border-color: rgba(61,255,224,.45);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.hint-inline { margin: .5rem 0 0; font-size: .78rem; color: var(--text-muted); max-width: 46ch; }
.coin-live { text-align: right; display: flex; flex-direction: column; gap: .2rem; align-items: flex-end; }
.coin-live-name  { font-size: .85rem; color: var(--text-muted); }
.coin-live-price { font-size: 1.35rem; font-weight: 600; color: var(--accent); }
.coin-live-ch    { font-size: .85rem; font-weight: 600; }
.coin-live-ch.up   { color: var(--success); }
.coin-live-ch.down { color: var(--danger); }

.picked-label { margin: 0 0 .25rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.picked-title { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.picked-sub   { margin: .25rem 0 0; font-size: .8rem; color: var(--text-muted); }

/* Chart */
.dash-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.chart-section { min-height: 360px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h2 { margin: 0; font-size: 1.1rem; }
.chart-wrap { position: relative; height: 280px; margin-bottom: 1rem; }
.live-prices { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .9rem; color: var(--text-muted); }
.live-prices strong { color: var(--text); }

/* Tab pills */
.tab-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill {
  padding: .4rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 36px;
}
.pill:hover  { color: var(--text); }
.pill.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(61,255,224,.35); }

/* Holdings */
.holdings-section h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.holdings-table tbody tr[data-coin-id]:hover { background: rgba(61,255,224,.05); }

/* History */
.history-section { margin-top: 1.5rem; }
.history-section h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 480px; }
.data-table th, .data-table td {
  padding: .65rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
}
.data-table .num { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; text-transform: uppercase; }
.badge-buy     { background: rgba(92,240,168,.15); color: var(--success); }
.badge-sell    { background: rgba(255,107,138,.12); color: #ff9eb0; }
.badge-deposit { background: rgba(255,200,87,.15);  color: var(--warning); }

/* Side stack */
.side-stack { display: flex; flex-direction: column; gap: 1rem; }
.panel-card h2 { margin: 0 0 .35rem; font-size: 1rem; }

/* CoinCap */
.coincap-panel { margin-bottom: 1.25rem; padding: 1.1rem 1.35rem; }
.coincap-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.coincap-panel-title { margin: 0; font-size: 1.05rem; }
.coincap-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.coincap-cell {
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.coincap-sym { font-size: .9rem; font-weight: 700; color: var(--accent-secondary); }
.coincap-n   { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coincap-pr  { font-size: .95rem; font-weight: 600; color: var(--accent); }
.coincap-ch  { font-size: .8rem; font-weight: 600; }
.coincap-ch.up   { color: var(--success); }
.coincap-ch.down { color: var(--danger); }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-bottom));
  right: 1.5rem;
  z-index: 300;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: min(360px, 100vw - 2rem);
  font-size: .95rem;
}
.toast.ok  { border-color: rgba(92,240,168,.4); }
.toast.err { border-color: rgba(255,107,138,.45); color: #ffb3c4; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0 1.5rem; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.footer-inner p { margin: 0; font-size: .85rem; color: var(--text-muted); text-align: center; }

/* Footer — App Download */
.footer-app-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-app-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  line-height: 1.2;
}
.btn-store:hover { border-color: var(--accent); background: rgba(61,255,224,.06); }
.btn-store-icon { font-size: 20px; line-height: 1; }
.btn-store-text { display: flex; flex-direction: column; }
.btn-store-sub  { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.btn-store-name { font-size: 13px; font-weight: 700; color: var(--text); }

/* App Download Modal */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.app-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.app-modal {
  background: var(--bg-elevated);
  border: 1px solid rgba(61,255,224,.2);
  border-radius: 20px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  transform: translateY(16px);
  transition: transform .2s;
}
.app-modal-overlay.open .app-modal { transform: translateY(0); }
.app-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s;
}
.app-modal-close:hover { color: var(--text); }
.app-modal-logo {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.app-modal h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}
.app-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}
.app-modal-stores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.app-modal-stores .btn-store {
  padding: 12px 18px;
  font-size: 13px;
}
.app-modal-stores .btn-store-icon { font-size: 24px; }
.app-modal-stores .btn-store-name { font-size: 15px; }
.app-modal-qr {
  text-align: center;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.app-modal-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.app-modal-feat {
  background: rgba(61,255,224,.07);
  border: 1px solid rgba(61,255,224,.15);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--accent);
}

/* Header download btn */
.nav-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(61,255,224,.15), rgba(142,197,255,.1));
  border: 1px solid rgba(61,255,224,.3);
  border-radius: 8px;
  color: var(--accent) !important;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-app-btn:hover {
  background: rgba(61,255,224,.2);
  border-color: var(--accent);
}

/* Dash grid (old panels) */
.dash-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr min(340px, 100%);
  align-items: start;
}

/* Accent colours */
.accent-secondary { color: var(--accent-secondary); }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ---- Tablet (≤ 960px) ---- */
@media (max-width: 960px) {
  .trade-layout {
    grid-template-columns: 1fr;
  }
  .catalog-list { max-height: 40vh; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---- Mobile (≤ 640px) ---- */
@media (max-width: 640px) {
  /* Nav: show hamburger, hide desktop links */
  .nav > a,
  .nav > span.nav-balance { display: none; }
  .nav-toggle { display: flex; }

  .hero-cta .btn { flex: 1 1 140px; text-align: center; }

  .balance-cards { gap: .5rem; }
  .balance-card  { flex: 1 1 calc(50% - .25rem); min-width: 0; }

  .trade-panels { grid-template-columns: 1fr; }
  .trade-layout { gap: .75rem; }

  .catalog-list { max-height: 35vh; }

  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .5rem .6rem; }

  .card { padding: 1.1rem 1.15rem; }
  .coin-live-price { font-size: 1.15rem; }

  .page-title { font-size: 1.35rem; }

  /* Push content above mobile bottom bar if on exchange */
  body.has-mobile-nav { padding-bottom: calc(60px + var(--safe-bottom)); }
}

/* ---- Very small (≤ 380px) ---- */
@media (max-width: 380px) {
  .container { width: calc(100% - 1.25rem); }
  .balance-card { flex: 1 1 100%; }
  .hero-cta .btn { flex: 1 1 100%; }
}
