/* STEP 8 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;
  --display: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --textf: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 16px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { 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;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
.num, .odometer, .value, .pill, .stat b, td, .price { font-variant-numeric: tabular-nums; }
.tap { min-width: 44px; min-height: 44px; }
[hidden] { display: none !important; }

.screen { padding: calc(var(--sat)) calc(var(--gutter) + var(--sar)) calc(96px + var(--sab)) calc(var(--gutter) + var(--sal));
  min-height: 100vh; }
.navbar { display: flex; align-items: center; gap: 4px; height: 52px; position: sticky; top: 0; z-index: 5;
  background: rgba(0,0,0,0.82); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.navbar h1 { font-family: var(--display); font-size: 34px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.navbar.plain { height: 56px; }
.nav-title { flex: 1; font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 4px; padding-left: 6px; }
.nav-title .chev { color: var(--sec); font-size: 20px; }
.nav-center { flex: 1; text-align: center; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; position: relative; }
.avatar::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card2) center/60% no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='%23ebebf599'/%3E%3Cpath d='M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8' fill='%23ebebf599'/%3E%3C/svg%3E"); }
.icon { width: 44px; height: 44px; display: grid; place-items: center; position: relative; }
.bell .dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.back { font-size: 34px; line-height: 1; color: var(--blue); width: 44px; text-align: left; }

.offline { position: fixed; top: calc(52px + var(--sat)); left: 0; right: 0; z-index: 20; background: var(--card);
  color: var(--red); font-size: 13px; padding: 8px var(--gutter); border-bottom: 1px solid var(--sep); }

.search { margin: 4px 0 8px; }
.search input { width: 100%; height: 44px; border-radius: 12px; border: 0; background: var(--card); padding: 0 14px; outline: none; }

.balance-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.big { font-family: var(--display); font-size: 66px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.paper-badge { background: var(--orange); color: #000; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.sub-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.today { font-size: 17px; font-weight: 600; }
.today.up { color: var(--green); } .today.down { color: var(--red); }
.pill { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 9px; display: inline-block; }
.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); }

.odometer { display: inline-flex; overflow: hidden; }
.odometer .d { display: inline-block; height: 1.05em; overflow: hidden; position: relative; }
.odometer .d .roll { display: flex; flex-direction: column; transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.odometer .d .roll span { height: 1.05em; line-height: 1.05em; }

.chart-wrap { position: relative; margin: 14px calc(-1 * var(--gutter)) 0; height: 230px; }
.chart { width: 100%; height: 100%; display: block; }
.chart-empty { position: absolute; left: 0; right: 0; top: 46%; text-align: center; color: var(--sec); font-size: 15px; }
.ranges { display: flex; justify-content: space-between; margin: 6px 0 10px; }
.ranges button { color: var(--sec); font-size: 15px; font-weight: 600; border-radius: 999px; padding: 0 12px; }
.ranges button.on { color: var(--text); background: var(--card); }

.section { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 22px 0 10px; }
.section.row { display: flex; justify-content: space-between; align-items: center; }
.link { color: var(--blue); font-size: 17px; font-weight: 400; }

.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.acard { flex: 0 0 auto; width: calc(100vw - 32px); aspect-ratio: 504 / 470; background: var(--card); scroll-snap-align: start;
  padding: 20px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: calc((100vw - 32px) * 42 / 504); /* radius = 42*width/504 */ }
.acard .head { display: flex; align-items: center; justify-content: space-between; }
.acard .name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.acard .big2 { font-family: var(--display); font-size: 34px; font-weight: 700; margin-top: 10px; }
.acard .muted { color: var(--sec); font-size: 15px; }
.acard .body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 0; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.sdot.paused { background: var(--ter); } .sdot.down { background: var(--red); }
.strips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strip { height: 22px; border-radius: 6px; background: var(--card2); }
.strip.ok { background: var(--green); } .strip.bad { background: var(--red); }
.feed { display: flex; flex-direction: column; gap: 6px; font-size: 15px; overflow: hidden; }
.feed .k { color: var(--ter); text-decoration: line-through; text-decoration-color: var(--red); }
.feed .why { color: var(--red); font-size: 13px; margin-left: 6px; text-decoration: none; display: inline-block; }
.feed .p { color: var(--text); } .feed .p .to { color: var(--cyan); margin-left: 6px; }
.ring { width: 120px; height: 120px; align-self: center; }
.bar { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); transition: width 300ms ease-out; }

