/* Токены продублированы из app/web_static/assets/dashboard.css — Mini App
   отдаётся отдельным aiohttp-сервером на другом порту (см. app/miniapp.py),
   так что делить один и тот же CSS-файл между двумя независимыми
   инстансами нельзя без кросс-origin запроса; палитра маленькая, дублировать
   её сюда проще и надёжнее. */
:root {
  --bg: #0a0d12;
  --panel: #12161f;
  --panel-alt: #171c27;
  --border: #232a38;
  --text: #e7eaf1;
  --muted: #7d879b;
  --muted-2: #545e70;
  --positive: #4fd1a5;
  --negative: #e8697f;
  --warn: #e8b44a;
  --info: #5b8def;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button { font-family: inherit; }

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px calc(84px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

.screen { display: none; flex-direction: column; gap: 16px; }
.screen.active { display: flex; }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- hero ---------- */
.wallet-hero {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-alt), var(--panel));
  border-radius: 18px;
  padding: 24px 22px 20px;
  text-align: center;
}
.wallet-hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.wallet-hero-number {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wallet-hero-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 6px;
}

/* ---------- status chips ---------- */
.chip-row { display: flex; gap: 10px; }
.status-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}
.status-chip .chip-title { font-size: 12px; color: var(--muted); }
.status-chip .chip-mode { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.status-chip .chip-mode.mode-live { color: var(--negative); }
.status-chip .chip-mode.mode-paper { color: var(--positive); }

/* ---------- cards ---------- */
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
}
.card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.stat-value { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.stat-value.pos { color: var(--positive); }
.stat-value.neg { color: var(--negative); }

/* ---------- mode toggle ---------- */
.mode-toggle-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mode-toggle-btn.state-paper { border-color: rgba(79,209,165,0.35); }
.mode-toggle-btn.state-live { border-color: rgba(232,105,127,0.45); background: rgba(232,105,127,0.08); }
.mode-toggle-btn .arrow { color: var(--muted); font-weight: 400; }
.mode-toggle-btn:disabled { opacity: 0.5; }

/* ---------- exchange chips ---------- */
.exchange-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.exchange-chip {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  font-family: var(--mono);
  font-size: 12px;
}
.exchange-chip .name { text-transform: uppercase; color: var(--muted); font-size: 10px; display: block; }

/* ---------- trade list ---------- */
.trade-list { display: flex; flex-direction: column; gap: 8px; }
.trade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-alt);
  font-family: var(--mono);
  font-size: 12.5px;
}
.trade-row .tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  margin-right: 6px;
}
.tag.paper { background: rgba(124,135,155,0.15); color: var(--muted); }
.tag.real { background: rgba(232,105,127,0.15); color: var(--negative); }
.trade-row .amt.pos { color: var(--positive); }
.trade-row .amt.neg { color: var(--negative); }
.empty-state { text-align: center; color: var(--muted-2); font-size: 13px; padding: 18px 0; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  border-top: 1px solid var(--border);
  background: rgba(10,13,18,0.92);
  backdrop-filter: blur(8px);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.nav-btn {
  flex: 1;
  padding: 12px 0 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.nav-btn .nav-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.nav-btn.active { color: var(--text); }
.nav-btn.active .nav-dot { background: var(--info); }

.unauthorized {
  margin: 40px auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
}
