:root {
  color-scheme: dark;
  --bg: #000;
  --card: #1c1c1e;
  --line: #2c2c2e;
  --text: #f5f5f7;
  --muted: #8e8e93;
  --green: #00d35a;
  --red: #ff6b9a;
  --orange: #ff9f0a;
  --blue: #64d2ff;
  --yellow: #ffd60a;
  --purple: #bf5af2;
  --tap: 44px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; background: none; border: 0; }
a { color: var(--blue); text-decoration: none; }
.app {
  height: 100%; max-width: 430px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: #000;
  position: relative;
}
.navbar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; min-height: var(--tap); flex-shrink: 0;
}
.nav-title { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.nav-title .chev { color: var(--muted); font-weight: 400; margin-left: 2px; }
.nav-right { display: flex; gap: 4px; }
.nav-btn {
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); border-radius: 50%; position: relative;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #64d2ff, #bf5af2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #000;
}
.bell .unread {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px #000;
}
.search-bar {
  display: flex; gap: 8px; padding: 0 14px 8px; align-items: center;
}
.search-bar input {
  flex: 1; min-height: var(--tap); border-radius: 12px;
  background: var(--card); padding: 0 14px; border: 1px solid var(--line);
}
.search-bar button { color: var(--blue); min-height: var(--tap); padding: 0 8px; }

.screens { flex: 1; position: relative; overflow: hidden; background: #000; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 0 16px 28px; -webkit-overflow-scrolling: touch;
  background: #000;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 1;
}
.screen.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none; z-index: 2;
}
.screen.detail { z-index: 5; }
@media (prefers-reduced-motion: reduce) {
  .screen { transition: none; }
  .odo-digit { transition: none !important; }
  .beam-v { animation: none !important; }
}

.banner {
  margin: 8px 0 12px; padding: 12px; border-radius: 12px;
  border: 1px dashed rgba(255,107,154,0.45); color: var(--red);
  font-size: 13px; text-align: center; line-height: 1.35;
}
.banner.info { border-color: var(--line); color: var(--muted); }
.banner.empty { border-style: dashed; color: var(--muted); }

.bal-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; }
.balance {
  font-family: "SF Pro Display", "Inter Tight", "SF Pro Text", -apple-system, sans-serif;
  font-size: clamp(66px, 18vw, 100px);
  font-weight: 650; letter-spacing: -0.04em; line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.paper-pill {
  margin-top: 14px; align-self: flex-start;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 9px; border-radius: 999px;
  background: #ff9f0a; color: #1a0d00;
}
.bal-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; font-size: 15px; color: var(--muted);
}
.bal-meta .up { color: var(--green); }
.bal-meta .down { color: var(--red); }
.mult-pill {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0,211,90,0.16); color: var(--green);
  font-size: 13px; font-weight: 600;
}

