/* STEP 8 · black iOS. No neon, no glow, no double borders, no all-caps eyebrows, no gradients on cards. */
: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;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --textf: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Monaco, monospace;
  --gutter: 16px;
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--textf);
  font-size: 17px; line-height: 1.3; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
.num, .tab-num, input[type=number] { font-variant-numeric: tabular-nums; }
body * { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

#app { min-height: 100vh; }
.screen { padding: calc(var(--sat) + 4px) calc(var(--gutter) + var(--sar)) calc(96px + var(--sab)) calc(var(--gutter) + var(--sal)); }
.screen.push { position: fixed; inset: 0; overflow-y: auto; background: var(--bg); z-index: 20; -webkit-overflow-scrolling: touch; }

/* error banner: 1 row under the navbar, red */
.err-row { color: var(--red); font-size: 13px; line-height: 18px; padding: 6px 0; text-align: center;
  border-bottom: 0.5px solid var(--sep); margin-bottom: 4px; }

/* navbar */
.navbar { display: flex; align-items: center; gap: 4px; height: 52px; }
.navbar .title { font-weight: 600; font-size: 17px; flex: 1; display: flex; align-items: center; gap: 4px; min-height: 44px; }
.navbar .title .chev { color: var(--ter); font-weight: 400; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; position: relative; border-radius: 22px; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.8; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--card2); display: flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: 15px; }
.dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: var(--green); }
.back { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: var(--blue); font-size: 17px; gap: 2px; }
.back svg { width: 13px; height: 21px; stroke: var(--blue); stroke-width: 2.6; fill: none; }
h1.large { font-family: var(--display); font-weight: 700; font-size: 34px; margin: 4px 0 12px; letter-spacing: 0.2px; }

/* balance */
.balance-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.balance { font-family: var(--display); font-weight: 600; font-size: 66px; letter-spacing: -1px; line-height: 1.05;
  display: inline-flex; overflow: hidden; height: 1.08em; }
@media (min-width: 420px) { .balance { font-size: 76px; } }
.odo-ch { display: inline-block; position: relative; height: 1.08em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transition: transform 600ms ease-out; }
.odo-strip span { height: 1.08em; display: block; text-align: center; }
.badge-paper { background: var(--orange); color: #000; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.sub-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--sec); font-size: 17px; }
.pct-up { color: var(--green); } .pct-down { color: var(--red); }
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pill.green { background: rgba(0,211,90,0.16); color: var(--green); }
.pill.red { background: rgba(255,69,58,0.16); color: var(--red); }
.pill.mono { font-family: var(--mono); font-weight: 500; font-size: 13px; }

/* chart */
.chart-wrap { position: relative; margin: 14px calc(-1 * var(--gutter)) 0; height: 230px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--sec); font-size: 15px; }
.ranges { display: flex; justify-content: space-between; margin: 8px 0 18px; }
.ranges button { min-width: 44px; min-height: 44px; border-radius: 22px; font-size: 14px; font-weight: 600; color: var(--sec); }
.ranges button.on { color: var(--green); background: rgba(0,211,90,0.14); }

.section-h { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; min-height: 44px; }
.section-h h2 { font-size: 22px; font-weight: 700; margin: 0; font-family: var(--display); }
.section-h h2 .muted { color: var(--sec); font-weight: 600; }
.section-h a { color: var(--blue); font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; }

/* agent cards: width = viewport - 32px, aspect-ratio 504/470, radius = 42*width/504 (set in JS) */
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter); scrollbar-width: none; scroll-padding: 0 var(--gutter); }
.carousel::-webkit-scrollbar { display: none; }
.acard { flex: 0 0 auto; width: calc(100vw - 32px); aspect-ratio: 504 / 470; background: var(--card);
  border-radius: calc((100vw - 32px) * 42 / 504); scroll-snap-align: start; padding: 22px; display: flex; flex-direction: column;
  overflow: hidden; position: relative; }
.acard .head { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--sec); }
.acard .head b { color: var(--text); font-weight: 600; font-size: 17px; }
.acard .head .sdot { width: 8px; height: 8px; border-radius: 4px; }
.acard .big { font-family: var(--display); font-size: 34px; font-weight: 700; margin: 10px 0 2px; }
.acard .muted { color: var(--sec); font-size: 15px; }
.acard .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--sec); font-size: 15px; gap: 8px; }
.strips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.strip { height: 34px; border-radius: 9px; background: var(--card2); font-size: 11px; color: var(--sec); display: flex;
  align-items: center; justify-content: center; text-align: center; padding: 0 4px; line-height: 1.1; }
