:root {
  --bg: #000;
  --text: #fff;
  --secondary: rgba(235,235,245,0.6);
  --tertiary: 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;
  --gutter: 16px;
  --tab-h: calc(52px + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body {
  font-family: "SF Pro Text", -apple-system, system-ui, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  padding: 0;
  padding-bottom: var(--tab-h);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
input, select { font: inherit; color: inherit; background: var(--card2); border: 0; border-radius: 10px; }
.tabular, .num, .odo, . bal, .price, .pct { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.display {
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-weight: 640;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }

.app { padding: 0 var(--gutter) 28px; min-height: 60vh; }
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  background: rgba(0,0,0,0.86);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.nav .title { font-weight: 600; font-size: 17px; }
.nav .sub { color: var(--secondary); font-size: 13px; }
.avatar, .icon-btn, .tab, .btn, .range button, .sell-opt, .confirm {
  min-width: 44px; min-height: 44px;
}
.avatar {
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  border-radius: 50%; background: var(--card2); display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
}
.icon-btn { width: 44px; height: 44px; border-radius: 22px; color: var(--secondary); display: grid; place-items: center; }
.search-box {
  flex: 1; height: 36px; border-radius: 10px; background: var(--card);
  padding: 0 12px; color: var(--text);
}
.error-banner {
  background: #3a0c0a; color: #ff8a84; padding: 10px var(--gutter);
  font-size: 13px; position: sticky; top: 0; z-index: 30;
}
.hidden, [hidden] { display: none !important; }

.balance-row { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 2px; }
.balance {
  font-size: 72px; line-height: 0.95;
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-weight: 650; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.today { font-size: 17px; font-weight: 600; }
.today.up { color: var(--green); } .today.down { color: var(--red); }
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 11px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pill.green { background: rgba(0,211,90,0.16); color: var(--green); }
.pill.orange { background: rgba(255,159,10,0.16); color: var(--orange); }
.pill.red { background: rgba(255,69,58,0.16); color: var(--red); }
.pill.blue { background: rgba(10,132,255,0.16); color: var(--blue); }
.mono.pill { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11px; }

.range { display: flex; gap: 4px; margin: 8px 0 4px; }
.range button {
  flex: 1; height: 36px; min-height: 36px; border-radius: 8px;
  color: var(--secondary); font-size: 13px; font-weight: 600;
}
.range button.on { background: var(--card); color: var(--text); }

.chart-wrap { position: relative; height: 180px; margin: 4px -4px 16px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }

.live-card {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 22px;
  overflow: hidden; background: var(--card); margin: 12px 0 18px;
}
.live-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-card .top {
  position: absolute; left: 12px; right: 12px; top: 10px;
  display: flex; justify-content: space-between; align-items: flex-start;
  font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.live { background: var(--red); } .dot.old { background: #8e8e93; }
.live-card .under {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  font-size: 12px; color: #fff;
}
.checks { display: inline-flex; gap: 4px; margin-left: 6px; }
.check { width: 14px; height: 14px; border-radius: 50%; background: var(--card2); font-size: 9px; display: grid; place-items: center; }
.check.ok { background: var(--green); color: #000; } .check.no { background: var(--red); color: #fff; } .check.na { background: var(--card2); color: var(--secondary); }

.section-h {
  display: flex; justify-content: space-between; align-items: center;
  margin: 22px 0 12px; font-weight: 650; font-size: 17px;
  letter-spacing: -0.02em;
}
.section-h a, .section-h button.link { color: var(--blue); font-weight: 500; font-size: 14px; }

.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.bot-mini, .bot-full, .card, .row {
  background: var(--card); border-radius: 16px;
}
.bot-mini { min-width: 200px; scroll-snap-align: start; padding: 14px; }
.bot-full { padding: 16px; margin-bottom: 12px; }
.bot-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-dot.off { background: #8e8e93; }
.muted { color: var(--secondary); font-size: 13px; }
.strike { color: var(--tertiary); text-decoration: line-through; }
.kill-reason { color: var(--red); font-size: 12px; }
.layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.layer { height: 6px; border-radius: 3px; background: var(--card2); }
.layer.ok { background: var(--green); } .layer.no { background: var(--red); } .layer.na { background: var(--card2); }
.ring { width: 44px; height: 44px; }

.row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 8px;
  min-height: 56px;
}
.row .mid { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { color: var(--secondary); font-size: 12px; margin-top: 2px; }
.row .right { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.open-fomo { color: var(--blue); font-size: 13px; min-height: 32px; }

.skeleton { background: var(--card); border-radius: 16px; height: 56px; margin: 8px 0; animation: pulse 1.2s ease-in-out infinite; }
.sk-balance { height: 72px; width: 70%; border-radius: 12px; }
.sk-chart { height: 180px; }
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: 0.7; }
  .odo span { transition: none !important; }
}

.empty { color: var(--secondary); text-align: center; padding: 36px 12px; }
.switch { width: 51px; height: 32px; border-radius: 16px; background: var(--card2); position: relative; min-width: 51px; }
.switch::after { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 14px; background: #fff; top: 2px; left: 2px; transition: left .2s; }
.switch.on { background: var(--green); }
.switch.on::after { left: 21px; }
.switch.locked { opacity: 0.45; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: rgba(22,22,24,0.92);
  backdrop-filter: saturate(1.6) blur(20px);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-top: 0.5px solid var(--sep);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab { flex: 1; height: 52px; color: var(--tertiary); font-size: 11px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tab.on { color: var(--blue); }

.sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel { width: 100%; max-width: 430px; background: var(--card); border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sell-opt, .confirm, .btn {
  width: 100%; height: 48px; border-radius: 14px; background: var(--card2);
  font-weight: 600; margin: 8px 0;
}
.confirm { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #000; }

.settings-group { margin: 18px 0; }
.settings-group h3 { font-size: 13px; color: var(--secondary); font-weight: 600; margin: 0 0 8px; text-transform: none; }
.setting { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.setting .top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.setting input[type=range] { width: 100%; accent-color: var(--blue); }
.setting .exact { width: 88px; height: 32px; text-align: right; padding: 0 8px; font-variant-numeric: tabular-nums; }

.discs { display: flex; justify-content: space-between; margin: 16px 0 8px; }
.disc { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-size: 11px; }
.disc.ok { background: var(--green); color: #000; } .disc.no { background: var(--red); }
.beam { height: 2px; background: var(--cyan); margin: 0 4px 16px; border-radius: 1px; }

.coin-price { font-size: 44px; line-height: 1; margin: 8px 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0; }
.stats div { background: var(--card); border-radius: 14px; padding: 12px; }
.stats .k { color: var(--secondary); font-size: 11px; } .stats .v { font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.live-full { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.live-full img { flex: 1; width: 100%; object-fit: contain; touch-action: pinch-zoom; }

.sep { height: 0.5px; background: var(--sep); margin: 8px 0; }
.link { color: var(--blue); }
h1,h2 { font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 28px; margin: 8px 0 12px; }
h2 { font-size: 20px; margin: 0; }

.proposal { background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.proposal .key { font-weight: 600; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 13px; }
.proposal .vals { margin: 8px 0; font-variant-numeric: tabular-nums; }
.proposal .reason { color: var(--secondary); font-size: 14px; line-height: 1.35; margin: 8px 0 12px; }
.proposal .actions { display: flex; gap: 8px; }
.proposal .approve { flex: 1; height: 44px; border-radius: 14px; background: var(--green); color: #000; font-weight: 600; }
.proposal .dismiss { flex: 1; height: 44px; border-radius: 14px; background: var(--card2); font-weight: 600; }


/* Password gate */
body.locked { padding-bottom: 0; }
body.locked .tabbar, body.locked .nav, body.locked .error-banner { display: none !important; }
.login {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px));
  max-width: 430px;
  margin: 0 auto;
}
.login h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.03em; }
.login .sub { color: var(--secondary); margin: 0 0 28px; font-size: 17px; }
.login-err { color: #ff8a84; font-size: 14px; margin: 0 0 14px; }
.login input[type=password] {
  width: 100%; height: 48px; border-radius: 14px;
  padding: 0 14px; background: var(--card); margin-bottom: 12px;
}
.login .btn { width: 100%; height: 48px; border-radius: 14px; margin: 0; }
.btn.sair { background: var(--card2); color: var(--text); margin-top: 28px; }


/* Live observation screen — Night Desk, dark + vibrant */
body.on-live {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: #07070b;
  color: #f4f4f7;
}
body.on-live .nav { display: none !important; }
body.on-live .app {
  padding: 0;
  max-width: none;
  padding-bottom: calc(var(--tabbar, 64px) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
body.on-live .tabbar { background: rgba(7,7,11,.94); border-top: 1px solid rgba(255,255,255,.06); }
.live {
  max-width: 430px;
  margin: 0 auto;
  padding: 10px 16px 20px;
  min-height: calc(100dvh - var(--tabbar, 64px) - env(safe-area-inset-bottom, 0px));
  position: relative;
}
.live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px;
}
.live-brand { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.live-top-r { display: flex; align-items: center; gap: 8px; }
.live-led {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: #7dffc0;
}
.live-led i {
  width: 7px; height: 7px; border-radius: 50%; background: #22f07a;
  box-shadow: 0 0 8px #22f07a;
  animation: livepulse 1.6s ease-in-out infinite;
}
.live-clock { font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace; font-size: 11px; color: #6e6a78; }
@keyframes livepulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.86); }
}
@media (prefers-reduced-motion: reduce) {
  .live-led i, .live-active i, .live-agent.on .live-ring { animation: none; }
  .live-toast { transition: none; }
}
body.on-live .pill.orange {
  border: 1px solid #ff9f0a;
  color: #ff9f0a;
  background: transparent;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.live-badge {
  border: 1px solid #ff9f0a;
  color: #ff9f0a;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.live-offroute {
  border: 1px solid #ff4d9a;
  color: #ff4d9a;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.live-offroute.hidden { display: none; }

.live-sim { font-size: 11px; color: #8a8694; letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 2px; }
.live-hero {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.live-hero .cents { font-size: 24px; color: #6e6a78; font-weight: 700; letter-spacing: -0.04em; }
.live-hero number-flow { font: inherit; letter-spacing: inherit; }
.live-hero number-flow::part(decimal),
.live-hero number-flow::part(fraction) {
  color: #6e6a78;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.04em;
}
.live-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.live-pnl {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #8a8694;
}
.live-pnl.up { color: #22f07a; }
.live-pnl.down { color: #ff6b8a; }
.live-pnl.flat { color: #8a8694; }
.live-pnl number-flow { font: inherit; }
.live-mult {
  background: #14301f;
  color: #22f07a;
  border-radius: 999px;
  padding: 3px 9px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}
.live-mult number-flow { font: inherit; }
.live-mult .mult-x { margin-left: 1px; }
.live-mult.idle .mult-x { display: none; }
.live-wl {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #9a96a4;
}
.live-fomo { font-size: 12px; color: #8a8694; margin: 2px 0 12px; }

.live-glass {
  background: rgba(16,16,24,0.62);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  margin-bottom: 8px;
}
.live-toast {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(14,16,22,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  will-change: transform, opacity;
}
.live-toast.hidden { display: none; }
.live-toast .toast-side { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.live-toast .toast-side.buy { color: #22f07a; }
.live-toast .toast-side.sell { color: #ff6b8a; }
.live-toast .toast-amt { color: #fff; font-weight: 800; }
.live-toast .toast-sym { color: #c8c4d0; }

.live-curve-card { padding: 10px 12px 8px; position: relative; }
.live-curve-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.live-coin-sym {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8694;
}
.live-coin-px {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: #f2f0f7;
}
.live-coin-px.idle { font-size: 12px; font-weight: 600; color: #6e6a78; letter-spacing: 0; }
.live-coin-px number-flow { font: inherit; letter-spacing: inherit; }
.live-coin-px number-flow::part(decimal),
.live-coin-px number-flow::part(fraction) {
  color: #6e6a78;
  font-weight: 700;
  font-size: 0.72em;
}
.live-coin-px.idle #live-coin-flow { display: none; }
#live-coin-flow.hidden { display: none; }
#live-coin-empty.hidden { display: none; }
.live-desk, #live-desk {
  width: 100%;
  height: 120px;
  position: relative;
}
#live-desk.is-empty { height: 72px; }
#live-desk-empty {
  position: absolute;
  left: 12px; right: 12px;
  top: 42px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6e6a78;
  font-size: 12px;
  pointer-events: none;
}
#live-desk-empty.hidden { display: none; }
.live-equity-wrap {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.live-equity-wrap.hidden { display: none; }
.live-equity-h {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a8694;
  font-weight: 700;
  margin-bottom: 2px;
}
.live-equity, #live-equity { width: 100%; height: 72px; position: relative; }

.live-computer { padding: 8px 8px 8px; overflow: hidden; }
.live-computer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 6px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a8694;
  font-weight: 700;
}
.live-chrome-btn {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c4d0;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
}
.live-chrome-btn.on { color: #7dffc0; border-color: rgba(34,240,122,.35); }
.live-chrome {
  position: relative;
  height: 148px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(34,240,122,.28);
}
.live-chrome.hidden { display: none; }
.live-computer.collapsed { padding-bottom: 6px; }
.live-chrome img { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }

.live-agents-card { padding: 8px 8px 10px; }
.live-agents-h {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a8694;
  font-weight: 700;
  padding: 0 6px 8px;
}
.live-agents {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}
.live-agent {
  flex: 1 1 0;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  --c: #fff;
}
.live-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border: 1.8px solid var(--c);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
}
.live-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.22;
  filter: blur(7px);
  pointer-events: none;
  z-index: 0;
}
.live-ring svg { width: 18px; height: 18px; display: block; position: relative; z-index: 1; }
.live-agent.active .live-ring {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent), 0 0 18px color-mix(in srgb, var(--c) 60%, transparent);
}
.live-agent-nm {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c);
  line-height: 1.1;
}
.live-agent-do {
  font-size: 9px;
  color: #9a96a4;
  max-width: 64px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.live-agent-do.idle { color: #5c5866; }
.live-agent.stale .live-ring { border-color: #ff6b6b; box-shadow: none; }

@keyframes ringpulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 28%, transparent), 0 0 22px color-mix(in srgb, var(--c) 70%, transparent); transform: scale(1.06); }
}

.live-pip-status {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  color: #7dffc0;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.live-pip-status.hidden, #live-paused.hidden, #live-exit.hidden { display: none; }
#live-paused {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.78); color: #ff4d9a;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
}
.live-expand {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.86);
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.live-expand.hidden { display: none; }
.live-expand-stage {
  position: relative;
  width: min(100%, 900px);
  height: min(80dvh, 640px);
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(34,240,122,.35);
}
.live-expand-stage img { width: 100%; height: 100%; object-fit: contain; }
.live-expand-x {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 18px;
  background: #1a1a22; color: #fff; z-index: 2;
}

.live-bots { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.live-bot {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  background: #121218;
  border: 1px solid #1e1e28;
  border-radius: 12px;
  padding: 6px 10px;
  min-height: 44px;
}
.live-ico {
  width: 28px; height: 28px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.live-ico svg { width: 16px; height: 16px; display: block; }
.live-bot-mid { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.live-bot-name { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; }
.live-thought { font-size: 12px; color: #c8c4d0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0; text-align: left; }
.live-thought.idle, .live-thought.empty { color: #5c5866; padding: 0; text-align: left; }
.live-active { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #6e6a78; }
.live-active i {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.live-active.on i { animation: livepulse 1.6s ease-in-out infinite; }
.live-active.stale { color: #ff6b6b; }

.live-log-h {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 8px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8a8694;
}
.live-log-h .on { color: #22f07a; }
.live-log {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  background: rgba(16,16,24,0.62);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 8px 10px;
  max-height: 132px;
  overflow: auto;
}
.live-log .row {
  display: grid;
  grid-template-columns: 52px 44px 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  background: none;
}
.live-log .ts { color: #6e6a78; }
.live-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 1px 5px;
  border-radius: 6px;
  text-align: center;
}
.live-chip.BUY { background: #14301f; color: #22f07a; }
.live-chip.SELL { background: #3a1218; color: #ff6b8a; }
.live-chip.SKIP, .live-chip.WAIT { background: #2a2410; color: #ffd60a; }
.live-chip.PICK { background: #1a1630; color: #bf5af2; }
.live-log .body { color: #e8e6ef; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-log .sym { color: #fff; font-weight: 700; }
.live-log .why { color: #9a96a4; }
.live-empty { color: #6e6a78; font-size: 12px; padding: 12px 6px; }

#live-cursors { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.live-cur {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 10px currentColor, 0 0 0 2px #000;
  transition: left .28s ease, top .28s ease;
}
.live-cur-box {
  position: absolute; border: 1px dashed currentColor; opacity: .7;
  border-radius: 4px;
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
}
@media (prefers-reduced-motion: reduce) {
  .live-cur, .live-cur-box { transition: none; }
}
#live-exit {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: rgba(18,8,22,.94); border: 1px solid #ff4d9a; color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 4;
  max-width: 90%; text-align: center;
}

@media (min-width: 900px) {
  .live { padding: 16px 20px 20px; }
  .live-hero { font-size: 56px; }
  .live-hero .cents { font-size: 28px; }
  #live-desk { height: 140px; }
  #live-desk.is-empty { height: 80px; }
  #live-equity { height: 84px; }
  .live-chrome { height: 180px; }
  .live-log { max-height: 200px; }
}

/* ---- Painel tab (dashboard v1) ---- */
.dash-card { background: var(--card); border-radius: 16px; padding: 16px; margin: 14px 0; border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #fff) 18%, transparent), 0 0 22px -10px var(--accent, transparent); }
.dash-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; margin-bottom: 12px; }
.dash-sub { margin-left: auto; color: var(--tertiary); font-weight: 400; font-size: 12px; }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.dash-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-big.red, .dash-row .red, .red { color: var(--red); }
.dash-big.green, .dash-row .green, .green { color: var(--green); }
.dash-big.orange, .orange { color: var(--orange); }
.dash-bar { margin: 8px 0; font-size: 15px; }
.dash-bar-top { display: flex; justify-content: space-between; color: var(--secondary); margin-bottom: 3px; }
.dash-track { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; }
.dash-fill { height: 100%; border-radius: 3px; box-shadow: 0 0 8px currentColor; }
.dash-mini-h { color: var(--tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; }
.dash-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--sep); font-size: 15px; }
.dash-row span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; }
.dash-lwc { width: 100%; height: 200px; margin-top: 6px; }
.dash-empty { padding: 24px 8px; font-size: 13px; }
.dash-note { font-size: 13px; margin-top: 8px; }
.dash-ph { opacity: .75; border-style: dashed; box-shadow: none; }
.dash-ph .pill { margin-left: auto; font-size: 11px; font-weight: 500; }


/* ---- UI v5: readability, Account, proposals, home summary ---- */
.home-summary {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  margin: 8px 0 18px;
  border: 1px solid rgba(255,255,255,0.06);
}
.home-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.home-summary-h {
  font-size: 12px;
  font-weight: 650;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 6px;
}
.home-summary-bal {
  font-size: 40px;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.home-summary-start {
  color: var(--secondary);
  font-size: 15px;
  margin-top: 6px;
}
.home-summary-chg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.home-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.home-kpi {
  background: var(--card2);
  border-radius: 12px;
  padding: 12px;
  min-height: 64px;
}
.home-kpi .k { color: var(--secondary); font-size: 13px; line-height: 1.25; }
.home-kpi .v { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.home-kpi:last-child { grid-column: 1 / -1; }

.tab { position: relative; }
.tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--orange);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.proposals-block { margin: 4px 0 20px; }
.proposals-empty {
  color: var(--secondary);
  font-size: 16px;
  padding: 12px 0 4px;
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 8px;
  border-radius: 11px;
  background: var(--orange);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
}
.proposal {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
}
.proposal .proposal-name { font-weight: 650; font-size: 17px; line-height: 1.3; }
.proposal .key {
  font-weight: 500;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--tertiary);
  margin-top: 4px;
}
.proposal .vals { margin: 12px 0 8px; font-variant-numeric: tabular-nums; font-size: 16px; }
.proposal .reason { color: var(--secondary); font-size: 15px; line-height: 1.4; margin: 8px 0 14px; }
.proposal .actions { display: flex; flex-direction: column; gap: 10px; }
.proposal .approve,
.proposal .dismiss {
  flex: none;
  width: 100%;
  height: 48px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
}
.proposal .approve { background: var(--green); color: #000; }
.proposal .dismiss { background: var(--card2); color: var(--text); }

.settings-group { margin: 20px 0; }
.settings-group h3 { font-size: 15px; color: var(--secondary); font-weight: 650; margin: 0 0 10px; text-transform: none; }
.setting { background: var(--card); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; min-height: 44px; }
.setting .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 16px; }
.setting-label { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.setting-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.setting-key {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--tertiary);
  font-weight: 500;
  word-break: break-all;
}
.setting .exact {
  width: 100px;
  height: 44px;
  min-height: 44px;
  text-align: right;
  padding: 0 10px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.setting select {
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  max-width: 46%;
}
#enable-push { min-height: 44px; padding: 0 8px; font-size: 15px; }
.muted { font-size: 15px; }

button.row, a.row { width: 100%; text-align: left; color: inherit; text-decoration: none; box-sizing: border-box; }
a.row .title { color: inherit; text-decoration: none; }

/* ---- Live tab: native real-time view (v5 style: 16px text, 44px taps) ---- */
.ln { margin-top: 4px; }
.ln button { cursor: pointer; }
.ln-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin: 4px 0 8px; font-size: 13px; color: var(--secondary); }
.ln-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: #7dffc0; font-size: 14px; }
.ln-live i { width: 8px; height: 8px; border-radius: 50%; background: #22f07a; box-shadow: 0 0 8px #22f07a; animation: livepulse 1.6s ease-in-out infinite; }
.ln-h { font-size: 13px; font-weight: 650; color: var(--secondary); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; }
.ln-card { background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.06); }
.ln-health { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.ln-bot { background: var(--card); border-radius: 12px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; border: 1px solid rgba(255,255,255,0.06); }
.ln-bot b { font-size: 13px; font-weight: 650; max-width: 100%; overflow-wrap: anywhere; }
.ln-bot small { font-size: 11px; color: var(--secondary); line-height: 1.2; }
.ln-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tertiary); }
.ln-bot.ok .ln-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ln-bot.late .ln-dot { background: var(--orange); }
.ln-bot.off .ln-dot { background: var(--red); }
.ln-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.ln-kpis span { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ln-kpis small { font-size: 12px; color: var(--secondary); line-height: 1.2; display: block; }
.ln-sub { margin-top: 10px; font-size: 14px; color: var(--secondary); }
.ln .up, .ln-sheet .up { color: var(--green); }
.ln .down, .ln-sheet .down { color: var(--red); }
.ln .warn { color: var(--orange); }
.ln-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-bottom: 10px; }
.ln-chip { min-height: 52px; padding: 4px 2px; border-radius: 14px; background: var(--card); font-size: 14px; font-weight: 600; color: var(--secondary); border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.ln-chip b { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.ln-chip.on { background: #fff; color: #000; }
.ln-chip.on b { color: #000; }
.ln-coin, .ln-pos { display: block; width: 100%; text-align: left; background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 10px; min-height: 44px; border: 1px solid rgba(255,255,255,0.06); color: var(--text); }
.ln-coin:active, .ln-pos:active { background: var(--card2); }
.ln-coin-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ln-coin-nm { min-width: 0; display: flex; flex-direction: column; }
.ln-coin-nm b, .ln-coin-top > b { font-size: 17px; font-weight: 650; }
.ln-coin-nm small { font-size: 13px; color: var(--secondary); overflow-wrap: anywhere; }
.ln-badge { flex: none; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 700; }
.v-pass { background: rgba(0,211,90,.16); color: var(--green); }
.v-kill { background: rgba(255,69,58,.16); color: var(--red); }
.v-wait { background: rgba(255,159,10,.16); color: var(--orange); }
.v-none { background: rgba(142,142,147,.2); color: var(--secondary); }
.ln-why { font-size: 16px; line-height: 1.35; color: var(--secondary); margin: 8px 0 10px; }
.ln-an { font-size: 14px; margin-top: 10px; line-height: 1.35; }
.ln-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
.ln-stats-big { grid-template-columns: repeat(2, 1fr); margin: 14px 0; }
.ln-stats small { display: block; font-size: 12px; color: var(--secondary); margin-bottom: 2px; }
.ln-stats span { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.ln-pnl { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ln-ord { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; background: var(--card); border-radius: 12px; margin-bottom: 6px; font-size: 15px; }
.ln-ord-t { color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.ln-ord-v { margin-left: auto; font-variant-numeric: tabular-nums; }
.ln-ord small { color: var(--secondary); font-size: 12px; }
.ln-empty { color: var(--secondary); font-size: 16px; padding: 14px 4px; }
.ln-note { color: var(--secondary); font-size: 14px; padding: 6px 4px 0; line-height: 1.35; }
.ln-screen-btn { display: block; width: 100%; min-height: 44px; margin: 22px 0 10px; border-radius: 14px; background: transparent; border: 1px solid rgba(255,255,255,0.14); color: var(--secondary); font-size: 15px; font-weight: 600; }
.ln-screen-btn.on { color: #7dffc0; border-color: rgba(34,240,122,.35); }
body.ln-lock { overflow: hidden; }
.ln-sheet { position: fixed; inset: 0; z-index: 80; background: #07070b; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ln-sheet.hidden { display: none; }
.ln-sheet-in { max-width: 430px; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.ln-sheet-hd { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.ln-close { min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--card2); font-size: 16px; font-weight: 600; color: var(--text); }
.ln-sheet-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ln-sheet-t b { font-size: 20px; font-weight: 700; }
.ln-sheet-t small { font-size: 13px; color: var(--secondary); overflow-wrap: anywhere; }
.ln-px { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 0; }
.ln-px span { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ln-px small { font-size: 13px; color: var(--secondary); }
.ln-chart-wrap { margin: 10px 0 4px; background: var(--card); border-radius: 16px; padding: 8px; border: 1px solid rgba(255,255,255,0.06); }
.ln-chart { width: 100%; height: 240px; position: relative; }
.ln-chart.hidden { display: none; }
.ln-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--secondary); margin: 6px 4px 0; }
.ln-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.ln-sub-h { font-size: 13px; font-weight: 650; color: var(--secondary); margin-bottom: 8px; }
.ln-ev { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; background: var(--card); border-radius: 12px; margin-bottom: 6px; font-size: 15px; }
.ln-ev span { color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.ln-ev small { margin-left: auto; color: var(--secondary); }
.ln-more { display: block; width: 100%; min-height: 48px; border-radius: 14px; background: var(--card2); color: var(--text); font-size: 16px; font-weight: 600; margin: 4px 0 8px; }

/* Live list: full list, nothing clipped, clear of the fixed tab bar + home indicator */
body.on-live .app { overflow: visible; padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px) + 32px); }
.live { min-height: 0; padding-bottom: 24px; }
.ln-coin-nm b { overflow-wrap: anywhere; }
.ln-coin-top { align-items: flex-start; }
.ln-stats > div { min-width: 0; }
.ln-why { overflow-wrap: anywhere; }
.ln-count { text-align: center; color: var(--secondary); font-size: 14px; padding: 6px 0 4px; }
#ln-coins, .ln { overflow: visible; height: auto; max-height: none; }
