:root {
  --bg: #000; --panel: #101215; --panel2: #16191d; --line: #262a31; --line2: #33383f;
  --text: #e8eaed; --muted: #8d939c; --dim: #5e646c;
  --gold: #e8bd4f; --gold2: #f3cf6b; --green: #4ea657; --green2: #5cb865; --greenbg: #3e8f47;
  --red: #c9463f; --red2: #e0574f; --blue: #3b8cff; --chart: #26272b;
  --cond: 'Roboto Condensed', 'Arial Narrow', -apple-system, system-ui, sans-serif;
  --ui: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
svg { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }
.flex1 { flex: 1; }
.num, b { font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 50;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(232,189,79,.16), transparent 60%), radial-gradient(800px 500px at 120% 110%, rgba(59,140,255,.12), transparent 60%), #050607; }
.login-card { width: 100%; max-width: 380px; background: rgba(18,20,24,.92); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); backdrop-filter: blur(10px); }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.brand-mark { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #111; background: linear-gradient(145deg, var(--gold2), #c9962c); box-shadow: 0 8px 24px rgba(232,189,79,.35); }
.brand-mark svg { width: 32px; height: 32px; }
.brand h1 { margin: 0; font: 700 24px var(--cond); letter-spacing: .5px; }
.brand h1 span { color: var(--gold); }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.login label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 0; font-weight: 600; letter-spacing: .2px; }
.login input:not([type=checkbox]) { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 11px; border: 1px solid var(--line2); background: #0b0c0e; font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.login input:focus { border-color: var(--gold); }
.login .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: 14px; margin-top: 14px; }
.btn-primary { width: 100%; margin-top: 18px; padding: 14px; border-radius: 12px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #15120a; font-weight: 800; font-size: 16px; letter-spacing: .4px; }
.btn-primary:active { transform: scale(.99); filter: brightness(.95); }
.btn-ghost { width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line2); color: var(--text); font-weight: 600; }
.err { color: var(--red2); min-height: 18px; font-size: 13px; margin: 12px 0 0; }
.fine { color: var(--dim); font-size: 11.5px; line-height: 1.45; margin: 6px 0 0; }