.odo { display: inline-flex; height: 1em; overflow: hidden; }
.odo-digit {
  display: inline-block;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.chart-bare {
  position: relative; height: 200px; margin-top: 14px;
  background: #000;
}
.chart-bare canvas { width: 100%; height: 100%; display: block; }
.chart-empty {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  justify-content: center; padding-bottom: 28px;
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.range-row { display: flex; gap: 4px; margin-top: 10px; justify-content: space-between; }
.chip {
  flex: 1; min-height: 32px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.chip.active { color: var(--text); background: #1c1c1e; }

.sec-head {
  margin: 22px 0 10px; font-size: 20px; font-weight: 650;
  letter-spacing: -0.02em;
}
.sec-head.row { display: flex; justify-content: space-between; align-items: baseline; }
.see-all { color: var(--blue); font-size: 20px; font-weight: 650; min-height: auto; padding: 0; display: inline; }

.carousel {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 2px 0 10px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.agent-card {
  flex: 0 0 calc(100vw - 32px); max-width: 398px;
  aspect-ratio: 504 / 470;
  border-radius: calc(42 * (100vw - 32px) / 504);
  max-height: 420px;
  background: var(--card); scroll-snap-align: start;
  padding: 18px 16px; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; color: inherit;
}
@media (min-width: 430px) {
  .agent-card { flex-basis: 398px; border-radius: 33px; }
}
.agent-card .top { display: flex; justify-content: space-between; align-items: center; }
.agent-card .name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.agent-card .tag { font-size: 14px; color: var(--muted); }
.agent-card .feed { flex: 1; overflow: hidden; font-size: 13px; line-height: 1.45; }
.agent-card .feed .kill { color: #636366; text-decoration: line-through; }
.agent-card .feed .pass { color: var(--text); }
.strips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.strip {
  height: 28px; border-radius: 8px; background: #2c2c2e;
  display: flex; align-items: center; padding: 0 8px;
  font-size: 11px; color: var(--muted); overflow: hidden;
}
.strip.ok { background: rgba(0,211,90,0.15); color: var(--green); }
.strip.bad { background: rgba(255,107,154,0.15); color: var(--red); }
.score-ring {
  width: 96px; height: 96px; border-radius: 50%; margin: 12px auto;
  border: 6px solid #3a3a3c; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--yellow);
  border-top-color: var(--yellow);
}
.progress {
  height: 8px; border-radius: 999px; background: #2c2c2e; overflow: hidden; margin-top: 8px;
}
.progress > i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pill {
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #2c2c2e; color: var(--muted);
}
.pill.stop { background: rgba(255,107,154,0.18); color: var(--red); }
.pill.trail { background: rgba(0,211,90,0.18); color: var(--green); }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--tap); padding: 10px 0; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .title { font-size: 16px; font-weight: 550; }
.list-row .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-row .value { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 16px; border-radius: 14px;
  background: var(--card); font-size: 16px; font-weight: 650;
}
.btn.primary { background: var(--green); color: #04140b; width: 100%; margin-top: 14px; }
.btn.danger { background: rgba(255,107,154,0.18); color: var(--red); width: 100%; margin-top: 14px; }
.btn.row { width: 100%; margin-top: 10px; }
.btn.ghost { background: transparent; color: var(--blue); }

.full-card {
  background: var(--card); border-radius: 20px; padding: 16px; margin-bottom: 12px;
}
.full-card .head { display: flex; justify-content: space-between; align-items: center; }
.full-card .name { font-size: 20px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 8px; }
.status-dot.on { background: var(--green); }
.switch {
  width: 48px; height: 28px; border-radius: 999px; background: #3a3a3c;
  position: relative; opacity: 0.55; pointer-events: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
}
.switch.on { background: var(--green); }
.switch.on::after { left: 23px; }

.coin-head { margin-top: 4px; }
.coin-head .name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coin-head .name { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.shield {
  font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px;
  background: rgba(0,211,90,0.16); color: var(--green);
}
.coin-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.coin-price {
  margin-top: 12px; font-size: 40px; font-weight: 650; letter-spacing: -0.03em;
  font-family: "SF Pro Display", "Inter Tight", sans-serif;
}
.coin-chg { margin-top: 4px; font-size: 15px; }
.coin-chg.up { color: var(--green); }
.coin-chg.down { color: var(--red); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--card); border-radius: 14px; padding: 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 17px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pos-card { margin-top: 14px; background: var(--card); border-radius: 16px; padding: 14px; }
.pos-card .h { font-size: 15px; font-weight: 600; }
.pos-card .exit { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Auditor vertical stack */
.stack-wrap { position: relative; height: 220px; margin: 12px 0 8px; }
.disc-stack { position: relative; height: 100%; width: 120px; margin: 0 auto; }
.disc-ell {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 110px; height: 34px; border-radius: 50%;
  background: #2c2c2e; border: 2px solid #3a3a3c;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
  transition: background .25s, border-color .25s, color .25s;
}
.disc-ell.pass { background: rgba(0,211,90,0.2); border-color: var(--green); color: var(--green); }
.disc-ell.fail { background: rgba(255,107,154,0.2); border-color: var(--red); color: var(--red); }
.beam-v {
  position: absolute; left: 50%; width: 4px; height: 28px; margin-left: -2px;
  border-radius: 4px; background: #64d2ff; box-shadow: 0 0 12px #64d2ff;
  animation: none; top: 0; opacity: 0;
}
.beam-v.run { opacity: 1; transition: top 350ms linear; }
.headline { margin: 10px 0; }
.headline .big { font-size: 22px; font-weight: 700; }
.headline .sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.layer-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.layer-row .n { font-size: 12px; color: var(--muted); }
.layer-row .v { font-size: 16px; margin-top: 2px; }
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  min-height: var(--tap); margin-top: 12px; color: var(--muted); font-size: 14px;
}

.note {
  margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.4;
  padding: 12px; background: var(--card); border-radius: 12px;
}
.setting-row {
  display: flex; justify-content: space-between; gap: 12px;
  min-height: 40px; align-items: center; font-size: 14px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.setting-row .val { color: var(--muted); font-variant-numeric: tabular-nums; }
.section-label { margin: 18px 0 8px; font-size: 20px; font-weight: 650; }

.tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #1c1c1e; background: rgba(0,0,0,0.92);
  backdrop-filter: blur(14px); flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  min-height: var(--tap); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10px;
}
.tab.active { color: var(--text); }
.tab .ico { font-size: 18px; line-height: 1; }
.back {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--blue); font-size: 17px; padding: 0 2px; margin-left: -4px;
}
