[hidden] { display: none !important; }
:root {
  --bg: #0f1419; --card: #182028; --card2: #1f2933; --line: #2a3541; --text: #e8edf2; --muted: #8a97a6;
  --green: #26a269; --green-bg: rgba(38,162,105,.14); --red: #e5484d; --red-bg: rgba(229,72,77,.14);
  --amber: #f5c542; --amber-bg: rgba(245,197,66,.14); --blue: #4c8dff; --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); min-height: 100vh; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; width: 100%; }
textarea { min-height: 50vh; line-height: 1.45; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 17px; margin: 22px 4px 10px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
small, .muted { color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }

header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: rgba(15,20,25,.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.acct-btn { flex: 1; display: flex; align-items: center; gap: 10px; text-align: left; padding: 4px; border-radius: 12px; }
.acct-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--blue); color: #fff; flex: none; }
.acct-text { display: flex; flex-direction: column; min-width: 0; }
.acct-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); margin-left: auto; }
.icon-btn { font-size: 22px; width: 44px; height: 44px; border-radius: 50%; }

main { padding: 12px; max-width: 720px; margin: 0 auto; }
nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); z-index: 5;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav#tabs button { flex: 1; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: flex;
  flex-direction: column; align-items: center; gap: 2px; position: relative; }
nav#tabs button i { font-style: normal; font-size: 19px; }
nav#tabs button.on { color: var(--text); }
nav#tabs button.on i { color: var(--amber); }
.dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.pill.paper { background: var(--amber-bg); color: var(--amber); }
.pill.live { background: var(--red); color: #fff; }
.pill.buy { background: var(--green-bg); color: var(--green); }
.pill.sell { background: var(--red-bg); color: var(--red); }
.pill.grey { background: var(--card2); color: var(--muted); }

.hero { text-align: center; padding: 22px 16px; }
.hero .label { color: var(--muted); font-size: 13px; }
.hero .big { font-size: 40px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.hero .split { display: flex; justify-content: center; gap: 22px; color: var(--muted); font-size: 13px; }
.hero .split b { color: var(--text); font-variant-numeric: tabular-nums; }
.status { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 12px; font-size: 14px; }
.status .led { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.led.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.led.wait { background: var(--amber); } .led.bad { background: var(--red); }

.meter { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.meter > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.meter.warn > div { background: var(--amber); } .meter.bad > div { background: var(--red); }

.pos { padding: 14px 0; border-top: 1px solid var(--line); }
.pos:first-child { border-top: 0; padding-top: 0; }
.pos .sym { font-weight: 700; font-size: 16px; }
.pos .pnl { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
.pos .sub { color: var(--muted); font-size: 13px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.range { position: relative; height: 6px; border-radius: 99px; margin: 12px 0 4px;
  background: linear-gradient(90deg, var(--red-bg), var(--card2) 50%, var(--green-bg)); }
.range .mark { position: absolute; top: -4px; width: 3px; height: 14px; border-radius: 2px; background: var(--text); }
.range-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.btn { display: block; width: 100%; padding: 14px; border-radius: 12px; font-weight: 700; text-align: center;
  background: var(--card2); border: 1px solid var(--line); margin-top: 10px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: none; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; margin: 0; font-size: 13px; }
.btn:disabled { opacity: .45; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btns .btn { margin-top: 0; }
.kill { margin-top: 14px; padding: 16px; font-size: 16px; letter-spacing: .04em; }

.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.seg button.on.live { background: var(--red); color: #fff; }

.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.limits div { font-size: 13px; color: var(--muted); }
.limits b { display: block; color: var(--text); font-size: 15px; margin-top: 2px; }

.banner { border-radius: 12px; padding: 14px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; }
.banner.warn { background: var(--amber-bg); border: 1px solid rgba(245,197,66,.4); }
.banner.bad { background: var(--red-bg); border: 1px solid rgba(229,72,77,.5); }
.banner.info { background: rgba(76,141,255,.12); border: 1px solid rgba(76,141,255,.4); }
.banner .grow b { display: block; margin-bottom: 2px; }

.list-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.list-item:first-child { border-top: 0; }
.ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--card2); font-size: 16px; }
.ico.entry { background: var(--green-bg); color: var(--green); } .ico.exit { background: rgba(76,141,255,.15); }
.ico.halt, .ico.warning { background: var(--red-bg); } .ico.login { background: var(--amber-bg); }
.ico.ai { background: rgba(160,120,255,.18); }
.time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chip { padding: 7px 14px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }

.decision .who { font-weight: 700; }
.decision .what { margin-top: 4px; line-height: 1.45; }
.decision ul { margin: 6px 0 0; padding-left: 18px; }
.decision li { margin: 4px 0; line-height: 1.4; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--card2); color: var(--muted); margin-left: 4px; }
.tag.good { background: var(--green-bg); color: var(--green); } .tag.bad { background: var(--red-bg); color: var(--red); }
.tag.warn { background: var(--amber-bg); color: var(--amber); }

.agent-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; }
.agent-face { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: none; }

.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.agent { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.system { align-self: center; background: none; color: var(--muted); font-size: 13px; padding: 2px; }
.typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 4px 8px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); padding: 8px 12px;
  background: var(--bg); border-top: 1px solid var(--line); display: flex; gap: 8px; z-index: 4; }
.composer textarea { min-height: 46px; max-height: 120px; height: 46px; resize: none; }
.composer button { flex: none; width: 52px; border-radius: 12px; background: var(--blue); color: #fff; font-size: 20px; }

.change { border: 2px solid var(--amber); border-radius: 14px; padding: 14px; background: var(--card); align-self: stretch; }
.change h3 { font-size: 15px; margin-bottom: 8px; }
.diff { font-size: 13px; line-height: 1.45; max-height: 45vh; overflow: auto; margin: 8px 0; }
.diff div { padding: 3px 8px; border-radius: 6px; margin: 2px 0; white-space: pre-wrap; }
.diff .add { background: var(--green-bg); } .diff .add::before { content: "＋ "; color: var(--green); font-weight: 700; }
.diff .del { background: var(--red-bg); text-decoration: line-through; color: #c9a3a5; }
.diff .del::before { content: "－ "; color: var(--red); font-weight: 700; }
.diff .file { color: var(--muted); font-weight: 700; margin-top: 10px; }

.md h1 { font-size: 19px; margin: 6px 0 10px; } .md h2 { font-size: 15px; color: var(--amber); margin: 16px 0 6px; }
.md ul { margin: 0; padding-left: 20px; } .md li { margin: 5px 0; line-height: 1.45; } .md p { line-height: 1.45; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; }
.sheet-body { background: var(--card); width: 100%; max-width: 720px; margin: 0 auto; border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.sheet-body h3 { font-size: 18px; margin-bottom: 8px; }
.sheet-body p { line-height: 1.45; color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 30; font-weight: 600; max-width: 90vw; }

.login { max-width: 420px; margin: 10vh auto 0; text-align: center; padding: 0 8px; }
.login img { width: 84px; height: 84px; }
.login h1 { margin: 14px 0 6px; }
.login input { text-align: center; font-size: 24px; letter-spacing: .15em; text-transform: uppercase; margin-top: 20px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; line-height: 1.5; }
.bars { width: 100%; height: 130px; display: block; }
.msg { max-width: 480px; margin: 15vh auto; padding: 20px; text-align: center; }
.acct-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; text-align: left; }
.acct-row.on { background: var(--card2); }
details.more summary { font-weight: 700; cursor: pointer; list-style: none; }
details.more summary::after { content: " ▾"; color: var(--muted); }
details.more[open] summary::after { content: " ▴"; }
select { appearance: none; margin: 4px 0 10px; }
label.row { gap: 10px; align-items: flex-start; line-height: 1.4; }
.help { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--card2); color: var(--muted); font-size: 12px; margin-left: 6px; }
.onboard { text-align: center; padding: 26px 18px; }
.onboard .big-emoji { font-size: 54px; }
.onboard p { line-height: 1.5; }
.steps { display: flex; justify-content: center; gap: 6px; margin: 16px 0; }
.steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.steps i.on { background: var(--amber); }

/* ---- Trades: range chips, charts, tiles, breakdowns ---- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 12px; border-radius: 99px; background: var(--card2); color: var(--muted); font-weight: 600; font-size: 13px; border: 1px solid var(--line); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg.small button { padding: 7px 10px; font-size: 13px; }
.row > .seg.small { flex: 1; }
.row select { width: auto; flex: 0 0 auto; max-width: 42%; }
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart text { font-family: inherit; font-variant-numeric: tabular-nums; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; min-height: 22px; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.readout b { color: var(--text); }
.readout span { color: var(--text); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tile small { display: block; } .tile b { display: block; font-size: 17px; margin: 3px 0; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 11px; }
.hbar { display: grid; grid-template-columns: 38% 1fr 64px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hbar:last-child { border-bottom: 0; }
.hbar-l b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-l small { font-size: 11px; }
.hbar-track { position: relative; height: 10px; background: var(--card2); border-radius: 4px; }
.hbar-track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.hbar-track i.pos { background: var(--green); } .hbar-track i.neg { background: var(--red); }
.hbar-v { text-align: right; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
/* ---- suggestions, admin ---- */
.cmp { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp.head { color: var(--muted); font-size: 12px; padding-top: 0; }
.cmp:last-child { border-bottom: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.codebox { background: var(--card2); border-radius: 10px; padding: 12px; margin: 6px 0 12px; font-family: ui-monospace, monospace; word-break: break-all; }
.codebox.big { font-size: 24px; letter-spacing: .12em; text-align: center; font-weight: 700; }
.banner.conn { position: sticky; top: 0; z-index: 20; margin: 0; border-radius: 0; }
/* authenticator */
.code-in { font-size: 26px; letter-spacing: .3em; text-align: center; font-family: ui-monospace, monospace; }
.login img.qr { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 12px; margin: 6px auto 12px; display: block; }
.totp-steps { text-align: left; padding-left: 22px; line-height: 1.5; margin: 8px 0; }
.login details { text-align: left; margin: 0 0 12px; }
.login details summary { color: var(--muted, #8a97a6); cursor: pointer; padding: 6px 0; }
.codebox.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 17px; text-align: center; }
/* backups */
.card.notice ul { padding-left: 18px; margin: 8px 0 0; line-height: 1.5; }
.card.notice li { margin-bottom: 6px; }
label.check { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
input.plain { text-transform: none !important; letter-spacing: normal !important; font-size: 17px !important; text-align: left !important; margin: 6px 0; }
.list-item.bk small { color: var(--muted); }
/* first-time questions */
.wizard { max-width: 460px; margin: 4vh auto 0; padding: 0 4px; }
.wizard h1 { font-size: 24px; margin: 14px 0 6px; }
.wizard .steps { justify-content: flex-start; margin: 8px 0 0; }
.money-in { display: flex; align-items: center; gap: 8px; font-size: 24px; margin: 12px 0 4px; }
.money-in input { font-size: 24px; }