.list .row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border-bottom: 0.5px solid var(--sep); width: 100%; text-align: left; }
.list .row:last-child { border-bottom: 0; }
.list .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; flex: 0 0 36px; background: var(--card2); }
.list .ic.bought { color: var(--blue); } .list .ic.sold { color: var(--green); } .list .ic.stopped { color: var(--red); } .list .ic.rejected { color: var(--sec); }
.list .mid { flex: 1; min-width: 0; }
.list .t { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { font-size: 15px; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .v { font-size: 15px; text-align: right; white-space: nowrap; }
.v.up { color: var(--green); } .v.down { color: var(--red); } .v.muted { color: var(--sec); }
.empty { color: var(--sec); text-align: center; padding: 36px 0; font-size: 15px; }

.card { background: var(--card); border-radius: 14px; padding: 16px; margin: 12px 0; }
.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.agent-full .top { display: flex; align-items: center; gap: 10px; }
.agent-full .top .nm { font-size: 20px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.agent-full .cnt { color: var(--sec); font-size: 15px; }
.dec { font-size: 15px; }
.dec .row { min-height: 48px; }
.switch { width: 51px; height: 31px; border-radius: 999px; background: var(--card2); position: relative; transition: background 200ms; flex: 0 0 51px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform 200ms; }
.switch.on { background: var(--green); } .switch.on::after { transform: translateX(20px); }
.switch[disabled] { opacity: 0.4; }
.swrap { min-width: 51px; min-height: 44px; display: grid; place-items: center; }

.btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border-radius: 14px;
  background: var(--green); color: #000; font-weight: 600; font-size: 17px; text-decoration: none; margin: 16px 0; }
.btn.secondary { background: var(--card); color: var(--text); }
.btn.blue { background: var(--blue); color: #fff; }

/* coin */
.coin-head { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.coin-head .nm { font-family: var(--display); font-size: 28px; font-weight: 700; }
.chip { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 9px; background: var(--card2); }
.chip.ok { color: var(--green); background: rgba(0,211,90,0.16); } .chip.bad { color: var(--red); background: rgba(255,69,58,0.16); }
.coin-sub { color: var(--sec); font-size: 15px; margin-top: 2px; }
.price { font-family: var(--display); font-size: 48px; font-weight: 700; margin-top: 10px; letter-spacing: -0.02em; }
.since { font-size: 17px; font-weight: 600; }
.since.up { color: var(--green); } .since.down { color: var(--red); }
.candles-wrap { position: relative; height: 280px; margin: 12px calc(-1 * var(--gutter)) 0; }
.legend { color: var(--orange); font-size: 13px; margin-top: 4px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.stat { padding: 12px 0; border-bottom: 0.5px solid var(--sep); }
.stat span { display: block; color: var(--sec); font-size: 13px; } .stat b { font-size: 17px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 0.5px solid var(--sep); font-size: 15px; }
.kv:last-child { border-bottom: 0; } .kv span:first-child { color: var(--sec); }

/* auditor */
.discs { position: relative; margin: 18px auto 8px; width: 240px; }
.disc { height: 30px; border-radius: 50%/14px; background: var(--card2); margin-top: -8px; position: relative;
  transition: background 150ms ease-out; display: grid; place-items: center; font-size: 13px; color: var(--sec); }
.disc:first-child { margin-top: 0; }
.disc.ok { background: rgba(0,211,90,0.85); color: #000; } .disc.bad { background: rgba(255,69,58,0.9); color: #000; }
.beam { position: absolute; left: -10px; right: -10px; height: 4px; border-radius: 2px; background: var(--cyan); top: 0;
  transition: top 350ms linear; }
.lrow { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 0.5px solid var(--sep); }
.lrow:last-child { border-bottom: 0; }
.lrow .ck { width: 22px; text-align: center; font-weight: 700; } .lrow .ck.ok { color: var(--green); } .lrow .ck.bad { color: var(--red); }
.lrow .ln { flex: 1; color: var(--sec); font-size: 15px; } .lrow .lv { font-size: 15px; text-align: right; max-width: 55%; }
.verdict { font-family: var(--display); font-size: 22px; font-weight: 700; margin-top: 6px; }
.verdict.ok { color: var(--green); } .verdict.bad { color: var(--red); }

/* account / settings */
.group-title { color: var(--sec); font-size: 13px; margin: 22px 4px 6px; }
.cell { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; border-bottom: 0.5px solid var(--sep); width: 100%; text-align: left; text-decoration: none; color: var(--text); }
.cell:last-child { border-bottom: 0; } .cell .grow { flex: 1; min-width: 0; } .cell .muted { color: var(--sec); font-size: 15px; }
.cell .chev { color: var(--ter); font-size: 20px; }
.seg { display: flex; background: var(--card2); border-radius: 9px; padding: 2px; }
.seg button { min-height: 40px; padding: 0 16px; border-radius: 7px; font-weight: 600; font-size: 15px; color: var(--sec); }
.seg button.on { background: #636366; color: #fff; }
.setting { padding: 10px 0; border-bottom: 0.5px solid var(--sep); }
.setting:last-child { border-bottom: 0; }
.setting .lab { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.setting .lab code { font-family: var(--mono); font-size: 12px; color: var(--ter); }
.setting .ctl { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.setting input[type=range] { flex: 1; accent-color: var(--green); height: 44px; }
.setting input[type=number], .setting input[type=text], .field { width: 110px; height: 36px; border-radius: 8px; border: 0; background: var(--card2); padding: 0 10px; text-align: right; }
.setting input[type=text] { width: 100%; text-align: left; }
.setting .err { color: var(--red); font-size: 13px; margin-top: 4px; }
.small { font-size: 13px; color: var(--sec); }

/* sheets / toast */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; display: flex; align-items: flex-end; }
.sheet .panel { background: var(--card); width: 100%; border-radius: 14px 14px 0 0; padding: 20px var(--gutter) calc(20px + var(--sab)); }
.sheet .panel h3 { margin: 0 0 8px; font-size: 20px; }
.sheet input { width: 100%; height: 48px; border-radius: 10px; border: 0; background: var(--card2); padding: 0 12px; font-family: var(--mono); font-size: 20px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--sab)); transform: translateX(-50%); background: var(--card2); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 15px; z-index: 50; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 4px var(--sar) calc(4px + var(--sab)) var(--sal); background: rgba(22,22,24,0.8);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-top: 0.5px solid var(--sep); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ter); font-size: 10px; font-weight: 500; padding-top: 4px; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tab.on { color: var(--text); }

/* loading skeleton */
.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; } }
.fade-in { animation: fadein 200ms ease-out both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .odometer .d .roll, .beam, .disc, .bar > i, .switch, .switch::after { transition: none !important; }
  .sk { animation: none; opacity: 0.75; }
  .fade-in { animation: none; }
}
a.clink { color: var(--text); text-decoration: none; }
a.clink:active { opacity: 0.6; }
/* error row sits under the navbar and pushes the content down (never covers the numbers) */
body.has-banner .screen > .navbar { margin-bottom: 34px; }
.cell[disabled] { opacity: 0.4; }

.navbar.plain .paper-badge { margin-left: auto; }   /* STEP 11: every screen shows PAPER */

/* lock screen (no token in this app's storage) */
.lock-screen { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--sat)) var(--gutter) calc(24px + var(--sab)); }
.lock-panel { width: 100%; max-width: 420px; }
.lock-panel h1 { font-size: 34px; margin: 0 0 8px; }
.lock-panel p { color: var(--sec); font-size: 17px; margin: 0 0 20px; }
.lock-panel input { width: 100%; height: 52px; border-radius: 14px; border: 0; background: var(--card); color: var(--text); font-size: 17px; padding: 0 14px; margin-bottom: 12px; box-sizing: border-box; }
.lock-panel .lock-err { color: var(--red, #ff453a); margin-top: 14px; min-height: 22px; }
body.locked #screens { visibility: hidden; }