.strip.ok { background: rgba(0,211,90,0.18); color: var(--green); }
.strip.bad { background: rgba(255,69,58,0.2); color: var(--red); }
.strip.run { background: rgba(100,210,255,0.18); color: var(--cyan); }
.feed { margin-top: 10px; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.feed .row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 0.5px solid var(--sep); font-size: 14px; }
.feed .row:last-child { border-bottom: 0; }
.feed .row.killed { color: var(--ter); }
.feed .row.killed .n { text-decoration: line-through; text-decoration-color: var(--red); }
.feed .row.killed .r { color: var(--red); white-space: nowrap; }
.feed .row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .row.passed .r { color: var(--cyan); white-space: nowrap; }
.ring { width: 150px; height: 150px; margin: 8px auto 0; display: block; }
.bar { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; margin: 12px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--green); width: 0; border-radius: 4px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }

/* lists */
.list { background: var(--card); border-radius: 12px; overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 60px; position: relative; }
.lrow + .lrow::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.lrow .ic { width: 36px; height: 36px; border-radius: 18px; flex: 0 0 36px; display: flex; align-items: center; justify-content: center; }
.lrow .ic svg { width: 18px; height: 18px; fill: none; stroke-width: 2.2; }
.lrow .main { flex: 1; min-width: 0; }
.lrow .t { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { font-size: 15px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .v { font-size: 17px; text-align: right; white-space: nowrap; }
.lrow .chev { color: var(--ter); font-size: 20px; }
.empty-msg { color: var(--sec); text-align: center; padding: 28px 16px; font-size: 15px; }
.more { display: block; width: 100%; min-height: 44px; color: var(--blue); margin-top: 10px; }

/* skeleton loading: #1c1c1e blocks in the final layout, opacity pulse 0.5 to 1, 1.2s */
.sk { background: var(--card); border-radius: 10px; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* agents tab */
.agent-full { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.agent-full .top { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.agent-full .top b { font-size: 20px; font-family: var(--display); }
.agent-full .top .cnt { color: var(--sec); font-size: 15px; margin-left: auto; }
.status-dot { width: 9px; height: 9px; border-radius: 5px; background: var(--green); }
.status-dot.paused { background: var(--ter); }
.switch { position: relative; width: 51px; height: 31px; flex: 0 0 51px; margin: 6px 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; z-index: 2; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: rgba(120,120,128,0.32); border-radius: 16px; transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; transition: transform 0.2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: 0.4; }
.switch-hit { min-width: 51px; min-height: 44px; display: inline-flex; align-items: center; }
.dec { font-size: 14px; display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; padding: 9px 0; border-top: 0.5px solid var(--sep); align-items: baseline; }
.dec .tm { color: var(--sec); }
.dec .cn a { color: var(--text); }
.dec .rs { color: var(--sec); text-align: right; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dec .vd { color: var(--sec); font-size: 13px; }
.link-btn { color: var(--blue); min-height: 44px; display: inline-flex; align-items: center; font-size: 15px; }

/* auditor screen */
.discs { position: relative; width: 220px; margin: 18px auto 10px; height: 260px; }
.disc { position: absolute; left: 10px; width: 200px; height: 52px; border-radius: 50%; background: var(--card2);
  border: 0.5px solid var(--sep); transition: background 150ms linear; display: flex; align-items: center; justify-content: center; }
.disc.ok { background: rgba(0,211,90,0.85); border-color: transparent; }
.disc.bad { background: rgba(255,69,58,0.9); border-color: transparent; }
.disc.nc { background: #1c1c1e; }
.disc svg { width: 20px; height: 20px; stroke: #000; stroke-width: 3; fill: none; }
.beam { position: absolute; left: 0; width: 220px; height: 3px; background: var(--cyan); border-radius: 2px; transition: top 350ms linear; opacity: 0; }
.verdict-t { font-family: var(--display); font-size: 28px; font-weight: 700; text-align: center; margin: 10px 0 2px; }
.verdict-s { text-align: center; color: var(--sec); margin-bottom: 18px; }
.lv { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; position: relative; }
.lv + .lv::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.lv .n { color: var(--sec); width: 18px; }
.lv .nm { flex: 1; }
.lv .vl { color: var(--sec); text-align: right; }
.lv.ok .vl { color: var(--text); }
.lv.bad .vl { color: var(--red); }
.lv.nc .vl, .lv.nc .nm { color: var(--ter); }
.lv .mk { width: 22px; height: 22px; border-radius: 11px; flex: 0 0 22px; display: flex; align-items: center; justify-content: center; background: var(--card2); }
.lv.ok .mk { background: var(--green); } .lv.bad .mk { background: var(--red); }
.lv .mk svg { width: 12px; height: 12px; stroke: #000; stroke-width: 3; fill: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; min-height: 52px; }
.btn-full { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; border-radius: 14px;
  background: var(--green); color: #000; font-weight: 600; font-size: 17px; margin-top: 18px; }
.btn-full.sell { background: var(--red); color: #fff; }
.sticky-bottom { position: sticky; bottom: calc(10px + var(--sab)); }

/* coin screen */
.coin-head { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.coin-logo { width: 40px; height: 40px; border-radius: 20px; background: var(--card2); object-fit: cover; flex: 0 0 40px; }
.coin-head > div { min-width: 0; flex: 1; }
.coin-head .nm { font-family: var(--display); font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-head .meta { color: var(--sec); font-size: 15px; }
.shield { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; background: rgba(0,211,90,0.16); color: var(--green);
  padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; min-height: 28px; }
.shield.bad { background: rgba(255,69,58,0.16); color: var(--red); }
.shield svg { width: 14px; height: 14px; fill: currentColor; }
.price-big { white-space: nowrap; font-family: var(--display); font-size: 66px; font-weight: 600; letter-spacing: -1px; margin-top: 14px; line-height: 1.05; }
.since { font-size: 17px; margin-top: 4px; }
.candles-wrap { position: relative; height: 260px; margin: 16px calc(-1 * var(--gutter)) 0; }
.candles-wrap canvas { width: 100%; height: 100%; display: block; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--card); border-radius: 12px; margin-top: 16px; }
.stats div { padding: 12px 16px; }
.stats div:nth-child(n+3) { border-top: 0.5px solid var(--sep); }
.stats .k { color: var(--sec); font-size: 13px; } .stats .vv { font-size: 17px; margin-top: 2px; }
.pos-card { background: var(--card); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.pos-card .h { font-weight: 600; }
.exit-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; gap: 8px; }
.exit-grid .k { color: var(--sec); font-size: 13px; } .exit-grid .vv { font-size: 15px; margin-top: 2px; }

/* account */
.seg { display: flex; background: var(--card); border-radius: 9px; padding: 2px; min-height: 44px; }
.seg button { flex: 1; border-radius: 7px; font-weight: 600; font-size: 15px; color: var(--sec); min-height: 40px; }
.seg button.on { background: var(--card2); color: var(--text); }
.group-h { color: var(--sec); font-size: 13px; margin: 22px 16px 6px; }
.set-row { padding: 10px 16px; position: relative; }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.set-row .lab { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.set-row .lab .key { color: var(--ter); font-size: 12px; font-family: var(--mono); }
.set-row .ctl { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.set-row input[type=range] { flex: 1; accent-color: var(--green); min-height: 44px; }
.set-row input[type=number], .set-row input[type=text], .set-row select, .field {
  width: 112px; min-height: 44px; background: var(--card2); color: var(--text); border: 0; border-radius: 9px;
  padding: 0 10px; font: inherit; font-size: 16px; text-align: right; }
.set-row input[type=text] { width: 100%; text-align: left; }
.set-row select { width: 140px; }
.set-row .err { color: var(--red); font-size: 13px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--sab)); transform: translateX(-50%); background: var(--card2);
  padding: 10px 16px; border-radius: 12px; font-size: 15px; z-index: 50; }

/* tab bar, blurred */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around;
  padding: 6px var(--sar) calc(var(--sab) + 4px) var(--sal); background: rgba(22,22,24,0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 0.5px solid var(--sep); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 49px; justify-content: center;
  color: rgba(235,235,245,0.45); font-size: 10px; font-weight: 500; }
.tabbar a svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; }
.tabbar a.on { color: var(--text); }
.search-in { width: 100%; min-height: 44px; background: var(--card); border: 0; border-radius: 10px; color: var(--text); font: inherit; padding: 0 12px; }
.locked { padding-top: 30vh; text-align: center; color: var(--sec); }
.locked h2 { color: var(--text); font-family: var(--display); }

@media (prefers-reduced-motion: reduce) {
  .odo-strip, .beam, .disc, .bar > i, .switch i, .switch i::after { transition: none !important; }
  .sk { animation: none; }
}
