:root {
  --bg: #07080c;
  --card: #12141c;
  --card2: #1a1d28;
  --border: #2a2e3d;
  --text: #f2f4f8;
  --muted: #8b92a8;
  --green: #22e38a;
  --red: #ff4d6a;
  --amber: #ffc857;
  --blue: #5b8cff;
  --live: #ff2d55;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  display: flex; justify-content: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1a1030 0%, transparent 55%),
    var(--bg);
}
.phone {
  width: 100%; max-width: 390px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px 14px calc(72px + var(--safe-bottom));
  position: relative;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.brand { font-weight: 800; letter-spacing: 0.02em; font-size: 15px; }
.brand span.sub { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; }
.mode {
  display: inline-block; margin-left: 6px;
  background: #1e2436; border: 1px solid var(--border);
  color: var(--amber); font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; letter-spacing: 0.08em;
}
.live {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,45,85,0.15);
  border: 1px solid rgba(255,45,85,0.45);
  color: #ff7a95; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,45,85,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,45,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,85,0); }
}
.err {
  background: rgba(255,77,106,0.1); border: 1px solid rgba(255,77,106,0.35);
  color: #ffb3c0; padding: 10px; border-radius: 10px; font-size: 12px; margin-bottom: 10px;
}
.auth {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; margin-bottom: 12px; font-size: 13px; color: var(--muted);
}
.hero {
  background: linear-gradient(160deg, #161925 0%, #0e1018 100%);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 16px 14px; margin-bottom: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.hero .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.hero .equity {
  font-size: 34px; font-weight: 800; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.hero .pnl {
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.up { color: var(--green); } .down { color: var(--red); }
.hero .meta {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.hero .meta div {
  background: var(--card2); border-radius: 10px; padding: 8px 10px; flex: 1; min-width: 70px;
}
.hero .meta .k { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.hero .meta .v { font-weight: 700; font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chart-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 10px 8px 6px; margin-bottom: 12px;
}
.ranges { display: flex; gap: 4px; padding: 0 4px 8px; overflow-x: auto; }
.ranges button {
  flex: 0 0 auto; background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 8px; cursor: pointer;
}
.ranges button.on {
  color: var(--text); background: var(--card2); border-color: #3a4158;
}
.chart { width: 100%; height: 120px; display: block; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 6px; text-align: center;
}
.stat .n { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 10px; text-transform: uppercase; margin-top: 2px; }
.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 6px 2px 8px;
}
.section-h h2 {
  margin: 0; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.section-h .hint { font-size: 11px; color: var(--muted); }
.agents { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.agent {
  display: grid; grid-template-columns: 12px 1fr auto;
  gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
}
.hb {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
}
.hb.ok { background: var(--green); box-shadow: 0 0 8px rgba(34,227,138,0.35); }
.agent .name { font-weight: 800; font-size: 13px; }
.agent .card { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.agent .age { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
}
.row {
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 8px; padding: 10px 12px; border-bottom: 1px solid #1c2030;
  align-items: center; text-decoration: none; color: inherit;
}
.row:last-child { border-bottom: none; }
.kind {
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  padding: 4px 0; text-align: center; border-radius: 6px;
  background: rgba(255,77,106,0.12); color: var(--red);
}
.kind.bought, .kind.cleared, .kind.signal { background: rgba(34,227,138,0.12); color: var(--green); }
.kind.sold, .kind.stopped { background: rgba(255,200,87,0.12); color: var(--amber); }
.row .main { min-width: 0; }
.row .sym { font-weight: 800; font-size: 13px; }
.row .who { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { text-align: right; font-variant-numeric: tabular-nums; }
.row .usd { font-weight: 700; font-size: 12px; }
.row .when { font-size: 10px; color: var(--muted); }
.empty {
  padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px;
}
.panel { display: none; }
.panel.on { display: block; }
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 390px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(12,14,20,0.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(8px + var(--safe-bottom));
  z-index: 20;
}
.tabs button {
  background: transparent; border: 0; color: var(--muted);
  font-size: 11px; font-weight: 700; padding: 10px 4px; cursor: pointer;
}
.tabs button.on { color: var(--text); }
.footer {
  margin-top: 14px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.45;
}
