:root {
  --bg: #000; --text: #fff; --sec: rgba(235,235,245,0.6); --ter: rgba(235,235,245,0.3);
  --sep: rgba(84,84,88,0.55); --card: #1c1c1e; --card2: #2c2c2e;
  --green: #00d35a; --red: #ff453a; --orange: #ff9f0a; --cyan: #64d2ff;
  --blue: #0a84ff; --yellow: #ffd60a; --pink: #ff6b9a;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  min-height: 100%; }
body { padding-top: var(--safe-t); padding-bottom: calc(64px + var(--safe-b)); }
button, a, .tap { min-height: 44px; min-width: 44px; }
.tabular { font-variant-numeric: tabular-nums; }
#err { display: none; background: #3a1212; color: var(--red); padding: 10px 16px; font-size: 13px; }
#err.show { display: block; }
.nav { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.nav .title { font-weight: 600; flex: 1; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.pill.paper { background: rgba(255,159,10,0.18); color: var(--orange); }
.pill.live { background: rgba(0,211,90,0.18); color: var(--green); }
.balance { padding: 8px 16px 4px; font-size: 48px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.subrow { padding: 0 16px 12px; color: var(--sec); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.card { background: var(--card); border-radius: 16px; margin: 0 16px 12px; padding: 14px 16px; }
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.muted { color: var(--sec); font-size: 13px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--sep); min-height: 44px; }
.row:last-child { border-bottom: 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; backdrop-filter: blur(20px);
  background: rgba(28,28,30,0.85); border-top: 1px solid var(--sep);
  padding-bottom: var(--safe-b); z-index: 50; }
.tabs button { flex: 1; background: none; border: 0; color: var(--ter); padding: 10px 0 8px;
  font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button.active { color: var(--blue); }
.tabs .ico { font-size: 18px; line-height: 1; }
.screen { display: none; }
.screen.active { display: block; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.agent-dot.stale { background: var(--red); }
.agent-dot.paused { background: var(--orange); }
.btn { background: var(--card2); color: var(--text); border: 0; border-radius: 12px;
  padding: 12px 16px; font-size: 15px; font-weight: 600; width: 100%; margin: 8px 0; }
.btn.primary { background: var(--blue); }
.btn.danger { background: var(--red); }
.input { width: 100%; background: var(--card2); border: 0; border-radius: 12px; color: var(--text);
  padding: 12px 14px; font-size: 16px; margin: 6px 0; }
canvas.chart { width: 100%; height: 180px; display: block; }
.empty { color: var(--ter); text-align: center; padding: 28px 16px; font-size: 14px; }
a.link { color: var(--blue); text-decoration: none; word-break: break-all; }
.strike { text-decoration: line-through; color: var(--ter); }
.layer { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--sep); font-size: 13px; }
.ok { color: var(--green); } .bad { color: var(--red); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.hidden { display: none !important; }
body.gated { padding-bottom: var(--safe-b); }
.token-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-b));
}
.gate-card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
}
.gate-card h1 { margin: 0 0 12px; font-size: 28px; font-weight: 700; }
.gate-card label { display: block; margin: 16px 0 6px; font-size: 13px; }
.gate-note { margin-top: 16px; line-height: 1.4; }