/* ---------- shell ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: var(--sat); }
.topbar { display: flex; gap: 8px; padding: 8px 8px 6px; align-items: stretch; flex: none; }
.acct-btn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; border: 2px solid var(--gold); border-radius: 9px; background: #0c0d0f; font: 600 16px var(--cond); white-space: nowrap; }
.acct-name { color: var(--gold2); overflow: hidden; text-overflow: ellipsis; }
.acct-num { color: #e9e9e9; font-weight: 400; flex: none; }
.acct-btn .caret { width: 11px; height: 8px; margin-left: auto; color: #ddd; transition: transform .2s; }
.acct-btn.open .caret { transform: rotate(180deg); }
.pnl-box { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; min-width: 82px; height: 44px; padding: 0 9px; border-radius: 9px; background: var(--greenbg); font-family: var(--cond); line-height: 1.05; }
.pnl-box small { font-size: 10.5px; font-weight: 600; opacity: .85; letter-spacing: .4px; }
.pnl-box b { font-size: 16px; font-weight: 700; white-space: nowrap; }
.pnl-box.neg { background: #a43b35; }
.pnl-box.flat { background: #0c0d0f; border: 1px solid var(--line2); }
.acct-menu { position: absolute; left: 8px; right: 8px; top: calc(var(--sat) + 56px); z-index: 30; background: #1b1e23; border: 1px solid var(--line2); border-radius: 12px; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); max-height: 60vh; overflow: auto; }
.acct-menu h4 { margin: 2px 2px 10px; font: 500 17px var(--cond); color: #aeb4bd; display: flex; align-items: center; }
.acct-item { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 9px; margin-bottom: 8px; background: #23262c; }
.acct-item.sel { border-color: var(--gold); }
.acct-item .n { color: var(--gold2); font: 700 17px var(--cond); }
.acct-item .d { color: #aab0b8; font: 500 13px var(--cond); margin-top: 4px; }
.acct-item.dis .n { color: #8d939c; }
.sw { margin-left: auto; width: 46px; height: 26px; border-radius: 13px; background: #3a3f47; position: relative; transition: background .2s; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #111; transition: left .2s; }
.sw.on { background: var(--gold); }
.sw.on::after { left: 23px; }

.toolbar { display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 8px; flex: none; background: linear-gradient(180deg, #11161d, #0e1217); border-top: 1px solid #1b222b; border-bottom: 1px solid #1b222b; }
.tb { height: 36px; min-width: 38px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; color: #e7ebf0; font: 600 17px var(--cond); }
.tb:active { background: rgba(255,255,255,.07); }
.tb svg { width: 21px; height: 21px; }
.tb.sym span { font-weight: 700; letter-spacing: .3px; }
.tb.pill span { font-size: 13px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line2); color: var(--gold2); letter-spacing: .6px; }
.sep { width: 1px; height: 22px; background: #2c333c; margin: 0 3px; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: #555; box-shadow: 0 0 0 3px rgba(255,255,255,.04); margin-right: 4px; }
.conn.live { background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,.7); }
.conn.warn { background: #fbbf24; }
.conn.bad { background: #ef4444; }

.views { position: relative; flex: 1 1 auto; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }
.view.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 20px; }

/* ---------- chart ---------- */
.chart-wrap { position: absolute; inset: 0; background: var(--chart); }
.chart { position: absolute; inset: 0; }
.legend { position: absolute; top: 8px; left: 10px; z-index: 5; pointer-events: none; font-family: var(--ui); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.legend .l1 { font: 500 17px var(--ui); color: #d7dbe0; display: flex; align-items: center; gap: 6px; }
.legend .dotsep { color: #8d939c; }
.legend { right: 80px; }
.legend .l2 { margin-top: 3px; font-size: 11.5px; color: #c4c9cf; font-variant-numeric: tabular-nums; display: flex; gap: 8px; flex-wrap: wrap; }
.legend .l2 .up { color: #4ade80; } .legend .l2 .dn { color: #f87171; }
.legend .l3 { margin-top: 3px; font-size: 11.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.live-dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(52,211,153,.25); display: inline-grid; place-items: center; margin-left: 4px; }
.live-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #5fd0a6; }
.live-dot.off { background: rgba(239,68,68,.25); } .live-dot.off::after { background: #ef4444; }
.price-tag { position: absolute; right: 0; top: 0; z-index: 6; box-sizing: border-box; pointer-events: none; display: none; background: #fff; color: #111; border-radius: 2px; padding: 2px 6px 3px; font: 500 12.5px var(--ui); line-height: 1.15; font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.price-tag b { display: block; font-weight: 600; }
.price-tag span { display: block; color: #333; font-size: 11.5px; }
.price-tag[data-dir=up] { box-shadow: inset 3px 0 0 #22c55e, 0 2px 8px rgba(0,0,0,.35); }
.price-tag[data-dir=down] { box-shadow: inset 3px 0 0 #ef4444, 0 2px 8px rgba(0,0,0,.35); }
.jump-btn { position: absolute; right: 84px; bottom: 36px; z-index: 6; width: 34px; height: 34px; border-radius: 50%; background: rgba(20,22,26,.85); border: 1px solid var(--line2); color: #ddd; font-size: 18px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; background: rgba(0,0,0,.2); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- trade bar ---------- */
.tradebar { flex: none; background: #0b0d10; border-top: 1px solid #1d2128; padding: 6px 8px 4px; }
.tr-row { display: flex; align-items: center; gap: 6px; }
.tr-row + .tr-row { margin-top: 7px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px; border-radius: 6px; background: #1b1e23; font: 500 15px var(--cond); color: #e5e7ea; white-space: nowrap; flex: none; }
.chip.pos { color: #c9cdd3; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; display: block; line-height: 34px; }
.chip.pos.long { color: #6ee089; background: rgba(78,166,87,.14); }
.chip.pos.short { color: #ff8b84; background: rgba(201,70,63,.14); }
.chip.gold { border: 1.5px solid #b9923a; background: transparent; color: #e7e7e7; }
.chip.gold svg { color: var(--gold); width: 16px; height: 16px; }
.chip.outline { border: 1.5px solid #8d7740; background: transparent; }
.chip.outline svg { width: 17px; height: 17px; color: var(--gold); }
.sizes { justify-content: center; gap: 10px; position: relative; }
.sz { width: 35px; height: 35px; border-radius: 50%; border: 1.5px solid #a88a3e; color: #e7e7e7; font: 500 17px var(--cond); display: grid; place-items: center; }
.sz.sm { color: var(--gold); }
.sz.sel { border: 3px solid var(--gold2); color: #fff; font-weight: 700; box-shadow: 0 0 12px rgba(232,189,79,.35); }
.sz-edit { position: absolute; right: 2px; width: 32px; height: 32px; display: grid; place-items: center; color: #aaa; }
.trade { align-items: stretch; }
.buy, .sell { flex: 0 0 17%; height: 52px; border-radius: 6px; font: 600 17px var(--cond); letter-spacing: .3px; color: #fff; line-height: 1.05; }
.buy span, .sell span { white-space: nowrap; }
.buy { background: linear-gradient(180deg, #5cb865, #47a050); }
.sell { background: linear-gradient(180deg, #d4534b, #b93d36); }
.buy:active, .sell:active { filter: brightness(1.15); transform: scale(.98); }
.quote { flex: 1 1 0; min-width: 0; height: 52px; border-radius: 6px; padding: 4px 6px; display: flex; flex-direction: column; justify-content: center; font-family: var(--cond); }
.quote small { font-size: 12.5px; color: #c5c9cf; line-height: 1.1; }
.quote b { font-size: 15px; font-weight: 500; white-space: nowrap; letter-spacing: -.1px; }
.quote.bid { border: 1.5px solid #2f6d38; }
.quote.ask { border: 1.5px solid #7a2f2b; align-items: flex-end; }
.quote.mid { border: 0; align-items: center; flex: 1.1 1 0; padding: 4px 0; }
.quote.mid b { font-size: 18px; color: var(--green2); transition: color .15s; }
.quote.mid b.dn { color: var(--red2); }
.quote.mid small { color: #9aa0a8; font-size: 13px; }
.actions { gap: 6px; }
.act { flex: 1; min-width: 0; height: 34px; border-radius: 6px; background: #1a1d22; border: 1px solid #262a31; white-space: nowrap; font: 600 12.5px var(--cond); letter-spacing: .6px; color: #d9dde2; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.act:active { background: #262a31; }
#flatBtn { color: #ffb3ad; border-color: #4a2523; }
.act.mic { color: var(--gold2); border-color: #5a4b25; }
.act.mic svg { width: 16px; height: 16px; }
.act.mic.on { background: var(--gold); color: #111; }

.tabbar { flex: none; display: flex; background: #0a0c0f; border-top: 1px solid #1b1f25; padding-bottom: var(--sab); }
.tabbar button { flex: 1; height: 54px; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; font: 500 15px var(--cond); color: #c9cdd3; letter-spacing: .4px; position: relative; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--gold2); }
.tabbar button.active::before { content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px; }
@media (max-width: 420px) { .tabbar button { flex-direction: column; gap: 2px; font-size: 11.5px; } .tabbar button svg { width: 21px; height: 21px; } }

/* ---------- DOM ---------- */
#view-dom { background: #0d0f12; }
.dom-head, .dom-row { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr .9fr; }
.dom-head { height: 30px; align-items: center; font: 600 12px var(--cond); color: #8d939c; letter-spacing: .6px; text-align: center; border-bottom: 1px solid var(--line); background: #121519; }
.dom-body { position: absolute; top: 30px; left: 0; right: 0; bottom: 0; overflow: hidden; touch-action: none; }
.dom-row { height: 26px; font: 500 14px var(--cond); font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(255,255,255,.035); }
.dom-row > div { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.dom-row .px { color: #cfd3d8; background: #15181c; }
.dom-row.last .px { background: #e8eaed; color: #111; font-weight: 700; }
.dom-row.avg .px { box-shadow: inset 0 0 0 2px var(--gold); }
.dom-row .bd { color: #8fd2a0; background: rgba(46,125,70,.12); }
.dom-row .ak { color: #f2a19b; background: rgba(160,50,45,.12); }
.dom-row .bd.has { background: rgba(46,125,70,.35); color: #fff; }
.dom-row .ak.has { background: rgba(160,50,45,.35); color: #fff; }
.dom-row .bc, .dom-row .sc { color: #9aa0a8; font-size: 12.5px; }
.dom-row .bc:active { background: rgba(78,166,87,.35); }
.dom-row .sc:active { background: rgba(201,70,63,.35); }
.dom-row .vo { justify-content: flex-start; color: #9aa0a8; font-size: 11.5px; padding-left: 3px; }
.dom-row .vo i { position: absolute; left: 0; top: 4px; bottom: 4px; background: rgba(120,130,145,.35); }
.dom-row .vo span { position: relative; }
.ord-tag { padding: 1px 6px; border-radius: 4px; font-weight: 700; font-size: 12px; color: #fff; }
.ord-tag.b { background: #2563eb; } .ord-tag.s { background: #b45309; } .ord-tag.stp { background: #c2410c; }
.dom-center { position: absolute; right: 10px; bottom: 12px; padding: 8px 12px; border-radius: 18px; background: rgba(30,33,38,.95); border: 1px solid var(--line2); font: 600 13px var(--cond); color: var(--gold2); }

/* ---------- account + settings ---------- */
.card { margin: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card h3 { margin: 0; padding: 12px 14px; font: 600 15px var(--cond); letter-spacing: .6px; color: #aeb4bd; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.card h3 .flex1 + * { font-size: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.stat { background: var(--panel); padding: 12px 14px; }
.stat small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.stat b { display: block; margin-top: 3px; font: 700 21px var(--cond); }
.pos-c { color: #59c86a; } .neg-c { color: #ef6a62; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 14px; min-height: 48px; }
.row:last-child { border-bottom: 0; }
.row .lbl { flex: 1; min-width: 0; }
.row .lbl small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.row select, .row input[type=number], .row input[type=text] { background: #0b0c0e; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px; font-size: 15px; max-width: 160px; }
.row input[type=number] { width: 84px; }
.mini-btn { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line2); font: 600 13px var(--cond); letter-spacing: .4px; color: #e5e7ea; background: #1b1e23; }
.mini-btn.red { color: #ffb3ad; border-color: #5a2a27; }
.mini-btn.gold { color: #111; background: var(--gold); border-color: var(--gold); }
.empty { padding: 16px 14px; color: var(--dim); font-size: 14px; }
.tag { font: 700 11px var(--cond); padding: 2px 7px; border-radius: 4px; letter-spacing: .5px; }
.tag.l { background: rgba(78,166,87,.2); color: #7ee08f; } .tag.s { background: rgba(201,70,63,.2); color: #ff938c; }
.tag.g { background: rgba(232,189,79,.18); color: var(--gold2); }
.help-grid { padding: 6px 14px 12px; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: 13.5px; }
.help-grid b { color: var(--gold2); font-family: var(--cond); font-size: 15px; font-weight: 600; }
.help-grid span { color: #aab0b8; }

/* ---------- drive mode ---------- */
.drive { background: radial-gradient(700px 400px at 50% -10%, rgba(232,189,79,.08), transparent 60%), #07080a; padding: 14px 14px 10px; display: none; flex-direction: column; gap: 12px; overflow-y: auto; }
.drive.active { display: flex; }
.drive-top { text-align: center; padding: 6px 0 2px; }
.drive-sym { font: 600 20px var(--cond); color: #aeb4bd; letter-spacing: .5px; }
.drive-sym b { color: #fff; font-size: 24px; margin-left: 6px; }
.drive-pos { margin-top: 6px; font: 700 34px var(--cond); letter-spacing: .5px; color: #cfd3d8; }
.drive-pos.long { color: #66d877; } .drive-pos.short { color: #ff7a71; }
.drive-pnl { font: 700 52px var(--cond); line-height: 1.05; color: #cfd3d8; }
.drive-pnl.pos-c { color: #59c86a; } .drive-pnl.neg-c { color: #ef6a62; }
.drive-sub { margin-top: 4px; display: flex; justify-content: center; gap: 16px; color: var(--muted); font: 500 15px var(--cond); }
.drive-sub b { color: #e5e7ea; }
.big-mic { align-self: center; width: min(62vw, 230px); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font: 700 15px var(--cond); letter-spacing: 1px; color: #15120a;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 55%, #b8892a); box-shadow: 0 0 0 10px rgba(232,189,79,.08), 0 20px 50px rgba(232,189,79,.25); transition: transform .15s, box-shadow .2s; flex: none; }
.big-mic svg { width: 64px; height: 64px; }
.big-mic:active { transform: scale(.97); }
.big-mic.listening { animation: pulse 1.2s ease-in-out infinite; background: radial-gradient(circle at 35% 30%, #ff9b93, #e0574f 55%, #9c2f29); color: #fff; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 10px rgba(224,87,79,.18), 0 0 0 24px rgba(224,87,79,.07); } 50% { box-shadow: 0 0 0 18px rgba(224,87,79,.22), 0 0 0 38px rgba(224,87,79,.06); } }
.drive-heard { text-align: center; min-height: 48px; font: 500 19px var(--cond); color: #e5e7ea; padding: 0 10px; }
.drive-heard.ok { color: #7ee08f; } .drive-heard.bad { color: #ff8b84; }
.drive-toggles { display: flex; gap: 8px; }
.tgl { flex: 1; height: 46px; border-radius: 10px; border: 1.5px solid var(--line2); font: 600 14.5px var(--cond); letter-spacing: .4px; color: #aeb4bd; background: #111317; }
.tgl.on { border-color: var(--gold); color: #111; background: var(--gold); }
.drive-flat { height: 60px; border-radius: 12px; background: linear-gradient(180deg, #d4534b, #a8352f); font: 700 22px var(--cond); letter-spacing: 2px; color: #fff; flex: none; }
.drive-log { font: 500 13px var(--cond); color: #8d939c; display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.drive-log div { display: flex; gap: 8px; } .drive-log time { color: #5e646c; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 82vh; overflow-y: auto; background: #15181c; border-top-left-radius: 18px; border-top-right-radius: 18px; border-top: 1px solid var(--line2); padding: 6px 0 calc(16px + var(--sab)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-x { position: sticky; top: 0; float: right; margin: -4px 12px 0 0; padding: 6px 12px; border-radius: 14px; background: #262a31; color: var(--gold2); font: 600 14px var(--cond); z-index: 2; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #3a3f47; margin: 4px auto 8px; }
.sheet h2 { margin: 2px 16px 10px; font: 700 18px var(--cond); letter-spacing: .5px; }
.sheet h5 { margin: 14px 16px 8px; font: 600 12px var(--ui); color: var(--muted); letter-spacing: .8px; text-transform: uppercase; }
.tf-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 16px; }
.tf-grid button, .seg button { height: 42px; border-radius: 9px; background: #1f2328; border: 1px solid #2a2f36; font: 600 16px var(--cond); }
.tf-grid button.sel, .seg button.sel { background: var(--gold); color: #111; border-color: var(--gold); }
.seg { display: flex; gap: 8px; padding: 0 16px; }
.seg button { flex: 1; }
.sheet .row { padding-left: 16px; padding-right: 16px; }
.search-in { margin: 0 16px; width: calc(100% - 32px); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); background: #0b0c0e; font-size: 16px; -webkit-user-select: text; user-select: text; }
.res-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.04); text-align: left; }
.res-item b { font: 700 17px var(--cond); min-width: 70px; }
.res-item span { color: var(--muted); font-size: 13px; }
.px-entry { display: flex; align-items: center; gap: 8px; padding: 6px 16px; }
.px-entry input { flex: 1; text-align: center; font: 700 26px var(--cond); padding: 10px; border-radius: 10px; border: 1px solid var(--line2); background: #0b0c0e; -webkit-user-select: text; user-select: text; }
.px-entry button { width: 52px; height: 52px; border-radius: 10px; background: #23272d; font: 700 24px var(--cond); }
.sheet .big-go { display: block; margin: 14px 16px 0; width: calc(100% - 32px); height: 54px; border-radius: 10px; font: 700 19px var(--cond); letter-spacing: .6px; color: #fff; }
.big-go.b { background: linear-gradient(180deg, #5cb865, #47a050); } .big-go.s { background: linear-gradient(180deg, #d4534b, #b93d36); }

/* ---------- confirm + hud + toasts ---------- */
.confirm { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 20px; }
.confirm-card { width: 100%; max-width: 420px; background: #16191d; border: 1px solid var(--line2); border-radius: 18px; padding: 20px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.cf-title { font: 700 15px var(--cond); color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.cf-body { margin: 10px 0 18px; font: 700 30px var(--cond); line-height: 1.15; }
.cf-body.b { color: #6ee089; } .cf-body.s { color: #ff8b84; }
.cf-btns { display: flex; gap: 12px; }
.cf-btns button { flex: 1; height: 64px; border-radius: 12px; font: 800 24px var(--cond); letter-spacing: 1.5px; }
.cf-no { background: #2a2e35; color: #e5e7ea; } .cf-yes { background: var(--gold); color: #111; }
.cf-timer { margin-top: 10px; color: var(--dim); font-size: 12.5px; }
.hud { position: fixed; left: 50%; top: calc(var(--sat) + 120px); transform: translateX(-50%); z-index: 55; background: rgba(15,17,20,.94); border: 1px solid #5a4b25; border-radius: 30px; padding: 10px 18px 10px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); max-width: 92vw; pointer-events: none; }
.hud-ring { width: 18px; height: 18px; border-radius: 50%; background: #e0574f; animation: pulse 1.2s infinite; flex: none; }
.hud-txt { font: 600 16px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 112px); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { max-width: 92vw; padding: 10px 16px; border-radius: 12px; background: rgba(28,31,36,.97); border: 1px solid var(--line2); font: 600 15px var(--cond); letter-spacing: .3px; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: tin .2s ease-out; }
.toast.ok { border-color: #2f6d38; color: #8ee69c; } .toast.err { border-color: #7a2f2b; color: #ff9d96; } .toast.warn { border-color: #6b5520; color: var(--gold2); }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }

/* landscape: give the chart room */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { padding: 4px 8px; } .acct-btn, .pnl-box { height: 36px; }
  .toolbar { height: 38px; } .tr-row.sizes, .tr-row.actions { display: none; }
  .buy, .sell, .quote { height: 44px; } .tabbar button { height: 40px; }
}

/* ---------- always-on voice ---------- */
.vpill { position: absolute; left: 10px; bottom: 34px; z-index: 7; max-width: calc(100% - 100px); display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 20px; background: rgba(10,12,15,.82); border: 1px solid #5a4b25; font: 600 14px var(--cond); color: var(--gold2); backdrop-filter: blur(6px); }
.vpill i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; flex: none; }
.vpill[data-st=on] i { background: #34d399; animation: blink 1.6s ease-in-out infinite; }
.vpill[data-st=busy] i { background: #fbbf24; }
.vpill[data-st=off] { border-color: #7a2f2b; color: #ffb3ad; }
.vpill em { font-style: normal; color: #e8eaed; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vpill em:empty { display: none; }
@keyframes blink { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 50% { box-shadow: 0 0 0 6px rgba(52,211,153,0); } }
.arm-voice { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.arm-voice .arm-mic { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; color: #15120a; background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 55%, #b8892a); animation: pulse 1.6s ease-in-out infinite; }
.arm-voice .arm-mic svg { width: 56px; height: 56px; }
.arm-voice b { font: 700 26px var(--cond); color: #fff; letter-spacing: .4px; }
.arm-voice span { font: 500 15px var(--ui); color: #aeb4bd; line-height: 1.45; }
