/* STEP 10 look: 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; --purple: #bf5af2;
  --g: 16px;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --display: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --textf: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}
* { 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;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body { min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.num, .tab-num, input[type=number] { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

main { padding: calc(var(--st) + 0px) calc(var(--g) + var(--sr)) calc(96px + var(--sb)) calc(var(--g) + var(--sl)); }

/* error row under the navbar */
.offline { position: sticky; top: calc(var(--st)); z-index: 30; background: var(--red); color: #fff; font-size: 13px;
  padding: 8px var(--g); font-variant-numeric: tabular-nums; }

/* navbar */
.navbar { display: flex; align-items: center; gap: 12px; height: 52px; position: sticky; top: var(--st); z-index: 20;
  background: rgba(0,0,0,0.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  margin: 0 calc(-1 * var(--g)); padding: 0 var(--g); }
.navbar .title { font-weight: 600; font-size: 17px; flex: 1; min-height: 44px; display: flex; align-items: center; }
.navbar .title .chev { color: var(--ter); margin-left: 4px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; position: relative; flex: none; }
.icon-btn svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--card2); display: grid; place-items: center;
  font-weight: 600; font-size: 14px; color: var(--sec); }
.bell-dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 4px; background: var(--red); }
.back { color: var(--blue); font-size: 17px; min-width: 44px; min-height: 44px; display: flex; align-items: center; gap: 2px; }
.page-title { font-family: var(--display); font-weight: 700; font-size: 34px; margin: 4px 0 12px; }

/* balance */
.balance-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.balance { font-family: var(--display); font-weight: 600; font-size: 66px; line-height: 1; letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums; display: inline-flex; overflow: hidden; }
.paper { font-family: var(--textf); font-size: 12px; font-weight: 600; color: #000; background: var(--orange);
  border-radius: 10px; padding: 3px 8px; letter-spacing: 0.2px; flex: none; }
.today { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.mult { background: rgba(0,211,90,0.16); color: var(--green); font-weight: 600; border-radius: 10px; padding: 2px 8px; font-size: 13px; }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--sec); }

/* odometer */
.odo { display: inline-flex; }
.odo .d { display: inline-block; height: 1em; overflow: hidden; position: relative; }
.odo .d .col { display: flex; flex-direction: column; transition: transform 600ms cubic-bezier(.2,.7,.2,1); }
.odo .d .col span { height: 1em; line-height: 1em; display: block; text-align: center; }
.odo .s { display: inline-block; height: 1em; line-height: 1em; }
@media (prefers-reduced-motion: reduce) { .odo .d .col { transition: none !important; } .pulse { animation: none !important; } }

/* charts */
.chart-wrap { position: relative; margin: 8px calc(-1 * var(--g)) 0; height: 230px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.ranges { display: flex; justify-content: space-between; margin: 8px 0 18px; }
.ranges button { min-width: 44px; min-height: 44px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--sec); font-variant-numeric: tabular-nums; }
.ranges button.on { color: #000; background: var(--green); min-height: 30px; align-self: center; padding: 6px 10px; }

/* live screen card */
.live { position: relative; border-radius: 22px; overflow: hidden; background: var(--card); aspect-ratio: 16 / 9; }
.live img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.live img.show { opacity: 1; }
.live .tl, .live .tr { position: absolute; top: 10px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,0.62);
  border-radius: 12px; padding: 4px 9px; display: flex; align-items: center; gap: 6px; }
.live .tl { left: 10px; } .live .tr { right: 10px; }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; display: inline-block; }
.dot.red { background: var(--red); } .dot.grey { background: #8e8e93; } .dot.green { background: var(--green); } .dot.orange { background: var(--orange); }
.live .private { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sec); font-size: 15px; }
.last-order { display: flex; align-items: center; gap: 8px; padding: 10px 2px 0; font-size: 14px; color: var(--sec); font-variant-numeric: tabular-nums; }
.checks { display: inline-flex; gap: 4px; margin-left: auto; }
.chk { font-size: 11px; color: var(--ter); display: inline-flex; align-items: center; gap: 2px; }
.chk.ok { color: var(--green); } .chk.bad { color: var(--red); }

/* sections */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.sec-h h2 { font-size: 20px; font-weight: 700; margin: 0; font-family: var(--display); }
.sec-h .link { color: var(--blue); font-size: 15px; min-height: 44px; display: flex; align-items: center; }

/* carousel */
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--g));
  padding: 0 var(--g); scroll-padding: 0 var(--g); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.bcard { scroll-snap-align: start; flex: 0 0 78%; background: var(--card); border-radius: 18px; padding: 14px; min-height: 178px; }
