:root {
  --bg: #071018;
  --panel: #101a24;
  --ink: #e7f0ea;
  --muted: #8aa196;
  --line: #1e2d28;
  --accent: #b6ff3a;
  --accent-dim: #6e9a22;
  --warn: #ffb020;
  --bad: #ff5c5c;
  --good: #3ee0a0;
  --mono: "IBM Plex Mono", "ui-monospace", Menlo, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { min-height: 100vh; }

.top {
  padding: 28px 28px 8px;
  display: flex;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 220px at 10% -40%, rgba(182, 255, 58, 0.12), transparent),
    linear-gradient(#0b1612, #071018);
}
.kicker {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent-dim);
}
h1 { margin: 4px 0 0; font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
.lede { max-width: 520px; color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 12px; }

.strategy-nav {
  display: flex;
  gap: 6px;
  padding: 12px 24px 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.strategy-tab {
  background: #101a24;
  border: 1px solid #2a3d34;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.strategy-tab.on {
  color: #05100a;
  background: var(--accent);
  font-weight: 650;
  border-color: var(--accent);
}
.strategy-panel { display: none; }
.strategy-panel.on { display: block; }
.kicker.inpage { margin: 16px 24px 0; }
.status-copy p { line-height: 1.5; color: var(--ink); }
.status-copy code { font-size: 12px; color: var(--accent); }
.mode-switch {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}
.mode-btn {
  border: 1px solid #2a3d34;
  background: #0a1410;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 650;
}
.mode-btn.on { background: var(--muted); color: #05100a; border-color: var(--muted); }
.mode-btn[data-arb-mode="monitor"].on { background: var(--accent); color: #05100a; border-color: var(--accent); }
.mode-btn.live.on { background: var(--bad); color: #fff; border-color: var(--bad); }
tr.hot { background: rgba(62, 224, 160, 0.10); }
tr.hot td:last-child { font-weight: 700; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px;
  overflow-x: auto;
}
.tab, .subtab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}
.tab.on, .subtab.on {
  color: #05100a;
  background: var(--accent);
  font-weight: 650;
}

.book-card { padding-top: 12px; }
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.subtab {
  border: 1px solid #2a3d34;
  padding: 6px 11px;
  font-size: 12px;
}
.subtab.on { border-color: var(--accent); }
.book-panel { display: none; }
.book-panel.on { display: block; }

.cs-grid th, .cs-grid td { text-align: center; }
.cs-grid th:first-child, .cs-grid td:first-child { text-align: left; }
.cs-grid td { min-width: 64px; vertical-align: middle; }
.cs-grid td strong { display: block; font-family: var(--mono); font-size: 13px; }
.cs-grid td small { color: var(--muted); font-size: 11px; }
.cs-grid td.modal { background: #16351f; }

main { padding: 8px 24px 48px; }
.panel { display: none; }
.panel.on { display: block; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
  margin: 12px 0;
}
h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 650; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
input, select {
  background: #0a1410;
  color: var(--ink);
  border: 1px solid #2a3d34;
  border-radius: 8px;
  padding: 8px 10px;
  font: 14px var(--mono);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
fieldset {
  border: 1px dashed #2a3d34;
  border-radius: 10px;
  margin: 8px 0 12px;
  padding: 10px 12px 4px;
}
legend { color: var(--muted); font-size: 11px; padding: 0 6px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #2a3d34;
  background: #15241c;
  color: var(--ink);
  padding: 8px 12px;
}
button.primary { background: var(--accent); color: #08140a; font-weight: 700; border-color: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi {
  background: #0a1410;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.kpi span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.kpi strong { font-size: 20px; font-family: var(--mono); }
.kpi em { display: block; font-style: normal; font-size: 12px; font-family: var(--mono); margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.dense td { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.clickable tbody tr { cursor: pointer; }
.clickable tbody tr:hover { background: #173023; }
.trades-table tr.hot { background: rgba(62, 224, 160, 0.08); }
.trades-table tr.best { box-shadow: inset 3px 0 0 var(--accent); }
.trades-table tr.hot td:last-child { font-weight: 600; }
.trades-table input.qty {
  width: 72px;
  padding: 4px 6px;
  font-size: 12px;
}
.trades-table button.place {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
}
.trades-table button.place:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.trades-table button.place.busy { opacity: 0.7; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.compare {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #0a1410;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.source {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #0a1410;
}
.source h3 { margin: 0 0 6px; font-size: 15px; }
.source p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.pill {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  margin-right: 6px;
}
.pill.on { background: #16351f; color: var(--good); }
.pill.off { background: #2a1d12; color: var(--warn); }
.source a { color: var(--accent); }

footer {
  padding: 16px 28px 28px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
code { color: var(--accent); }

@media (max-width: 900px) {
  .grid-2, .kpis, .row, .row.three { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}
