:root {
  --bg: #050711;
  --surface: #0b0d19;
  --surface-2: #101421;
  --line: #22283a;
  --text: #f2f6ff;
  --muted: #8b96ad;
  --cyan: #00e0ad;
  --green: #19d38a;
  --warn: #f5b84b;
  --red: #ff5c7a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
.shell { width: min(1560px, calc(100vw - 32px)); margin: 0 auto; padding: 24px 0 34px; }
.topbar, .section-head, .strategy-summary, .strategy-tile, .api-row, .order-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.topbar { margin-bottom: 14px; }
.eyebrow, h1, h2, h3, p { margin: 0; }
.eyebrow { color: var(--cyan); font-size: 13px; font-weight: 800; }
h1 { margin-top: 5px; font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 17px; }
p { color: var(--muted); font-size: 13px; }
button, .button-link { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; padding: 0 12px; }
button:hover, .button-link:hover { border-color: rgba(0, 224, 173, 0.55); color: var(--cyan); }
.button-link { display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; }
.top-actions, .exchange-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.exchange-tabs { margin: 0 0 12px; }
.exchange-tabs button { min-width: 82px; }
.exchange-tabs button.active { border-color: rgba(0, 224, 173, 0.7); background: rgba(0, 224, 173, 0.12); color: var(--cyan); }
.status-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric, .section, .strategy-card, .strategy-tile, .api-row, .api-form-wrap, .order-row { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric { min-height: 82px; padding: 15px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 22px; word-break: break-word; }
.section { padding: 14px; margin-top: 12px; }
.section-head { margin-bottom: 12px; }
.strategy-list, .api-list, .strategy-overview, .order-list { display: grid; gap: 10px; }
.strategy-card, .strategy-tile { padding: 14px; }
.strategy-summary p, .strategy-tile p { margin-top: 4px; }
.trade-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trade-layout .section { margin-top: 12px; }
.trade-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stat-badge { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; border: 1px solid rgba(0, 224, 173, 0.18); border-radius: 8px; background: rgba(0, 224, 173, 0.08); color: #d8fff3; font-size: 12px; font-weight: 800; padding: 4px 8px; }
.stat-badge b { color: var(--muted); font-weight: 700; }
.order-empty { min-height: 180px; }
.order-row { min-height: 68px; padding: 12px; }
.order-row p { margin-top: 4px; }
.boss-order { position: relative; display: grid; align-items: stretch; gap: 8px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.order-symbol strong { display: block; font-size: 16px; }
.order-symbol p { color: #cfe0ff; font-size: 13px; }
.order-status { position: absolute; top: 12px; right: 12px; min-height: 20px; display: inline-flex; align-items: center; border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 800; }
.order-status.open { border: 1px solid rgba(25, 211, 138, 0.45); color: var(--green); background: rgba(25, 211, 138, 0.08); }
.order-status.closed { border: 1px solid rgba(255, 92, 122, 0.48); color: var(--red); background: rgba(255, 92, 122, 0.08); }
.boss-order-lines { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; max-width: 620px; }
.boss-order-lines p { min-width: 0; margin: 0 0 5px; color: #dbe8ff; font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.boss-order-lines span { color: #8fb6ff; }
.boss-order-lines b { font-weight: 900; }
.order-values { display: grid; gap: 4px; justify-items: end; color: #c8d2e4; font-size: 13px; font-weight: 800; }
.pnl-pos { color: var(--green); }
.pnl-neg { color: var(--red); }
.summary-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge, .api-flags span { display: inline-flex; min-height: 26px; align-items: center; border-radius: 8px; padding: 3px 8px; background: rgba(139, 150, 173, 0.14); color: #c8d2e4; font-size: 12px; font-weight: 800; }
.badge.on { background: rgba(25, 211, 138, 0.13); color: var(--green); }
.badge.off { background: rgba(255, 92, 122, 0.12); color: var(--red); }
.locked-box { display: grid; gap: 6px; margin-top: 12px; padding: 10px; border: 1px solid rgba(245, 184, 75, 0.35); border-radius: 8px; background: rgba(245, 184, 75, 0.08); }
.locked-box strong { color: var(--warn); }
.locked-box span, .locked-box code { color: #f5d69a; font-size: 12px; white-space: normal; word-break: break-word; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
input, select { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); padding: 0 10px; }
input:focus, select:focus { outline: none; border-color: var(--cyan); }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--text); }
.check input { width: 16px; min-height: 16px; }
fieldset { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
legend { color: var(--cyan); font-size: 12px; font-weight: 800; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.api-row { padding: 12px; }
.api-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.api-form-wrap { padding: 12px; margin-bottom: 10px; }
.hidden { display: none; }
.empty { min-height: 72px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
@media (max-width: 1080px) {
  .status-grid, .form-grid, .form-grid.compact, .trade-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .section-head, .strategy-summary, .strategy-tile, .api-row, .order-row { align-items: flex-start; flex-direction: column; }
  .summary-badges { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .shell { width: min(100vw - 20px, 1560px); padding-top: 16px; }
  .status-grid, .form-grid, .form-grid.compact, .trade-layout { grid-template-columns: 1fr; }
  .boss-order-lines { grid-template-columns: 1fr; }
}