.bcard .bh { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bcard .bh .count { margin-left: auto; color: var(--sec); font-weight: 400; font-variant-numeric: tabular-nums; }
.bcard .head { font-family: var(--display); font-size: 22px; font-weight: 600; margin: 8px 0; font-variant-numeric: tabular-nums; }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.feed li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 0.5px solid var(--sep); }
.feed li:first-child { border-top: 0; }
.feed .killed .sym { color: #8e8e93; text-decoration: line-through; text-decoration-color: var(--red); }
.feed .why { color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .pass { color: var(--green); }
.strips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0; }
.strip { height: 6px; border-radius: 3px; background: var(--card2); }
.strip.ok { background: var(--green); } .strip.bad { background: var(--red); }
.ring { width: 64px; height: 64px; flex: none; }
.row-flex { display: flex; align-items: center; gap: 12px; }
.bar { background: var(--card2); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-top: 8px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-family: var(--mono); font-size: 12px; border-radius: 8px; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.pill.red { color: var(--red); background: rgba(255,69,58,0.15); } .pill.green { color: var(--green); background: rgba(0,211,90,0.15); }
.muted { color: var(--sec); } .ter { color: var(--ter); } .small { font-size: 13px; }

/* list rows (activity, decisions, settings) */
.list { background: var(--card); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-height: 56px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .st { color: var(--sec); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fomo-btn { font-size: 12px; font-weight: 600; color: var(--blue); background: rgba(10,132,255,0.14); border-radius: 12px;
  padding: 0 10px; min-height: 30px; display: inline-flex; align-items: center; white-space: nowrap; }
.fomo-btn.tap { min-height: 44px; min-width: 44px; justify-content: center; background: none; padding: 0 4px; }
.fomo-btn.tap span { background: rgba(10,132,255,0.14); border-radius: 12px; padding: 6px 10px; }
.empty { color: var(--sec); text-align: center; padding: 28px 12px; background: var(--card); border-radius: 14px; }
.more { width: 100%; min-height: 44px; color: var(--blue); }

/* loading skeletons */
.sk { background: var(--card); border-radius: 12px; }
.pulse { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* bots tab */
.bigcard { background: var(--card); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.bigcard .bh { display: flex; align-items: center; gap: 10px; }
.bigcard .bh .name { font-weight: 600; font-size: 17px; }
.bigcard .bh .meta { color: var(--sec); font-size: 13px; font-variant-numeric: tabular-nums; }
.bigcard .bh .sp { flex: 1; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; z-index: 1; cursor: pointer; }
.switch .tr { position: absolute; inset: 0; border-radius: 16px; background: #39393d; transition: background 200ms; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; transition: transform 200ms; }
.switch input:checked + .tr { background: var(--green); }
.switch input:checked + .tr::after { transform: translateX(20px); }
.switch input:disabled + .tr { opacity: 0.4; }
.switch-wrap { min-width: 51px; min-height: 44px; display: flex; align-items: center; }
.dec { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; max-height: 260px; overflow-y: auto; }
.dec li { display: flex; align-items: center; gap: 8px; border-top: 0.5px solid var(--sep); min-height: 44px; }
.dec .coin { color: var(--blue); min-height: 44px; display: flex; align-items: center; font-weight: 500; }
.dec .r { flex: 1; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec .tm { color: var(--ter); font-variant-numeric: tabular-nums; }
.settings-link { color: var(--blue); min-height: 44px; display: inline-flex; align-items: center; margin-top: 4px; }

/* coin + audit */
.coin-head { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.coin-head h1 { font-family: var(--display); font-size: 28px; margin: 0; font-weight: 700; }
.shield { font-family: var(--mono); font-size: 12px; border-radius: 8px; padding: 3px 8px; background: var(--card2); }
.shield.ok { color: var(--green); } .shield.bad { color: var(--red); }
.price { font-family: var(--display); font-size: 66px; font-weight: 600; letter-spacing: -1.5px; line-height: 1.05; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--card); border-radius: 14px; padding: 10px 12px; }
.stat .k { color: var(--sec); font-size: 12px; } .stat .vv { font-size: 16px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btn { flex: 1; min-height: 50px; border-radius: 14px; font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.btn.blue { background: var(--blue); } .btn.grey { background: var(--card2); } .btn.red { background: var(--red); }
.btn:disabled { opacity: 0.4; }
.discs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; justify-items: center; margin: 18px 0; position: relative; }
.disc { width: 64px; height: 64px; border-radius: 32px; background: var(--card); display: grid; place-items: center; position: relative;
  font-size: 13px; color: var(--sec); transition: background 250ms; }
.disc.ok { background: rgba(0,211,90,0.18); color: var(--green); } .disc.bad { background: rgba(255,69,58,0.18); color: var(--red); }
.disc.na { color: var(--ter); }
.disc.reading { box-shadow: inset 0 0 0 2px var(--cyan); }
.disc svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.beam { position: absolute; height: 2px; background: var(--cyan); left: 0; top: 0; width: 0; border-radius: 1px; transition: all 300ms ease-out; }

/* account */
.seg { display: flex; background: var(--card); border-radius: 10px; padding: 2px; }
.seg button { flex: 1; min-height: 40px; border-radius: 8px; font-weight: 600; color: var(--sec); }
.seg button.on { background: var(--card2); color: #fff; }
.seg button.on.paper { color: var(--orange); }
.group-h { color: var(--sec); font-size: 13px; margin: 22px 4px 6px; }
.set { padding: 10px 14px; position: relative; }
.set + .set::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.set .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set .nm { font-size: 14px; }
.set input[type=number], .set input[type=text], .set input[type=time], .field { background: var(--card2); color: #fff; border: 0; border-radius: 8px;
  padding: 0 8px; height: 36px; width: 104px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; }
.set input[type=text] { width: 100%; text-align: left; margin-top: 6px; }
.set input[type=time] { width: 120px; text-align: left; color-scheme: dark; }
.set input[type=range] { width: 100%; accent-color: var(--green); height: 32px; margin: 4px 0 0; }
.set .err { color: var(--red); font-size: 12px; margin-top: 2px; }
.set .seg { margin-top: 8px; }
.linkrow { color: #fff; }
.linkrow .chev { color: var(--ter); }

/* sheets, full screen */
.screen { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto;
  padding: var(--st) calc(var(--g) + var(--sr)) calc(40px + var(--sb)) calc(var(--g) + var(--sl)); animation: slidein 250ms ease-out; }
@keyframes slidein { from { transform: translateX(30%); opacity: 0.4; } to { transform: none; opacity: 1; } }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 60; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--card); border-radius: 14px 14px 0 0;
  padding: 10px var(--g) calc(20px + var(--sb)); animation: up 250ms ease-out;
  max-height: 88vh; display: flex; flex-direction: column; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: #48484a; margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 17px; text-align: center; }
.sheet .opts { display: flex; gap: 10px; margin-bottom: 14px; }
.sheet .opts button { flex: 1; min-height: 50px; border-radius: 12px; background: var(--card2); font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet .opts button.on { background: #fff; color: #000; }
.sheet input.field { width: 100%; text-align: left; height: 44px; margin-bottom: 12px; font-size: 17px; }
.full { position: fixed; inset: 0; background: #000; z-index: 70; display: flex; flex-direction: column; }
.full .bar-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--st) + 4px) var(--g) 4px; }
.full .stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom pan-x pan-y; }
.full .stage img { max-width: 100%; max-height: 100%; }
.full .bot-bar { padding: 8px var(--g) calc(12px + var(--sb)); display: flex; gap: 10px; }

/* search */
.search-in { width: 100%; height: 40px; border-radius: 10px; background: var(--card); border: 0; color: #fff; padding: 0 12px; font: inherit; font-size: 17px; }

/* tab bar (blurred) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px var(--sr) calc(6px + var(--sb)) var(--sl); background: rgba(22,22,24,0.78);
  -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: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #8e8e93; font-size: 10px; font-weight: 500; }
.tabbar button svg { width: 25px; height: 25px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: #fff; }

/* first-run token entry */
.gate { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 8px; }
.gate h1 { font-family: var(--display); font-size: 34px; margin: 0; }
.gate p { color: var(--sec); margin: 0; line-height: 1.4; }
.gate input { width: 100%; height: 50px; border-radius: 12px; background: var(--card); border: 0; color: #fff; padding: 0 14px; font: inherit; font-size: 17px; }
.gate .err { color: var(--red); font-size: 14px; min-height: 18px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sb)); transform: translateX(-50%); z-index: 90; background: var(--card2);
  color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 86%; text-align: center; }
.gate .btn { flex: none; }
.gate { padding-top: var(--st); }

/* presets (Account tab) */
.preset-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-btns button { min-height: 44px; border-radius: 12px; background: var(--card2); font-weight: 600; font-size: 14px; padding: 8px 6px; color: #fff; }
.preset-diff { flex: 1; min-height: 0; overflow-y: auto; margin: 0 0 12px; -webkit-overflow-scrolling: touch; }
.preset-diff .pd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 0.5px solid rgba(84,84,88,0.45); font-size: 15px; }
.preset-diff .pd-row .nm { color: var(--text); }
.preset-diff .pd-row .old { color: var(--ter); }
.preset-diff .pd-row .new { font-variant-numeric: tabular-nums; }
.preset-diff .pd-row.same { opacity: 0.4; }

.sheet .btn { flex-shrink: 0; }
