:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: #10151c;
  --panel2: #151b24;
  --line: #222c38;
  --text: #f6f8fb;
  --muted: #8996a8;
  --green: #42d392;
  --red: #ff5f6d;
  --amber: #f4bd50;
  --blue: #6ea8fe;
  --accent: #eef2f7;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; }
body { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app { width: min(100%, 980px); margin: 0 auto; padding: calc(14px + var(--safe-top)) 16px calc(92px + var(--safe-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.topbar h1 { margin: 3px 0 0; font-size: clamp(23px, 5vw, 32px); letter-spacing: -0.035em; }
.eyebrow { color: var(--green); font-size: 11px; letter-spacing: .18em; font-weight: 800; }
.header-actions { display: flex; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); color: var(--text); background: var(--panel); font-size: 20px; }
.demo-banner { padding: 11px 13px; border: 1px solid #5b4824; background: #201a10; color: #f4cf87; border-radius: 14px; font-size: 12px; margin-bottom: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-card { padding: 15px; min-height: 98px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel2), var(--panel)); border-radius: 18px; }
.summary-card .label { color: var(--muted); font-size: 12px; }
.summary-card .value { margin-top: 9px; font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.summary-card .sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin: 24px 2px 10px; }
.section-head h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 12px; }
.bot-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.bot-card, .position-card, .event-card, .settings-card { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; }
.bot-card { overflow: hidden; }
.bot-card-head { padding: 15px 15px 12px; display: flex; justify-content: space-between; align-items: center; }
.bot-id { display: flex; align-items: center; gap: 11px; }
.bot-logo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; background: #1d2632; border: 1px solid #2a3644; }
.bot-name strong { display: block; font-size: 16px; }
.bot-name small { color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; border: 1px solid var(--line); }
.status-pill.online { color: var(--green); background: rgba(66,211,146,.08); }
.status-pill.offline { color: var(--red); background: rgba(255,95,109,.08); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero-row { display: flex; justify-content: space-between; gap: 12px; padding: 0 15px 14px; }
.hero-row .side { font-size: 13px; font-weight: 800; }
.hero-row .price { text-align: right; }
.hero-row .price strong { display: block; font-size: 20px; letter-spacing: -.025em; }
.hero-row .price small { color: var(--muted); }
.long { color: var(--green); } .short { color: var(--red); } .waiting { color: var(--amber); }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { padding: 11px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric:nth-child(even) { border-right: 0; }
.metric:nth-last-child(-n+2) { border-bottom: 0; }
.metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 5px; font-size: 14px; }
.readiness { padding: 13px 15px 15px; }
.readiness-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 12px; }
.checks { display: flex; gap: 7px; flex-wrap: wrap; }
.check { padding: 6px 8px; border-radius: 9px; background: #0b1016; border: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.check.pass { color: var(--green); border-color: rgba(66,211,146,.22); }
.check.fail { color: var(--red); border-color: rgba(255,95,109,.22); }
.waiting-for { margin-top: 9px; color: var(--muted); font-size: 11px; }
.error-line { padding: 10px 15px; color: #ffc5ca; background: rgba(255,95,109,.08); border-top: 1px solid rgba(255,95,109,.2); font-size: 11px; }
.stack { display: grid; gap: 10px; }
.position-card { padding: 16px; }
.position-top { display: flex; justify-content: space-between; align-items: center; }
.position-top h3 { margin: 0; }
.position-pnl { font-size: 22px; font-weight: 900; margin: 15px 0; }
.position-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.position-grid div { padding: 9px; border-radius: 12px; background: #0b1016; }
.position-grid small { display: block; color: var(--muted); font-size: 10px; }
.position-grid strong { display: block; margin-top: 4px; font-size: 13px; }
.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
.event-card { padding: 13px 14px; display: grid; grid-template-columns: 42px 1fr; gap: 10px; }
.event-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #0b1016; }
.event-card strong { display: block; font-size: 13px; }
.event-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.settings-card { padding: 16px; margin-bottom: 11px; }
.settings-card h3 { margin: 0 0 6px; font-size: 15px; }
.settings-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.primary-btn, .secondary-btn, .ghost-btn { border: 0; border-radius: 13px; padding: 12px 14px; font-weight: 800; }
.primary-btn { width: 100%; background: var(--accent); color: #080b0f; }
.secondary-btn { background: var(--green); color: #06130d; }
.ghost-btn { background: #1a222d; color: var(--text); border: 1px solid var(--line); }
.bottom-nav { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 980px); display: grid; grid-template-columns: repeat(4,1fr); padding: 8px 8px calc(8px + var(--safe-bottom)); background: rgba(9,12,17,.94); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav-btn { background: transparent; border: 0; color: #738093; min-height: 52px; border-radius: 12px; }
.nav-btn span, .nav-btn small { display: block; }
.nav-btn span { font-size: 19px; margin-bottom: 3px; }
.nav-btn small { font-size: 9px; font-weight: 700; }
.nav-btn.active { color: var(--text); background: #121820; }
.tab-page { display: none; } .tab-page.active { display: block; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 15%, #182431, var(--bg) 42%); }
.login-card { width: min(100%, 390px); padding: 25px; border: 1px solid var(--line); background: rgba(16,21,28,.94); border-radius: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.38); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: #080b0f; font-weight: 950; font-size: 24px; }
.login-card h1 { margin: 18px 0 7px; font-size: 25px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 21px; color: var(--muted); font-size: 13px; }
.field-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.login-card input[type=password] { width: 100%; padding: 13px 14px; color: var(--text); background: #0b1016; border: 1px solid var(--line); border-radius: 13px; outline: none; }
.login-card input:focus { border-color: #536479; }
.remember { display: flex; gap: 8px; align-items: center; margin: 13px 0 17px; color: var(--muted); font-size: 12px; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--red); font-size: 11px; }
.menu { position: fixed; z-index: 50; top: calc(62px + var(--safe-top)); right: 16px; width: 180px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: #131922; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.menu button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 13px 14px; }
.menu button:last-child { border-bottom: 0; }
@media (min-width: 700px) {
  .summary-grid { grid-template-columns: repeat(4,1fr); }
  .bot-grid { grid-template-columns: repeat(2,1fr); }
}
