:root {
  --bg: #0B0B12;
  --surface: #16161F;
  --surface2: #1D1D2A;
  --border: rgba(255, 255, 255, 0.07);
  --text: #F5F5FA;
  --dim: #9A9AB0;
  --faint: #6C6C82;
  --accent: #7C5CFA;
  --accent-soft: rgba(124, 92, 250, 0.16);
  --accent-text: #C9BDFF;
  --green: #34D399;
  --red: #FF6B81;
  --yellow: #FBBF24;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body { overscroll-behavior-y: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

.boot { padding: 40px 20px; color: var(--dim); font-size: 14px; }

.screen {
  flex: 1;
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 96px; /* место под нижнюю навигацию */
}

/* ---------- header ---------- */
.header { display: flex; align-items: center; gap: 12px; }
.header .icon-tile {
  width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.header .titles { flex: 1; min-width: 0; }
.header .title-main { font-size: 16px; font-weight: 700; }
.header .title-sub {
  font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; margin-top: 1px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--green); }
.dot.off { background: var(--faint); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--dim); cursor: pointer;
}

.page-title { font-size: 20px; font-weight: 800; }
.page-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* ---------- hero ---------- */
.hero {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 18px; cursor: pointer;
}
.hero-label { font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: .02em; }
.hero-hold {
  font-size: 11px; color: var(--dim); background: var(--surface2); padding: 4px 10px;
  border-radius: 999px; font-weight: 600;
}
.hero-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.hero-coin { display: flex; align-items: center; gap: 10px; }
.hero-value { font-size: 22px; font-weight: 800; }
.hero-sub { font-size: 13px; color: var(--dim); margin-top: 6px; }

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; flex-shrink: 0;
}

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; }
.chip {
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  background: var(--surface2); color: var(--dim); white-space: nowrap; border: none; cursor: pointer;
}
.chip.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- sections ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head .title { font-size: 15px; font-weight: 700; }
.section-head .count { font-size: 12px; color: var(--faint); }

/* ---------- cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.signal-card {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px; cursor: pointer;
}
.signal-card .mid { flex: 1; min-width: 0; }
.signal-card .coin { font-size: 15px; font-weight: 700; }
.signal-card .pair {
  font-size: 12px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.signal-card .right { text-align: right; flex-shrink: 0; }
.signal-card .value { font-size: 15px; font-weight: 800; }
.signal-card .hold { font-size: 11px; color: var(--faint); margin-top: 2px; }

.empty { color: var(--faint); font-size: 13px; padding: 24px 0; text-align: center; }

/* ---------- detail ---------- */
.leg-toggle { display: flex; gap: 8px; background: var(--surface2); padding: 4px; border-radius: 14px; }
.leg-toggle button {
  flex: 1; border: none; cursor: pointer; padding: 10px 0; border-radius: 10px;
  font-size: 13px; font-weight: 700; background: transparent; color: var(--dim);
}
.leg-toggle button.active { background: var(--accent); color: #fff; }

.stat-card, .chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.stat-label { font-size: 12px; color: var(--dim); font-weight: 600; }
.stat-row { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.stat-value { font-size: 30px; font-weight: 800; }
.stat-note { font-size: 13px; color: var(--dim); }
.stat-sub { font-size: 13px; color: var(--dim); margin-top: 4px; }

.chart-card { padding: 16px 16px 10px; position: relative; }
.chart-title { font-size: 12px; color: var(--dim); font-weight: 600; margin-bottom: 8px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-top: 2px; }

.leg-summary { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.leg-summary .name { font-size: 13px; font-weight: 700; }
.leg-summary .symbol { font-size: 12px; color: var(--dim); margin-top: 2px; }
.leg-summary .price { font-size: 14px; font-weight: 700; text-align: right; }
.leg-summary .rate { font-size: 12px; margin-top: 2px; text-align: right; }

.risk-strip {
  background: var(--surface2); border-radius: 16px; padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start; margin-top: auto;
}
.risk-strip .mark { font-size: 13px; font-weight: 800; color: var(--yellow); flex-shrink: 0; }
.risk-strip p { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.4; }

/* ---------- history ---------- */
.history-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.history-row .coin { font-size: 14px; font-weight: 700; }
.history-row .pair { font-weight: 500; color: var(--dim); font-size: 12px; }
.history-row .status { font-size: 12px; color: var(--faint); margin-top: 2px; }
.history-row .right { text-align: right; flex-shrink: 0; }
.history-row .pct { font-size: 13px; font-weight: 700; }
.history-row .time { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ---------- status ---------- */
.exchange-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.exchange-head { display: flex; align-items: center; justify-content: space-between; }
.exchange-name { font-size: 15px; font-weight: 700; }
.exchange-live { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green); }
.exchange-live.off { color: var(--faint); }
.exchange-contracts { font-size: 12px; color: var(--dim); margin-top: 8px; }
.exchange-coverage { font-size: 12px; color: var(--faint); margin-top: 4px; line-height: 1.4; }

.note-box { background: var(--surface2); border-radius: 16px; padding: 12px 14px; font-size: 12px; color: var(--dim); line-height: 1.4; }

/* ---------- settings ---------- */
.settings-group-title { font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 10px; }
.settings-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.settings-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); padding: 14px; }
.settings-row .label { font-size: 13px; color: var(--dim); }
.settings-row .value { font-size: 14px; font-weight: 700; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.badge { font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); padding: 3px 10px; border-radius: 999px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: #12121A; border-top: 1px solid var(--border);
  display: flex; align-items: stretch; padding: 6px 8px calc(14px + env(safe-area-inset-bottom));
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 0; color: var(--faint); }
.nav a.active { color: #EDEBFF; }
.nav .pill { width: 34px; height: 26px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.nav a.active .pill { background: rgba(124, 92, 250, 0.22); }
.nav .label { font-size: 11px; font-weight: 600; letter-spacing: .01em; }

@media (min-width: 480px) {
  .screen { max-width: 480px; margin: 0 auto; width: 100%; }
}
