/* STEP 8 · black iOS. No neon, no glow, no double borders, no all-caps eyebrows, no gradients on cards. */
:root {
  --bg: #000; --text: #fff; --text2: rgba(235,235,245,0.6); --text3: 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, system-ui, "Helvetica Neue", Arial, sans-serif;
  --textf: "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --g: 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: 15px;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
.num, input, .val, .pill, .odo { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
#app { min-height: 100vh; padding-left: var(--sal); padding-right: var(--sar); }

/* navbar */
#navbar { position: sticky; top: 0; z-index: 20; padding: calc(var(--sat) + 6px) var(--g) 6px; background: rgba(0,0,0,0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  display: flex; align-items: center; gap: 8px; min-height: calc(var(--sat) + 56px); }
#navbar .title { flex: 1; font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; min-width: 0; }
#navbar .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; position: relative; flex: none; }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--card2); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: var(--text); }
.dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 5px; background: var(--green); border: 2px solid #000; }
.back { min-width: 44px; height: 44px; display: inline-flex; align-items: center; color: var(--blue); font-size: 17px; gap: 2px; }
.back svg { width: 13px; height: 22px; stroke: var(--blue); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.searchbox { flex: 1; height: 36px; border-radius: 10px; background: var(--card2); border: 0; color: var(--text); padding: 0 12px; font-size: 16px; outline: none; min-width: 0; }

/* error row (1 row under the navbar) */
.offline { position: sticky; top: calc(var(--sat) + 56px); z-index: 19; color: var(--red); background: #000; font-size: 13px;
  padding: 8px var(--g); border-bottom: 0.5px solid var(--sep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { padding: 0 0 calc(var(--sab) + 84px); }
.gut { padding: 0 var(--g); }
.section-h { display: flex; justify-content: space-between; align-items: center; padding: 22px var(--g) 10px; font-size: 20px; font-weight: 700; }
.section-h a, .section-h button { font-size: 15px; font-weight: 400; color: var(--blue); min-height: 44px; display: inline-flex; align-items: center; }
.big-title { font-size: 34px; font-weight: 700; padding: 4px var(--g) 8px; font-family: var(--display); }

/* balance + odometer */
.balance-row { display: flex; align-items: center; gap: 10px; padding: 6px var(--g) 0; }
.balance { font-family: var(--display); font-size: 66px; font-weight: 600; letter-spacing: -1.5px; line-height: 1.05; }
.odo { display: inline-flex; overflow: hidden; }
.odo .d { display: inline-block; height: 1.05em; overflow: hidden; position: relative; }
.odo .col { display: flex; flex-direction: column; transition: transform 600ms cubic-bezier(.2,.7,.2,1); }
.odo .col span { height: 1.05em; line-height: 1.05em; text-align: center; }
.odo .s { display: inline-block; }
.badge-paper { background: var(--orange); color: #000; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 3px 9px; letter-spacing: .2px; flex: none; }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 6px var(--g) 0; font-size: 17px; }
.up { color: var(--green); } .down { color: var(--red); } .muted { color: var(--text2); } .faint { color: var(--text3); }
.mult { background: rgba(0,211,90,0.16); color: var(--green); border-radius: 999px; padding: 3px 9px; font-size: 15px; font-weight: 600; }

/* chart */
.chart-wrap { position: relative; margin: 14px 0 0; padding: 0 var(--g); }
.chart-wrap canvas { width: 100%; height: 240px; display: block; }
.chart-empty { position: absolute; left: 0; right: 0; top: 45%; text-align: center; color: var(--text2); font-size: 15px; pointer-events: none; }
.ranges { display: flex; justify-content: space-between; padding: 8px var(--g) 0; }
.ranges button { min-width: 44px; height: 44px; border-radius: 10px; color: var(--text2); font-weight: 600; font-size: 14px; }
.ranges button.on { background: var(--card); color: var(--green); }
.ranges button.live.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: var(--green); margin-right: 5px; vertical-align: 2px; }

/* carousel + agent cards */
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--g); scroll-padding: 0 var(--g); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.acard { flex: none; width: calc(100vw - 32px); max-width: 504px; aspect-ratio: 504 / 470; background: var(--card); scroll-snap-align: start;
  border-radius: calc(min(100vw - 32px, 504px) * 42 / 504);
  padding: 20px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.acard .hd { display: flex; justify-content: space-between; align-items: flex-start; }
.acard .name { font-size: 15px; color: var(--text2); font-weight: 600; }
.acard .count { font-family: var(--display); font-size: 30px; font-weight: 700; margin-top: 4px; }
.acard .body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; margin-top: 8px; }
.acard .foot { color: var(--text2); font-size: 14px; margin-top: 10px; }
.sdot { width: 8px; height: 8px; border-radius: 4px; background: var(--green); display: inline-block; margin-right: 6px; }
.sdot.off { background: var(--text3); }
.strips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.strip { height: 30px; border-radius: 8px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text2); }
.strip.ok { background: rgba(0,211,90,0.18); color: var(--green); } .strip.bad { background: rgba(255,69,58,0.2); color: var(--red); }
.statusline { font-size: 16px; font-weight: 600; margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.feed li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 0.5px solid var(--sep); }
.feed li:last-child { border-bottom: 0; }
.feed .k { color: var(--text3); text-decoration: line-through; text-decoration-color: var(--red); }
.feed .r { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .p { color: var(--cyan); }
.ring { width: 132px; height: 132px; align-self: center; }
.bar { height: 10px; border-radius: 5px; background: var(--card2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--green); width: 0; border-radius: 5px; }
.pills { display: flex; gap: 8px; margin-top: 12px; }
.pill { font-family: var(--mono); font-size: 14px; border-radius: 999px; padding: 6px 12px; }
.pill.red { color: var(--red); background: rgba(255,69,58,0.16); } .pill.green { color: var(--green); background: rgba(0,211,90,0.16); }
.emptytxt { color: var(--text2); font-size: 15px; text-align: center; padding: 18px 0; }

/* lists */
.list { margin: 0 var(--g); background: var(--card); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 0.5px solid var(--sep); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .ic { width: 36px; height: 36px; border-radius: 18px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.row .mid { flex: 1; min-width: 0; }
.row .t { font-size: 16px; overflow-wrap: anywhere; }
.row .st { font-size: 13px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rv { text-align: right; font-size: 14px; max-width: 46%; flex: none; }
.chev { color: var(--text3); font-size: 20px; }
.ic.bought { background: rgba(10,132,255,0.18); color: var(--blue); } .ic.sold { background: rgba(0,211,90,0.18); color: var(--green); }
.ic.stopped { background: rgba(255,69,58,0.2); color: var(--red); } .ic.rejected { background: var(--card2); color: var(--text2); }
.more { display: block; width: calc(100% - 32px); margin: 12px var(--g); min-height: 44px; border-radius: 12px; background: var(--card); color: var(--blue); }

/* agents tab */
.fcard { margin: 0 var(--g) 14px; background: var(--card); border-radius: 18px; padding: 16px; }
.fcard .hd { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.fcard .nm { font-size: 20px; font-weight: 700; display: flex; align-items: center; }
.fcard .meta { color: var(--text2); font-size: 14px; margin: 2px 0 8px; display: flex; justify-content: space-between; align-items: center; }
.fcard .meta button { color: var(--blue); min-height: 44px; }
.dec { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.dec li { 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(--text3); } .dec .why { color: var(--text2); grid-column: 2 / 4; font-size: 13px; margin-top: -4px; }
.dec .v.pass { color: var(--green); } .dec .v.fail { color: var(--red); }

/* switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--card2); transition: background 200ms; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; transition: transform 200ms; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .45; }
.tap44 { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* auditor screen */
.aud-head { padding: 6px var(--g) 0; }
.aud-head .nm { font-family: var(--display); font-size: 28px; font-weight: 700; }
.discs { position: relative; width: 220px; margin: 18px auto 8px; height: 250px; }
.disc { position: absolute; left: 10px; width: 200px; height: 46px; border-radius: 50%; background: var(--card2);
  display: flex; align-items: center; justify-content: center; transition: background 150ms, color 150ms; color: var(--text3); font-weight: 700; }
.disc.ok { background: #0d3a22; color: var(--green); } .disc.bad { background: #4a1714; color: var(--red); }
.disc svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.beam { position: absolute; left: 0; width: 220px; height: 3px; border-radius: 2px; background: var(--cyan); transition: top 350ms linear; opacity: 0; }
.beam.on { opacity: 1; }
.vrows .row { min-height: 50px; }
.vrows .row .t { font-size: 15px; color: var(--text2); }
.vrows .row .rv { color: var(--text); max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.vrows .row .rv.nc { color: var(--text3); }
.verdict { margin: 16px var(--g) 0; }
.verdict .h { font-size: 22px; font-weight: 700; } .verdict .s { color: var(--text2); margin-top: 4px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px 16px; border-bottom: 0.5px solid var(--sep); }
.setrow:last-child { border-bottom: 0; }

/* coin screen */
.coin-head { padding: 4px var(--g) 0; }
.coin-head .l1 { display: flex; align-items: center; gap: 8px; }
.coin-head .nm { font-family: var(--display); font-size: 28px; font-weight: 700; }
.logo { width: 36px; height: 36px; border-radius: 18px; background: var(--card2); object-fit: cover; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--green); background: rgba(0,211,90,0.16); border-radius: 999px; padding: 3px 9px; }
.chip svg { width: 13px; height: 13px; fill: currentColor; }
.price { font-family: var(--display); font-size: 66px; font-weight: 600; letter-spacing: -1.5px; padding: 6px var(--g) 0; line-height: 1.05; }
.candles { padding: 12px var(--g) 0; }
.candles canvas { width: 100%; height: 280px; display: block; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 16px var(--g) 0; background: var(--sep); border-radius: 14px; overflow: hidden; }
.stats > div { background: var(--card); padding: 12px 16px; }
.stats .k { font-size: 13px; color: var(--text2); } .stats .v { font-size: 18px; font-weight: 600; margin-top: 3px; }
.card { margin: 14px var(--g) 0; background: var(--card); border-radius: 14px; padding: 14px 16px; }
.card .k { color: var(--text2); font-size: 13px; }
.card .line { display: flex; justify-content: space-between; padding: 8px 0; border-top: 0.5px solid var(--sep); font-size: 15px; }
.card .line:first-of-type { border-top: 0; }
.cta { position: fixed; left: var(--g); right: var(--g); bottom: calc(var(--sab) + 66px); z-index: 15; display: block; text-align: center;
  height: 52px; line-height: 52px; border-radius: 14px; background: var(--green); color: #000; font-weight: 700; font-size: 17px; }
.cta.sell { background: var(--red); color: #fff; }
.cta-pad { height: 76px; }

/* account */
.seg { display: inline-flex; background: var(--card2); border-radius: 9px; padding: 2px; }
.seg button { min-width: 72px; min-height: 40px; border-radius: 7px; color: var(--text2); font-weight: 600; font-size: 14px; }
.seg button.on { background: #636366; color: var(--text); }
.field { width: 110px; height: 36px; border-radius: 9px; border: 0; background: var(--card2); color: var(--text); text-align: right; padding: 0 10px; font-size: 16px; outline: none; }
.field.wide { width: 170px; }
.slrow { padding: 10px 16px; border-bottom: 0.5px solid var(--sep); }
.slrow:last-child { border-bottom: 0; }
.slrow .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slrow .lb { font-size: 15px; } .slrow .rg { font-size: 12px; color: var(--text3); }
input[type=range] { width: 100%; height: 44px; -webkit-appearance: none; appearance: none; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--card2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 14px; background: #fff; margin-top: -12px; }
.grp-h { padding: 22px var(--g) 8px; color: var(--text2); font-size: 14px; }
.note { color: var(--text3); font-size: 13px; padding: 8px var(--g) 0; }
.linkrow { color: var(--text); }
.linkrow .rv { color: var(--blue); }

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

/* tab bar, blurred */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px var(--sar) calc(var(--sab) + 6px) 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 button { flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text3); font-size: 10px; font-weight: 500; }
#tabbar svg { width: 25px; height: 25px; fill: currentColor; stroke: currentColor; stroke-width: 0; }
#tabbar button[data-tab=activity] svg { fill: none; stroke-width: 2.2; }
#tabbar button.on { color: var(--blue); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 140px); z-index: 50; background: var(--card2);
  color: var(--text); padding: 12px 16px; border-radius: 14px; font-size: 15px; max-width: calc(100vw - 32px); text-align: center; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 60; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-radius: 14px 14px 0 0; padding: 20px var(--g) calc(var(--sab) + 20px); }
.sheet h3 { margin: 0 0 6px; font-size: 18px; } .sheet p { margin: 0 0 14px; color: var(--text2); }
.sheet .btns { display: flex; gap: 10px; } .sheet .btns button { flex: 1; min-height: 50px; border-radius: 12px; background: var(--card2); font-weight: 600; font-size: 16px; }
.sheet .btns .danger { color: var(--red); } .sheet .btns .primary { background: var(--blue); }
.sheet input { width: 100%; height: 46px; border-radius: 10px; border: 0; background: var(--card2); color: #fff; font-size: 17px; padding: 0 12px; margin-bottom: 14px; outline: none; }
.results { margin: 8px var(--g) 0; }

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