:root {
  --bg: #000;
  --text: #fff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: 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;
  --gutter: 16px;
  --tab-h: 49px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select { font: inherit; color: inherit; }

.screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 52px) 0 calc(env(safe-area-inset-bottom) + var(--tab-h) + 16px);
}
.screen.sub { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 8px;
  min-height: calc(env(safe-area-inset-top) + 44px);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.navbar .title { font-size: 17px; font-weight: 600; flex: 1; }
.avatar, .icon-btn {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  font-size: 16px;
}
.avatar { background: #2c2c2e; font-weight: 600; }
.search-box {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  background: var(--card);
  border: 0;
  padding: 0 12px;
  color: var(--text);
  min-width: 0;
}
.search-box::placeholder { color: var(--tertiary); }
.bell { position: relative; }
.bell .dot {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 4px;
  background: var(--green);
}
.back { width: 44px; height: 44px; display: flex; align-items: center; font-size: 28px; line-height: 1; }

.offline {
  color: var(--red);
  font-size: 13px;
  padding: 8px var(--gutter) 4px;
}

.home-head { padding: 8px var(--gutter) 0; }
.balance-row { display: flex; align-items: flex-start; gap: 10px; }
.odo {
  display: flex;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 66px;
  font-weight: 610;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.odo-col { height: 1em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transition: transform 600ms ease-out; }
.odo-strip span { height: 1em; line-height: 1; display: block; }
.paper-pill {
  display: inline-flex; align-items: center;
  background: var(--orange); color: #000;
  font-size: 12px; font-weight: 700;
  padding: 4px 8px; border-radius: 999px;
  height: 22px; margin-top: 10px;
}
.meta-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.today { font-size: 17px; font-weight: 600; }
.today.up { color: var(--green); }
.today.down { color: var(--red); }
.mult {
  background: rgba(0, 211, 90, 0.16);
  color: var(--green);
  font-size: 13px; font-weight: 700;
  padding: 4px 8px; border-radius: 999px;
}

.chart-wrap { padding: 12px var(--gutter) 0; }
.chart-wrap canvas { width: 100%; height: 180px; display: block; }
.ranges {
  display: flex; justify-content: space-between;
  padding: 10px var(--gutter) 4px;
}
.ranges button {
  min-width: 44px; min-height: 32px;
  color: var(--secondary); font-size: 13px; font-weight: 600;
  border-radius: 8px;
}
.ranges button.on { color: var(--text); background: var(--card); }

.section {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px var(--gutter) 10px;
}
.section h2 { margin: 0; font-size: 20px; font-weight: 700; }
.section .more { color: var(--secondary); font-size: 15px; min-height: 44px; display: flex; align-items: center; }

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 8px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.agent-card {
  width: calc(100vw - 32px);
  aspect-ratio: 504 / 470;
  border-radius: calc(42 * (100vw - 32px) / 504);
  background: var(--card);
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agents-list .agent-card {
  width: 100%;
  aspect-ratio: auto;
  min-height: 0;
  height: auto;
  margin-bottom: 14px;
}
.agents-list { padding: 0 var(--gutter); }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-name { font-size: 20px; font-weight: 700; flex: 1; }
.status-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--green); }
.status-dot.paused { background: var(--tertiary); }
.card-head { font-size: 15px; color: var(--secondary); margin-top: 6px; }
.card-body { flex: 1; margin-top: 10px; min-height: 0; overflow: hidden; }

.feed-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 0; }
.feed-row .killed { color: var(--tertiary); text-decoration: line-through; text-decoration-color: var(--red); }
.feed-row .reason { color: var(--red); font-size: 13px; }
.feed-row .pass { color: var(--cyan); }

.layer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.layer-strip {
  background: var(--card2); border-radius: 8px;
  padding: 7px 8px; font-size: 12px; color: var(--secondary);
  display: flex; justify-content: space-between; gap: 6px;
}
.layer-strip.ok { color: var(--green); }
.layer-strip.no { color: var(--red); }

.score-wrap { display: flex; align-items: center; gap: 16px; height: 100%; }
.score-wrap canvas { width: 120px; height: 120px; }
.score-label { font-size: 15px; color: var(--secondary); }

.size-line { font-size: 18px; font-weight: 600; margin-top: 12px; }
.exec-bar { height: 8px; background: var(--card2); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.exec-bar i { display: block; height: 100%; background: var(--green); width: 100%; }
.pills { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pill {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13px; padding: 6px 10px; border-radius: 999px;
}
.pill.stop { background: rgba(255, 69, 58, 0.16); color: var(--red); }
.pill.trail { background: rgba(0, 211, 90, 0.16); color: var(--green); }

.switch {
  width: 51px; height: 31px; border-radius: 16px;
  background: var(--card2); position: relative;
  pointer-events: none; opacity: 0.85;
}
.switch.on { background: var(--green); }
.switch i {
  position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 14px;
  background: #fff; transition: transform 180ms ease;
}
.switch.on i { transform: translateX(20px); }
.switch-note { font-size: 12px; color: var(--tertiary); margin-top: 6px; }

.decisions { margin-top: 12px; }
.decisions .row {
  display: grid; grid-template-columns: 56px 1fr auto;
  gap: 8px; font-size: 13px; padding: 7px 0;
  border-top: 0.5px solid var(--sep);
}
.decisions .row span:first-child { color: var(--tertiary); }
.decisions .verdict.pass { color: var(--green); }
.decisions .verdict.kill, .decisions .verdict.reject { color: var(--red); }
.settings-jump { color: var(--blue); font-size: 15px; min-height: 44px; display: flex; align-items: center; }

.activity-list { padding: 0 var(--gutter); }
.act-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
  border-bottom: 0.5px solid var(--sep);
  padding: 10px 0;
  width: 100%;
  text-align: left;
}
.act-row .mid { flex: 1; min-width: 0; }
.act-row .title { font-size: 16px; font-weight: 600; }
.act-row .sub { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.act-row .val { font-size: 15px; font-weight: 600; }
.empty { color: var(--secondary); padding: 24px var(--gutter); font-size: 16px; text-align: center; }

.skel {
  background: var(--card);
  border-radius: 12px;
  animation: pulse 1.2s ease-in-out infinite;
}
.skel-balance { height: 66px; width: 70%; margin: 8px var(--gutter); }
.skel-chart { height: 180px; margin: 12px var(--gutter); }
.skel-card { height: 280px; margin: 0 var(--gutter) 12px; border-radius: calc(42 * (100vw - 32px) / 504); }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.audit { padding: 8px var(--gutter) 24px; }
.discs { position: relative; height: 220px; margin: 8px 0 16px; }
.disc {
  position: absolute; left: 50%;
  width: 88px; height: 88px; margin-left: -44px;
  border-radius: 44px;
  background: var(--card2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--tertiary);
  border: 2px solid #3a3a3c;
}
.disc.ok { border-color: var(--green); color: var(--green); background: #0d2216; }
.disc.no { border-color: var(--red); color: var(--red); background: #2a1010; }
.disc.active { border-color: var(--cyan); box-shadow: none; }
.beam {
  position: absolute; left: 50%; width: 4px; margin-left: -2px;
  height: 28px; border-radius: 2px; background: var(--cyan);
  transition: top 350ms ease;
}
.audit-status { text-align: center; margin: 8px 0 18px; }
.audit-status .big { font-size: 22px; font-weight: 700; }
.audit-status .sub { color: var(--secondary); margin-top: 6px; }
.layer-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 0.5px solid var(--sep); font-size: 15px;
}
.layer-row .n { color: var(--tertiary); width: 18px; }
.layer-row .nm { flex: 1; }
.layer-row .ok { color: var(--green); }
.layer-row .no { color: var(--red); }
.fomo-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; border-radius: 14px;
  background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 700;
  margin-top: 20px;
}

.coin { padding: 4px var(--gutter) 24px; }
.coin-sub { color: var(--secondary); font-size: 14px; margin-top: 4px; }
.shield {
  display: inline-flex; align-items: center;
  background: var(--card); color: var(--cyan);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13px; padding: 4px 8px; border-radius: 999px; margin-left: 8px;
}
.coin-price {
  font-family: "SF Pro Display", -apple-system, sans-serif;
  font-size: 40px; font-weight: 610; letter-spacing: -0.02em; margin-top: 14px;
}
.since { color: var(--green); font-size: 15px; font-weight: 600; margin-top: 4px; }
.since.down { color: var(--red); }
.coin-chart canvas { width: 100%; height: 260px; display: block; margin-top: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.stats div { background: var(--card); border-radius: 12px; padding: 12px; }
.stats .k { color: var(--secondary); font-size: 12px; }
.stats .v { font-size: 17px; font-weight: 600; margin-top: 4px; }
.pos-card, .exit-card {
  background: var(--card); border-radius: 14px; padding: 14px; margin-top: 14px;
}
.pos-card h3, .exit-card h3 { margin: 0 0 8px; font-size: 15px; color: var(--secondary); font-weight: 600; }

.account { padding: 8px var(--gutter) 32px; }
.row-link, .setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 52px;
  border-bottom: 0.5px solid var(--sep);
  padding: 10px 0;
}
.row-link .label, .setting-row .label { font-size: 16px; }
.row-link .val, .setting-row .val { color: var(--secondary); font-size: 15px; text-align: right; }
.group { margin-top: 22px; }
.group h3 { margin: 0 0 4px; font-size: 13px; color: var(--secondary); font-weight: 600; }
.mode-seg { display: flex; background: var(--card); border-radius: 10px; padding: 3px; gap: 3px; min-width: 160px; }
.mode-seg span {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 15px;
  color: var(--secondary);
}
.mode-seg span.on { background: #fff; color: #000; }
.setting-row input[type="range"] { width: 120px; accent-color: var(--blue); pointer-events: none; }
.setting-row input[type="number"], .setting-row input[type="text"] {
  width: 88px; background: var(--card); border: 0; border-radius: 8px;
  padding: 8px; text-align: right; pointer-events: none;
}
.note { color: var(--secondary); font-size: 14px; margin-top: 10px; line-height: 1.4; }

.search-panel {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,0.86);
  padding: calc(env(safe-area-inset-top) + 60px) var(--gutter) 24px;
}
.search-hit {
  display: flex; justify-content: space-between;
  padding: 14px 0; border-bottom: 0.5px solid var(--sep);
  width: 100%; text-align: left; min-height: 44px;
}
.search-hit .sym { color: var(--secondary); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(22, 22, 24, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.tabbar button {
  flex: 1; height: var(--tab-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--tertiary); font-size: 10px; font-weight: 500;
}
.tabbar button.on { color: var(--blue); }
.tabbar .ic { font-size: 20px; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; opacity: 0.7; }
  .odo-strip, .beam, .switch i { transition: none; }
}
