:root {
  color-scheme: dark;
  --bg: #080b10; --panel: #10151d; --panel-2: #151b25; --line: #232b38;
  --text: #f1f5f9; --muted: #8490a3; --green: #28d99a; --red: #ff6577;
  --amber: #f5b942; --blue: #4c8dff; --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button { font: inherit; }
.topbar { height: 68px; padding: 0 22px; display: flex; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); background: rgba(8,11,16,.94); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.brand .mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: #171008; font-weight: 900; }
.brand div, .ticker { display: flex; flex-direction: column; }
.brand small, .ticker small, .card p, small { color: var(--muted); }
.brand small { font-size: 11px; margin-top: 2px; }
.ticker { margin-right: auto; }
.symbol-switch { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(21,27,37,.7); }
.symbol-tab { border: 0; border-radius: 7px; padding: 6px 13px; font-size: 12px; font-weight: 600; color: var(--muted); background: none; cursor: pointer; }
.symbol-tab:hover { color: var(--text); }
.symbol-tab.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(76,141,255,.35); }
.ticker span { font: 600 22px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ticker small { font-size: 10px; }
.status-row { display: flex; align-items: center; gap: 9px; }
.badge { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.badge.online { color: var(--green); background: rgba(40,217,154,.08); }
.badge.offline { color: var(--red); background: rgba(255,101,119,.08); }
.badge.paper { color: var(--amber); background: rgba(245,185,66,.08); border-color: rgba(245,185,66,.25); }
.layout { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--panel), #0d1219); box-shadow: 0 10px 35px rgba(0,0,0,.13); overflow: hidden; }
.card-head { min-height: 55px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.card h1, .card h2, .card p { margin: 0; }
.card h1 { font-size: 15px; } .card h2 { font-size: 13px; } .card p { margin-top: 3px; font-size: 11px; }
#chart { height: 570px; width: 100%; }
.chart-controls { padding: 8px 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(16,21,29,.6); font-size: 11px; }
.control-group { display: flex; align-items: center; gap: 6px; }
.control-label { color: var(--muted); font-size: 11px; font-weight: 500; }
.timeframe-switch, .indicator-switch { display: flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: rgba(21,27,37,.7); }
.tf-tab, .ind-tab { border: 0; border-radius: 5px; padding: 4px 8px; font-size: 11px; font-weight: 600; color: var(--muted); background: none; cursor: pointer; transition: all .15s ease; }
.tf-tab:hover, .ind-tab:hover { color: var(--text); }
.tf-tab.active, .ind-tab.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(76,141,255,.35); }
.indicator-legend { margin-left: auto; display: flex; align-items: center; gap: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.ind-val-ema21 { color: #26a69a; }
.ind-val-ema50 { color: #ffb74d; }
.ind-val-ema200 { color: #e040fb; font-weight: 600; }
.ind-val-boll { color: #42a5f5; }
.ind-val-kc { color: #ff7043; }
.ind-val-donchian { color: #66bb6a; }
.legend { display: flex; gap: 13px; font-size: 11px; }.long { color: var(--green); }.short { color: var(--red); }.exit { color: var(--amber); }.vol { color: var(--muted); }
.sidebar { display: grid; align-content: start; gap: 14px; }
.dot-label { font-size: 11px; color: var(--green); }.dot-label::before { content: "●"; margin-right: 5px; }
.equity { padding: 18px 15px 14px; display: flex; flex-direction: column; gap: 4px; }.equity strong { font: 600 28px ui-monospace, monospace; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }.metric-grid div { padding: 12px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }.metric-grid b { font: 500 13px ui-monospace, monospace; }
.empty { min-height: 140px; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 13px; }.empty small { padding-top: 7px; }
.position-data { padding: 13px 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.position-data div { display: flex; flex-direction: column; gap: 4px; }.position-data b { font: 500 12px ui-monospace, monospace; }
.button { border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer; color: var(--text); background: var(--panel-2); }.button:hover { filter: brightness(1.18); }.button:disabled { opacity: .35; cursor: not-allowed; }.button.ghost { border: 1px solid var(--line); }.button.danger { background: rgba(255,101,119,.14); color: var(--red); font-size: 11px; }
.button.long-btn { background: rgba(40,217,154,.14); color: var(--green); font-size: 11px; }
.button.short-btn { background: rgba(255,101,119,.14); color: var(--red); font-size: 11px; }
.manual-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 15px 14px; }
.dot-label.rule { color: var(--muted); font-size: 10px; }.dot-label.rule::before { content: none; }
.feed { min-height: 160px; }.event-feed { max-height: 200px; overflow: auto; }.event { padding: 9px 14px; display: grid; grid-template-columns: 62px 1fr; gap: 8px; border-bottom: 1px solid rgba(35,43,56,.65); font-size: 11px; }.event time { color: var(--muted); font-family: ui-monospace, monospace; }
.event em { display: inline-block; margin-right: 6px; padding: 1px 5px; border-radius: 4px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--amber); background: rgba(245,185,66,.12); }
.activity { grid-column: 1 / -1; min-height: 260px; }.tabs { height: 48px; display: flex; gap: 5px; align-items: end; padding: 0 14px; border-bottom: 1px solid var(--line); }.tab { border: 0; color: var(--muted); background: none; padding: 14px 11px 11px; cursor: pointer; border-bottom: 2px solid transparent; }.tab.active { color: var(--text); border-color: var(--blue); }
.table-wrap { overflow: auto; max-height: 340px; }table { width: 100%; border-collapse: collapse; font-size: 12px; }th, td { padding: 11px 15px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(35,43,56,.7); }th { position: sticky; top: 0; color: var(--muted); background: var(--panel); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }td { font-family: ui-monospace, monospace; }.hidden { display: none !important; }.positive { color: var(--green); }.negative { color: var(--red); }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; }.sidebar { grid-template-columns: 1fr 1fr; }.feed { grid-column: 1/-1; }.activity { grid-column: 1; }.brand { min-width: auto; }.brand small { display: none; } }
@media (max-width: 640px) { .topbar { padding: 0 12px; gap: 12px; }.ticker { margin-right: 0; }.status-row { margin-left: auto; }.badge.paper, #toggleButton { display: none; }.symbol-tab { padding: 5px 9px; font-size: 11px; }.manual-bar { grid-template-columns: 1fr 1fr; }.layout { padding: 8px; gap: 8px; }.sidebar { grid-template-columns: 1fr; }.feed { grid-column: auto; }#chart { height: 420px; }.legend { display: none; } }
