/* ═══════════════════════════════════════════════════════════════════════════
   NEXUS · 星环模拟交易所
   Design system + trading terminal + arena + API console
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #05080e;
  --bg-soft: #070c15;
  --panel: rgba(14, 22, 36, 0.84);
  --panel-solid: #0b1220;
  --panel-raised: rgba(20, 31, 49, 0.72);
  --border: rgba(148, 169, 200, 0.12);
  --border-strong: rgba(186, 204, 228, 0.2);
  --text: #e8eef8;
  --text-soft: #b9c5d8;
  --muted: #7e8da5;
  --muted-2: #56647b;
  --gold: #e6c17b;
  --gold-bright: #f5dda8;
  --gold-soft: rgba(230, 193, 123, 0.12);
  --cyan: #63d4ff;
  --cyan-soft: rgba(99, 212, 255, 0.11);
  --up: #ff5d75;
  --up-bright: #ff8295;
  --up-soft: rgba(255, 93, 117, 0.12);
  --down: #2fd3a2;
  --down-bright: #63e7bd;
  --down-soft: rgba(47, 211, 162, 0.11);
  --flat: #95a2b7;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", "JetBrains Mono", "Roboto Mono",
    Consolas, "Liberation Mono", monospace;
  --topbar-h: 66px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(30, 48, 78, 0.28), transparent 70%),
    linear-gradient(180deg, #05080e 0%, #05080e 55%, #04070c 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection { background: rgba(230, 193, 123, 0.28); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; }
code, pre, kbd, .num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.align-right { text-align: right; }
.num { text-align: right; }
.up-text { color: var(--up); }
.down-text { color: var(--down); }
.flat-text { color: var(--flat); }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--flat) !important; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 169, 200, 0.16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 169, 200, 0.28); }

/* ── ambient background ─────────────────────────────────────────────────── */
.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -3;
  filter: blur(110px);
  opacity: 0.5;
}
.ambient-a {
  top: -280px;
  left: -120px;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(214, 170, 92, 0.16), transparent 68%);
}
.ambient-b {
  right: -220px;
  top: 26%;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(63, 150, 210, 0.12), transparent 68%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.16;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.25) 70%, transparent 100%);
}

/* ── top bar ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 34px;
  height: var(--topbar-h);
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(5, 8, 14, 0.96), rgba(5, 8, 14, 0.74));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(150%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  min-width: 220px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px rgba(230, 193, 123, 0.13));
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-name {
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0.19em;
  background: linear-gradient(100deg, #fff 10%, #f0d4a0 55%, #91ddff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { font-size: 9.5px; letter-spacing: 0.23em; color: var(--muted); }
.brand-beta {
  margin-left: 1px;
  padding: 2px 5px;
  border: 1px solid rgba(230, 193, 123, 0.3);
  border-radius: 4px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(148, 169, 200, 0.1);
  border-radius: 10px;
  background: rgba(11, 17, 28, 0.55);
}
.nav-btn {
  position: relative;
  padding: 7px 17px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 520;
  letter-spacing: 0.03em;
  transition: color 160ms ease, background 160ms ease;
}
.nav-btn:hover { color: var(--text-soft); }
.main-nav a.nav-btn { text-decoration: none; }
.nav-btn.active {
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(230, 193, 123, 0.13), rgba(230, 193, 123, 0.05));
  box-shadow: inset 0 0 0 1px rgba(230, 193, 123, 0.14);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sim-clock {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.clock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(230, 193, 123, 0.08), 0 0 12px rgba(230, 193, 123, 0.6);
  animation: breathe 2.8s ease-in-out infinite;
}
.clock-stack { display: flex; flex-direction: column; gap: 1px; }
#simClock {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.clock-sub { font-size: 8.5px; color: var(--muted-2); letter-spacing: 0.04em; }

.conn-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(13, 20, 32, 0.5);
  font-size: 10px;
  transition: all 200ms ease;
}
.conn-badge .conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--flat);
}
.conn-badge.live { color: var(--down); border-color: rgba(47, 211, 162, 0.18); background: rgba(47, 211, 162, 0.055); }
.conn-badge.live .conn-dot { background: var(--down); box-shadow: 0 0 9px rgba(47, 211, 162, 0.7); animation: breathe 2s infinite; }
.conn-badge.connecting { color: var(--gold); border-color: rgba(230, 193, 123, 0.2); }
.conn-badge.connecting .conn-dot { background: var(--gold); animation: breathe 1.2s infinite; }
.conn-badge.offline { color: var(--up); border-color: rgba(255, 93, 117, 0.2); }
.conn-badge.offline .conn-dot { background: var(--up); }

.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease;
  text-align: left;
}
.account-chip:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border); }
.account-avatar {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #161006;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(145deg, #f6e2b4, #cfa963);
  box-shadow: 0 0 20px rgba(230, 193, 123, 0.15);
}
.account-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.account-name { font-size: 10.5px; color: var(--muted); max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-equity { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text); }

.icon-btn {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: all 150ms ease;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); border-color: var(--border); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.small { width: 26px; height: 26px; }
.icon-btn.small svg { width: 14px; height: 14px; }
.mobile-only { display: none !important; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.app-main {
  max-width: 1920px;
  margin: 0 auto;
  padding: 16px 20px 0;
}
.view { display: none; }
.view.active { display: block; animation: viewIn 360ms cubic-bezier(0.22, 1, 0.36, 1); }

.trade-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 344px;
  gap: 14px;
  align-items: start;
}
.center-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.market-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  height: calc(100vh - var(--topbar-h) - 28px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trade-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  max-height: calc(100vh - var(--topbar-h) - 28px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 1px;
  scrollbar-width: none;
}
.trade-panel::-webkit-scrollbar { display: none; }

.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(17, 27, 44, 0.82), rgba(8, 13, 22, 0.9));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 19%);
}

.panel-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--down);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.live-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--down);
  box-shadow: 0 0 8px rgba(47, 211, 162, 0.7);
  animation: breathe 2s infinite;
}

/* ── index card ─────────────────────────────────────────────────────────── */
.index-card { flex: none; padding: 14px 14px 12px; }
.index-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.index-name { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.index-name span { color: var(--muted-2); font-family: var(--mono); font-size: 8.5px; margin-left: 4px; letter-spacing: 0.06em; }
.index-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 27px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--text);
}
.index-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.index-change.up { background: var(--up-soft); color: var(--up) !important; }
.index-change.down { background: var(--down-soft); color: var(--down) !important; }
.index-spark { height: 52px; margin: 10px -4px 8px; }
.index-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.breadth-row { display: flex; flex-direction: column; gap: 6px; }
.breadth-labels { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--muted); }
.breadth-labels b { font-family: var(--mono); font-size: 10px; font-weight: 600; }
.breadth-labels .up-text b { color: var(--up); }
.breadth-labels .down-text b { color: var(--down); }
.breadth-track {
  display: flex;
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  gap: 2px;
}
.breadth-track i { display: block; height: 100%; transition: width 500ms cubic-bezier(0.2, 0.8, 0.2, 1); }
#breadthBarUp { background: var(--up); }
#breadthBarFlat { background: rgba(149, 162, 183, 0.42); }
#breadthBarDown { background: var(--down); }

/* ── market browser ─────────────────────────────────────────────────────── */
.market-browser {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(15, 24, 39, 0.86), rgba(7, 12, 21, 0.92));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 11px 11px 8px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 9, 16, 0.6);
  transition: border-color 160ms ease, background 160ms ease;
}
.search-field:focus-within { border-color: rgba(230, 193, 123, 0.35); background: rgba(7, 12, 20, 0.9); }
.search-field svg { width: 14px; height: 14px; color: var(--muted-2); flex: none; }
.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 11.5px;
  color: var(--text);
}
.search-field input::placeholder { color: var(--muted-2); }
.search-field kbd {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.browser-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 0 11px 9px;
}
.sector-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  row-gap: 5px;
  overflow: visible;
  padding-bottom: 2px;
  flex: 1;
  min-width: 0;
}
.chip {
  flex: none;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  transition: all 140ms ease;
}
.chip:hover { color: var(--text-soft); background: rgba(255, 255, 255, 0.035); }
.chip.active {
  color: var(--gold-bright);
  border-color: rgba(230, 193, 123, 0.2);
  background: rgba(230, 193, 123, 0.08);
}
.chip .chip-dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.mini-select {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(7, 12, 20, 0.8);
  color: var(--muted);
  font-size: 9px;
  padding: 3px 4px;
  outline: none;
}
.stock-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 74px;
  gap: 7px;
  padding: 7px 11px 6px 38px;
  border-top: 1px solid rgba(148, 169, 200, 0.06);
  border-bottom: 1px solid rgba(148, 169, 200, 0.06);
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}
.stock-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px 6px;
}
.stock-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 46px 76px;
  align-items: center;
  gap: 5px;
  min-height: 47px;
  padding: 5px 7px 5px 5px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 120ms ease;
}
.stock-row:hover { background: rgba(255, 255, 255, 0.035); }
.stock-row.active { background: linear-gradient(90deg, rgba(230, 193, 123, 0.09), rgba(230, 193, 123, 0.025)); border-left-color: var(--gold); }
.stock-row.flash-up { animation: rowFlashUp 600ms ease; }
.stock-row.flash-down { animation: rowFlashDown 600ms ease; }
.watch-star {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: rgba(148, 169, 200, 0.26);
  border-radius: 4px;
}
.watch-star:hover { color: var(--gold); background: rgba(230, 193, 123, 0.08); }
.watch-star svg { width: 12px; height: 12px; }
.watch-star.on { color: var(--gold); }
.watch-star.on svg { fill: currentColor; }
.stock-ident { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stock-ident b {
  font-size: 11.5px;
  font-weight: 560;
  color: var(--text-soft);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stock-row.active .stock-ident b { color: var(--text); }
.stock-ident span {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-spark { height: 22px; opacity: 0.86; }
.stock-spark svg { width: 100%; height: 100%; display: block; }
.stock-quote { display: flex; flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.3; }
.stock-price { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--text); }
.stock-change { font-family: var(--mono); font-size: 9px; font-weight: 560; }
.rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-top: 1px solid rgba(148, 169, 200, 0.06);
  color: var(--muted-2);
  font-size: 8.5px;
}
.rail-foot .foot-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: 1px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(230, 193, 123, 0.5);
}
.ghost-mini {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 8px;
  color: var(--muted);
  transition: all 140ms ease;
}
.ghost-mini:hover, .ghost-mini.active { color: var(--gold); border-color: rgba(230, 193, 123, 0.22); }
.list-skeleton {
  height: 45px;
  margin: 4px 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.stock-empty { padding: 38px 12px; text-align: center; color: var(--muted-2); font-size: 10px; }

/* ── stock hero ─────────────────────────────────────────────────────────── */
.stock-hero { padding: 15px 17px 0; flex: none; }
.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-id { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.sector-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(99, 212, 255, 0.08);
  border: 1px solid rgba(99, 212, 255, 0.14);
  color: var(--cyan);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.hero-code { font-family: var(--mono); font-size: 9.5px; color: var(--muted); letter-spacing: 0.08em; }
.hero-board {
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 8px;
}
.hero-tags { display: flex; gap: 4px; }
.hero-tag {
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(230, 193, 123, 0.08);
  color: var(--gold);
  font-size: 8px;
}
.hero-actions { display: flex; align-items: center; gap: 2px; }
.hero-actions .icon-btn.on { color: var(--gold); }
.hero-actions .icon-btn.on svg { fill: currentColor; }
.hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 9px;
}
.hero-name-wrap { min-width: 0; }
.hero-name {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-sub { margin-top: 4px; font-size: 9.5px; color: var(--muted); letter-spacing: 0.02em; }
.hero-quote { text-align: right; flex: none; }
.hero-price {
  font-family: var(--mono);
  font-size: 37px;
  line-height: 0.95;
  font-weight: 610;
  letter-spacing: -0.045em;
  color: var(--text);
  transition: color 160ms ease;
}
.hero-price.up { color: var(--up) !important; }
.hero-price.down { color: var(--down) !important; }
.hero-change {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 560;
}
.hero-change .chg-pill {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
}
.hero-change .chg-pill.up { background: var(--up-soft); }
.hero-change .chg-pill.down { background: var(--down-soft); }
.hero-change .chg-base { color: var(--muted-2); font-size: 8px; letter-spacing: 0.05em; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 13px -17px 0;
  border-top: 1px solid rgba(148, 169, 200, 0.07);
}
.hero-stat { padding: 9px 10px 11px 17px; border-right: 1px solid rgba(148, 169, 200, 0.06); min-width: 0; }
.hero-stat:last-child { border-right: 0; }
.hero-stat span { display: block; font-size: 8px; color: var(--muted-2); letter-spacing: 0.05em; margin-bottom: 2px; }
.hero-stat b { font-family: var(--mono); font-size: 10.5px; font-weight: 560; color: var(--text-soft); white-space: nowrap; }

/* ── chart ──────────────────────────────────────────────────────────────── */
.chart-card { flex: none; }
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 43px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.07);
}
.chart-toolbar-left, .chart-toolbar-right { display: flex; align-items: center; gap: 7px; }
.interval-group {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: rgba(5, 9, 16, 0.56);
  border: 1px solid rgba(148, 169, 200, 0.07);
  border-radius: 6px;
}
.interval-group button {
  min-width: 31px;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  transition: all 130ms ease;
}
.interval-group button:hover { color: var(--text-soft); }
.interval-group button.active { color: var(--gold-bright); background: rgba(230, 193, 123, 0.1); }
.toolbar-divider { width: 1px; height: 15px; background: var(--border); margin: 0 2px; }
.indicator-toggle {
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  transition: all 130ms ease;
}
.indicator-toggle.active { color: var(--gold); background: rgba(230, 193, 123, 0.07); }
.chart-source { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.chart-source i { width: 4px; height: 4px; border-radius: 50%; background: var(--down); box-shadow: 0 0 7px rgba(47, 211, 162, 0.6); }
.chart-shell { position: relative; height: 395px; }
.price-chart { position: absolute; inset: 0; }
.chart-legend {
  position: absolute;
  z-index: 4;
  top: 9px;
  left: 12px;
  display: flex;
  gap: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  pointer-events: none;
}
.chart-legend b { color: var(--text-soft); font-weight: 500; }
.chart-watermark {
  position: absolute;
  z-index: 1;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(230, 193, 123, 0.035);
  font-family: var(--mono);
  font-size: 54px;
  font-weight: 700;
  letter-spacing: 0.12em;
  pointer-events: none;
  white-space: nowrap;
}
.chart-watermark span { font-size: 18px; margin-left: 10px; letter-spacing: 0.02em; color: rgba(230, 193, 123, 0.05); }
.chart-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(7, 11, 19, 0.5);
  color: var(--muted);
  font-size: 10px;
  backdrop-filter: blur(3px);
}

/* ── order flow ─────────────────────────────────────────────────────────── */
.flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
}
.book-card, .tape-card { min-width: 0; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.07);
}
.card-title { font-size: 11.5px; font-weight: 620; color: var(--text); letter-spacing: 0.01em; }
.card-sub { margin-left: 7px; font-size: 8.5px; color: var(--muted-2); }
.book-depth-label, .tape-pulse {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.tape-pulse { display: flex; align-items: center; gap: 4px; color: var(--down); }
.tape-pulse i { width: 4px; height: 4px; border-radius: 50%; background: var(--down); box-shadow: 0 0 6px rgba(47, 211, 162, 0.7); animation: breathe 2s infinite; }
.book-head, .tape-head {
  display: grid;
  align-items: center;
  padding: 5px 12px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(148, 169, 200, 0.04);
}
.book-head { grid-template-columns: 1fr 74px 74px; }
.tape-head { grid-template-columns: 56px 1fr 74px 40px; }
.book-ladder { min-height: 298px; padding: 2px 5px 5px; }
.book-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 74px 74px;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 9.5px;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
}
.book-row:hover { background: rgba(255, 255, 255, 0.045); }
.book-row > span { position: relative; z-index: 2; }
.book-row .bqty, .book-row .btotal { text-align: right; color: var(--muted); font-size: 8.8px; }
.book-bar {
  position: absolute;
  right: 0;
  top: 1px;
  bottom: 1px;
  z-index: 1;
  border-radius: 2px;
  transition: width 220ms ease;
}
.book-row.ask .book-bar { background: linear-gradient(90deg, rgba(47, 211, 162, 0.02), rgba(47, 211, 162, 0.12)); }
.book-row.bid .book-bar { background: linear-gradient(90deg, rgba(255, 93, 117, 0.02), rgba(255, 93, 117, 0.12)); }
.book-row.ask .bprice { color: var(--down); }
.book-row.bid .bprice { color: var(--up); }
.book-row.best .bprice { font-weight: 650; }
.book-side-empty {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 4px;
  border-radius: 4px;
  border: 1px dashed rgba(148, 169, 200, 0.12);
  font-size: 8px;
  letter-spacing: 0.03em;
}
.book-spread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 23px;
  margin: 2px 6px;
  padding: 0 7px;
  border-top: 1px solid rgba(148, 169, 200, 0.06);
  border-bottom: 1px solid rgba(148, 169, 200, 0.06);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}
.book-spread-row b { color: var(--gold); font-weight: 500; }
.tape-list { height: 298px; overflow-y: auto; padding: 2px 5px 5px; }
.tape-row {
  display: grid;
  grid-template-columns: 56px 1fr 74px 40px;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  animation: tapeIn 220ms ease;
}
.tape-row:nth-child(odd) { background: rgba(255, 255, 255, 0.012); }
.tape-row .t-time { color: var(--muted-2); font-size: 8px; }
.tape-row .t-price { font-weight: 560; }
.tape-row .t-qty { text-align: right; color: var(--muted); }
.tape-row .t-side { text-align: right; font-size: 8px; font-weight: 600; }
.tape-row.buy .t-price, .tape-row.buy .t-side { color: var(--up); }
.tape-row.sell .t-price, .tape-row.sell .t-side { color: var(--down); }
.empty-state { padding: 36px 18px; text-align: center; color: var(--muted-2); font-size: 10.5px; }
.empty-state.compact { padding: 28px 10px; }

/* ── blotter ────────────────────────────────────────────────────────────── */
.blotter { min-height: 258px; }
.blotter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 11px;
  height: 43px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.07);
}
.blotter-tab {
  position: relative;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
  border-radius: 5px;
  transition: all 140ms ease;
}
.blotter-tab:hover { color: var(--text-soft); background: rgba(255, 255, 255, 0.028); }
.blotter-tab.active { color: var(--gold-bright); }
.blotter-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(230, 193, 123, 0.6);
}
.blotter-tab span { margin-left: 3px; color: var(--muted-2); font-family: var(--mono); font-size: 8px; }
.blotter-tab .dot-indicator { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--up); vertical-align: 2px; }
.blotter-actions { margin-left: auto; display: flex; gap: 5px; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9.5px;
  transition: all 150ms ease;
  background: rgba(255, 255, 255, 0.01);
}
.ghost-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.ghost-btn.danger:hover { color: var(--up); border-color: rgba(255, 93, 117, 0.3); background: var(--up-soft); }
.blotter-body { max-height: 320px; overflow: auto; }
.data-table { width: 100%; min-width: 620px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 12px;
  background: rgba(9, 15, 25, 0.96);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(148, 169, 200, 0.06);
}
.data-table th.num { text-align: right; }
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.035);
  font-size: 9.5px;
  color: var(--text-soft);
  white-space: nowrap;
}
.data-table td.num { text-align: right; font-family: var(--mono); }
.data-table tbody tr { transition: background 120ms ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.data-table .sym { font-family: var(--mono); color: var(--muted); font-size: 8.5px; }
.data-table .name-cell b { font-weight: 560; color: var(--text); }
.data-table .name-cell span { display: block; color: var(--muted-2); font-family: var(--mono); font-size: 8px; }
.table-action {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 8px;
  transition: all 120ms ease;
}
.table-action:hover { color: var(--up); border-color: rgba(255, 93, 117, 0.25); }
.table-action.amber:hover { color: var(--gold); border-color: rgba(230, 193, 123, 0.25); }
.side-tag { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 3px; font-size: 8px; font-weight: 600; }
.side-tag.buy { color: var(--up); background: var(--up-soft); }
.side-tag.sell { color: var(--down); background: var(--down-soft); }
.status-tag { display: inline-flex; padding: 1px 5px; border-radius: 3px; font-size: 8px; background: rgba(148, 169, 200, 0.07); color: var(--muted); }
.status-tag.live { color: var(--gold); background: var(--gold-soft); }
.status-tag.filled { color: var(--down); background: var(--down-soft); }
.status-tag.cancelled { color: var(--muted-2); background: rgba(148, 169, 200, 0.05); }
.status-tag.rejected { color: var(--up); background: var(--up-soft); }
.news-feed { padding: 6px 0; }
.news-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.04);
}
.news-time { font-family: var(--mono); font-size: 8px; color: var(--muted-2); padding-top: 2px; }
.news-content { min-width: 0; }
.news-title { font-size: 10.5px; color: var(--text-soft); line-height: 1.45; }
.news-summary { margin-top: 3px; font-size: 9px; color: var(--muted-2); line-height: 1.5; }
.news-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.news-sentiment { font-size: 7.5px; padding: 1px 4px; border-radius: 3px; }
.news-sentiment.positive { color: var(--up); background: var(--up-soft); }
.news-sentiment.negative { color: var(--down); background: var(--down-soft); }
.news-sentiment.neutral { color: var(--gold); background: var(--gold-soft); }
.news-symbol { font-family: var(--mono); font-size: 8px; color: var(--muted-2); }

/* ── order panel ────────────────────────────────────────────────────────── */
.account-card { padding: 14px 15px 11px; flex: none; }
.account-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.big-equity {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -0.03em;
}
.rank-chip {
  padding: 3px 7px;
  border: 1px solid rgba(230, 193, 123, 0.18);
  border-radius: 4px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8.5px;
  background: rgba(230, 193, 123, 0.055);
}
.account-kind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.account-kind-row > span { color: var(--muted-2); font-size: 8px; }
.account-kind-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}
.account-kind-btn::after { content: '↔'; opacity: 0.5; }
.account-kind-btn.human { color: var(--gold); border-color: rgba(230, 193, 123, 0.2); background: var(--gold-soft); }
.account-kind-btn.agent { color: #b3a1ff; border-color: rgba(167, 139, 250, 0.24); background: rgba(167, 139, 250, 0.08); }
.account-kind-btn.guest { color: var(--muted-2); }
.account-kind-btn:hover { filter: brightness(1.2); }
.account-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 12px;
}
.account-mini-grid div { display: flex; flex-direction: column; gap: 1px; }
.account-mini-grid span { font-size: 8px; color: var(--muted-2); }
.account-mini-grid b { font-family: var(--mono); font-size: 10px; font-weight: 540; color: var(--text-soft); }
.equity-spark { height: 30px; margin: 8px -3px -4px; opacity: 0.9; }
.equity-spark svg { width: 100%; height: 100%; }

.order-ticket { padding: 13px; flex: none; }
.side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background: rgba(5, 9, 16, 0.62);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.side-toggle button {
  padding: 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.08em;
  transition: all 160ms ease;
}
.side-toggle button.active.buy { color: #fff; background: linear-gradient(180deg, #df425c, #bd2d46); box-shadow: 0 6px 18px rgba(223, 66, 92, 0.2); }
.side-toggle button.active.sell { color: #041710; background: linear-gradient(180deg, #4ae6b5, #23b98a); box-shadow: 0 6px 18px rgba(47, 211, 162, 0.16); }
.side-toggle button:hover:not(.active) { color: var(--text-soft); background: rgba(255, 255, 255, 0.03); }
.ticket-symbol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 1px 10px;
}
.ticket-symbol { font-family: var(--mono); font-size: 11px; color: var(--text); letter-spacing: 0.03em; }
.ticket-name { margin-left: 6px; font-size: 9px; color: var(--muted); }
.ticket-market { font-family: var(--mono); font-size: 8px; color: var(--muted-2); }
.order-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.07);
  margin-bottom: 10px;
}
.order-type-tabs button {
  position: relative;
  padding: 6px 4px 8px;
  color: var(--muted-2);
  font-size: 9.5px;
  transition: color 140ms ease;
}
.order-type-tabs button:hover { color: var(--text-soft); }
.order-type-tabs button.active { color: var(--gold-bright); }
.order-type-tabs button.active::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: -1px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(230, 193, 123, 0.5);
}
.ticket-fields { display: flex; flex-direction: column; gap: 9px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8.5px;
}
.field-label em { color: var(--muted-2); font-family: var(--mono); font-size: 7.5px; font-style: normal; }
.stepper {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(5, 9, 16, 0.5);
  overflow: hidden;
  transition: border-color 150ms ease;
}
.stepper:focus-within { border-color: rgba(230, 193, 123, 0.3); }
.stepper button { height: 100%; color: var(--muted); font-size: 15px; transition: all 120ms ease; }
.stepper button:hover { color: var(--gold); background: rgba(230, 193, 123, 0.06); }
.stepper input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 560;
  color: var(--text);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-price-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.quick-price-row button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 7.5px;
  transition: all 120ms ease;
}
.quick-price-row button:hover { color: var(--text-soft); background: rgba(255, 255, 255, 0.035); border-color: var(--border); }
.quick-price-row b { font-family: var(--mono); font-weight: 500; color: var(--muted); }
.qty-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.qty-presets button, .percent-row button {
  padding: 3px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  transition: all 120ms ease;
}
.qty-presets button:hover, .percent-row button:hover { color: var(--gold); background: rgba(230, 193, 123, 0.055); border-color: rgba(230, 193, 123, 0.12); }
.percent-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 1px; }
.ticket-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.minimal-select-wrap { display: flex; align-items: center; gap: 5px; min-width: 0; }
.minimal-select-wrap span { font-size: 8px; color: var(--muted-2); white-space: nowrap; }
.minimal-select-wrap select {
  max-width: 118px;
  padding: 2px 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  background: rgba(5, 9, 16, 0.55);
  color: var(--muted);
  font-size: 8px;
}
.check-row { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; cursor: pointer; }
.check-row input { accent-color: var(--gold); width: 11px; height: 11px; margin: 0; }
.ticket-summary {
  border-top: 1px solid rgba(148, 169, 200, 0.07);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ticket-summary div { display: flex; align-items: center; justify-content: space-between; }
.ticket-summary span { font-size: 8px; color: var(--muted-2); }
.ticket-summary b { font-family: var(--mono); font-size: 9px; font-weight: 500; color: var(--text-soft); }
.submit-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border-radius: 8px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: 0.03em;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}
.submit-order.buy { background: linear-gradient(100deg, #e3435c, #b72a43); box-shadow: 0 10px 26px rgba(210, 52, 77, 0.18); }
.submit-order.sell { background: linear-gradient(100deg, #3cdaa9, #149d74); color: #04140f; box-shadow: 0 10px 26px rgba(35, 185, 138, 0.14); }
.submit-order:hover:not(:disabled) { filter: brightness(1.09); transform: translateY(-1px); }
.submit-order:active:not(:disabled) { transform: translateY(0); }
.submit-order:disabled { opacity: 0.42; cursor: not-allowed; }
.submit-order kbd { padding: 2px 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.16); color: rgba(255, 255, 255, 0.65); font-size: 7px; }
.submit-order.sell kbd { color: rgba(0, 0, 0, 0.45); background: rgba(0, 0, 0, 0.08); }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 7.5px; }
.agent-mini { padding: 12px 14px; flex: none; }
.agent-mini-head { display: flex; align-items: center; gap: 8px; }
.agent-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(99, 212, 255, 0.1);
  border: 1px solid rgba(99, 212, 255, 0.18);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.agent-mini-head div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.agent-mini-head b { font-size: 10.5px; color: var(--text-soft); font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-mini-head span { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; }
.online-pill { display: flex; align-items: center; gap: 4px; font-size: 7.5px; color: var(--down); }
.online-pill i { width: 4px; height: 4px; border-radius: 50%; background: var(--down); box-shadow: 0 0 6px rgba(47, 211, 162, 0.6); }
.agent-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 8px; }
.agent-metrics div { display: flex; flex-direction: column; gap: 1px; }
.agent-metrics span { font-size: 7.5px; color: var(--muted-2); }
.agent-metrics b { font-family: var(--mono); font-size: 9.5px; font-weight: 500; color: var(--text-soft); }
.api-link-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 8.5px;
  transition: all 140ms ease;
}
.api-link-btn:hover { color: var(--gold); border-color: rgba(230, 193, 123, 0.2); background: rgba(230, 193, 123, 0.04); }
.api-link-btn svg { width: 12px; height: 12px; }
.side-disclaimer { padding: 0 5px 16px; color: rgba(86, 100, 123, 0.8); font-size: 7.5px; line-height: 1.6; }

/* ── arena ──────────────────────────────────────────────────────────────── */
.arena-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 20px;
  min-height: 322px;
  padding: 38px 44px;
  background:
    radial-gradient(700px 300px at 12% 0%, rgba(230, 193, 123, 0.09), transparent 70%),
    radial-gradient(600px 340px at 88% 80%, rgba(53, 137, 190, 0.12), transparent 72%),
    linear-gradient(145deg, rgba(20, 31, 48, 0.9), rgba(6, 10, 17, 0.96));
}
.arena-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 169, 200, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 169, 200, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 65% 45%, #000, transparent 70%);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
}
.arena-hero-copy h1 {
  margin-top: 21px;
  font-size: clamp(32px, 3.5vw, 49px);
  line-height: 1.15;
  font-weight: 640;
  letter-spacing: -0.04em;
  color: #f4f7fb;
}
.arena-hero-copy h1 span {
  background: linear-gradient(95deg, #fff 5%, #f0d7a3 48%, #83d7f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.arena-hero-copy p {
  max-width: 620px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}
.arena-metric-row { display: flex; gap: 30px; margin-top: 25px; }
.arena-metric { display: flex; flex-direction: column; gap: 2px; }
.arena-metric span { font-size: 8px; color: var(--muted-2); letter-spacing: 0.05em; }
.arena-metric b { font-family: var(--mono); font-size: 19px; font-weight: 560; color: var(--text); }
.arena-metric b.gold { color: var(--gold); }
.arena-hero-visual { position: relative; min-height: 250px; display: flex; align-items: center; justify-content: center; }
.arena-ring {
  position: absolute;
  border: 1px solid rgba(230, 193, 123, 0.12);
  border-radius: 50%;
}
.ring-one { width: 260px; height: 260px; animation: spin 36s linear infinite; border-style: dashed; }
.ring-two { width: 370px; height: 370px; border-color: rgba(99, 212, 255, 0.07); animation: spin 58s linear infinite reverse; }
.arena-index-badge {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 178px;
  height: 178px;
  border-radius: 50%;
  border: 1px solid rgba(230, 193, 123, 0.2);
  background: radial-gradient(circle at 40% 35%, rgba(230, 193, 123, 0.12), rgba(7, 12, 20, 0.92) 65%);
  box-shadow: 0 0 80px rgba(230, 193, 123, 0.06), inset 0 0 32px rgba(230, 193, 123, 0.04);
}
.arena-index-badge span { font-family: var(--mono); font-size: 8px; color: var(--muted); letter-spacing: 0.14em; }
.arena-index-badge b { margin-top: 6px; font-family: var(--mono); font-size: 25px; font-weight: 540; letter-spacing: -0.03em; }
.arena-index-badge em { margin-top: 2px; font-family: var(--mono); font-size: 9px; font-style: normal; }
.arena-hero-spark { position: absolute; bottom: 15px; left: 0; right: 0; height: 40px; opacity: 0.5; }
.arena-hero-spark svg { width: 100%; height: 100%; }
.arena-float-chip {
  position: absolute;
  z-index: 3;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(8, 13, 22, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}
.arena-float-chip span { display: block; font-family: var(--mono); font-size: 7px; color: var(--muted-2); letter-spacing: 0.08em; }
.arena-float-chip b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--text); font-weight: 560; }
.chip-a { top: 15px; right: 8px; }
.chip-b { bottom: 28px; left: 4px; }

.arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.arena-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.podium-card {
  position: relative;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(240px 120px at 50% -10%, rgba(230, 193, 123, 0.08), transparent 70%),
    linear-gradient(160deg, rgba(18, 29, 46, 0.84), rgba(7, 12, 21, 0.94));
  overflow: hidden;
}
.podium-card.first { border-color: rgba(230, 193, 123, 0.25); box-shadow: 0 0 44px rgba(230, 193, 123, 0.055); }
.podium-card.second { border-color: rgba(193, 210, 230, 0.16); }
.podium-card.third { border-color: rgba(200, 154, 105, 0.14); }
.podium-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
}
.podium-rank .medal { font-size: 15px; }
.podium-card.first .medal { color: var(--gold); }
.podium-card.second .medal { color: #cbd6e6; }
.podium-card.third .medal { color: #c69263; }
.podium-name { margin-top: 9px; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-kind { margin-top: 2px; font-size: 8px; color: var(--muted-2); }
.podium-return { margin-top: 10px; font-family: var(--mono); font-size: 25px; font-weight: 560; letter-spacing: -0.03em; }
.podium-spark { height: 27px; margin-top: 3px; opacity: 0.75; }
.podium-spark svg { width: 100%; height: 100%; }
.podium-foot { display: flex; justify-content: space-between; margin-top: 3px; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.podium-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted-2); font-size: 10px; }

.leaderboard-card { min-width: 0; }
.leaderboard-head { flex-wrap: wrap; }
.leaderboard-filters { display: flex; align-items: center; gap: 4px; }
.filter-chip {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 8.5px;
  transition: all 130ms ease;
}
.filter-chip:hover { color: var(--text-soft); }
.filter-chip.active { color: var(--gold); background: rgba(230, 193, 123, 0.07); border-color: rgba(230, 193, 123, 0.13); }
.table-wrap { overflow-x: auto; }
.leaderboard-table { width: 100%; min-width: 780px; }
.leaderboard-table th {
  padding: 8px 12px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(148, 169, 200, 0.07);
}
.leaderboard-table th.num { text-align: right; }
.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.04);
  color: var(--text-soft);
  font-size: 10px;
  white-space: nowrap;
}
.leaderboard-table td.num { text-align: right; font-family: var(--mono); }
.leaderboard-table tbody tr { cursor: pointer; transition: background 120ms ease; }
.leaderboard-table tbody tr:hover { background: rgba(255, 255, 255, 0.028); }
.leaderboard-table tbody tr.selected { background: linear-gradient(90deg, rgba(230, 193, 123, 0.07), transparent); }
.lb-rank { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lb-rank.top1 { color: var(--gold); }
.lb-rank.top2 { color: #cbd6e6; }
.lb-rank.top3 { color: #c69263; }
.lb-agent { display: flex; align-items: center; gap: 8px; }
.lb-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(99, 212, 255, 0.07);
  border: 1px solid rgba(99, 212, 255, 0.12);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}
.lb-avatar.house { color: var(--gold); background: rgba(230, 193, 123, 0.07); border-color: rgba(230, 193, 123, 0.14); }
.lb-agent-info { display: flex; flex-direction: column; gap: 1px; }
.lb-agent-info b { font-weight: 560; color: var(--text); font-size: 10px; }
.lb-agent-info span { font-family: var(--mono); color: var(--muted-2); font-size: 7.5px; }
.me-badge { padding: 1px 4px; margin-left: 4px; border-radius: 3px; background: var(--gold-soft); color: var(--gold); font-size: 7px; font-style: normal; }
.kind-tag { display: inline-flex; padding: 1px 5px; border-radius: 3px; font-size: 7.5px; color: var(--muted); background: rgba(148, 169, 200, 0.06); }
.kind-tag.house { color: var(--gold); background: var(--gold-soft); }
.kind-tag.human { color: var(--cyan); background: var(--cyan-soft); }
.online-dot { display: inline-flex; align-items: center; gap: 4px; font-size: 8px; color: var(--muted-2); }
.online-dot i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.online-dot.on { color: var(--down); }
.online-dot.on i { background: var(--down); box-shadow: 0 0 6px rgba(47, 211, 162, 0.65); }
.leaderboard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: var(--muted-2); font-size: 8px; }
.pulse-note { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.pulse-note i { width: 4px; height: 4px; border-radius: 50%; background: var(--down); animation: breathe 2s infinite; }
.arena-rules { padding-bottom: 14px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(148, 169, 200, 0.06); }
.rules-grid > div { padding: 17px; background: rgba(10, 16, 27, 0.88); }
.rule-no { font-family: var(--mono); font-size: 8px; color: var(--gold); }
.rules-grid b { display: block; margin-top: 6px; font-size: 11px; color: var(--text-soft); }
.rules-grid p { margin-top: 5px; color: var(--muted-2); font-size: 9px; line-height: 1.65; }

.arena-detail {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  min-height: 540px;
  padding: 17px;
  max-height: calc(100vh - var(--topbar-h) - 28px);
  overflow-y: auto;
}
.agent-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 500px; text-align: center; }
.agent-detail-empty h3 { margin-top: 24px; font-size: 14px; font-weight: 560; color: var(--text-soft); }
.agent-detail-empty p { max-width: 220px; margin-top: 7px; color: var(--muted-2); font-size: 9.5px; line-height: 1.7; }
.empty-orbit { position: relative; width: 108px; height: 108px; display: grid; place-items: center; }
.empty-orbit b {
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(230, 193, 123, 0.22);
  background: rgba(230, 193, 123, 0.05);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}
.empty-orbit span { position: absolute; inset: 12px; border: 1px dashed rgba(148, 169, 200, 0.17); border-radius: 50%; animation: spin 22s linear infinite; }
.empty-orbit span:last-of-type { inset: 0; animation-direction: reverse; animation-duration: 36s; border-color: rgba(99, 212, 255, 0.1); }
.detail-top { display: flex; align-items: center; gap: 10px; }
.detail-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(99, 212, 255, 0.08);
  border: 1px solid rgba(99, 212, 255, 0.16);
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 650;
  font-size: 13px;
}
.detail-avatar.house { color: var(--gold); border-color: rgba(230, 193, 123, 0.2); background: rgba(230, 193, 123, 0.07); }
.detail-name-wrap { flex: 1; min-width: 0; }
.detail-name { font-size: 13px; font-weight: 600; color: var(--text); }
.detail-sub { margin-top: 2px; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.detail-close { color: var(--muted-2); font-size: 18px; padding: 2px 6px; }
.detail-hero { margin-top: 17px; }
.detail-equity { font-family: var(--mono); font-size: 31px; font-weight: 560; letter-spacing: -0.04em; }
.detail-return { display: flex; gap: 8px; margin-top: 3px; font-family: var(--mono); font-size: 9.5px; }
.detail-chart { height: 92px; margin: 9px -4px 0; }
.detail-chart svg { width: 100%; height: 100%; }
.detail-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; margin-top: 14px; background: rgba(148, 169, 200, 0.06); border: 1px solid rgba(148, 169, 200, 0.05); }
.detail-stat { padding: 9px 8px; background: rgba(10, 16, 27, 0.9); }
.detail-stat span { display: block; font-size: 7.5px; color: var(--muted-2); }
.detail-stat b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text-soft); }
.detail-section { margin-top: 16px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.detail-section-head b { font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; }
.detail-section-head span { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.detail-positions { display: flex; flex-direction: column; gap: 2px; }
.detail-position { display: grid; grid-template-columns: 1fr 54px 66px; gap: 4px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(148, 169, 200, 0.04); }
.detail-position b { font-size: 9px; font-weight: 500; color: var(--text-soft); }
.detail-position span { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.detail-position em { font-family: var(--mono); font-size: 8px; font-style: normal; text-align: right; }
.detail-fill { display: grid; grid-template-columns: 42px 1fr 58px; gap: 4px; padding: 4px 0; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.detail-fill b { color: var(--text-soft); font-weight: 500; }
.detail-empty-line { padding: 12px 0; color: var(--muted-2); font-size: 8.5px; }

/* ── API view ───────────────────────────────────────────────────────────── */
.api-hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 36px;
  align-items: center;
  padding: 38px 44px;
  background:
    radial-gradient(700px 320px at 12% 10%, rgba(230, 193, 123, 0.08), transparent 70%),
    radial-gradient(620px 320px at 88% 90%, rgba(56, 148, 205, 0.1), transparent 70%),
    linear-gradient(145deg, rgba(18, 29, 46, 0.88), rgba(6, 10, 17, 0.96));
}
.api-hero h1 {
  margin-top: 19px;
  font-size: clamp(32px, 3.2vw, 47px);
  line-height: 1.14;
  font-weight: 640;
  letter-spacing: -0.04em;
}
.api-hero h1 span {
  background: linear-gradient(95deg, #fff 5%, #f0d7a3 48%, #83d7f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.api-hero p { max-width: 580px; margin-top: 14px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.api-hero-actions { display: flex; gap: 8px; margin-top: 23px; }
.primary-btn {
  padding: 9px 15px;
  border-radius: 7px;
  background: linear-gradient(100deg, #f0d29a, #d3ac66);
  color: #1b1306;
  font-size: 10px;
  font-weight: 650;
  box-shadow: 0 10px 28px rgba(230, 193, 123, 0.12);
  transition: filter 150ms ease, transform 150ms ease;
}
.primary-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.api-terminal {
  border: 1px solid rgba(148, 169, 200, 0.15);
  border-radius: 10px;
  background: rgba(4, 8, 14, 0.8);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.09);
  background: rgba(255, 255, 255, 0.02);
}
.terminal-head span { width: 6px; height: 6px; border-radius: 50%; background: rgba(148, 169, 200, 0.22); }
.terminal-head span:first-child { background: rgba(255, 93, 117, 0.55); }
.terminal-head span:nth-child(2) { background: rgba(230, 193, 123, 0.55); }
.terminal-head span:nth-child(3) { background: rgba(47, 211, 162, 0.55); }
.terminal-head b { margin-left: 7px; color: var(--muted-2); font-family: var(--mono); font-size: 7.5px; font-weight: 400; }
.api-terminal pre { margin: 0; padding: 17px; overflow-x: auto; color: var(--text-soft); font-size: 10px; line-height: 1.85; }
.t-dim { color: var(--muted-2); }
.t-cyan { color: var(--cyan); }
.t-key { color: #cfae74; }
.t-num { color: #9ae4c4; }
.t-str { color: #c7b7e8; }
.t-ok { color: var(--down); }

.api-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.api-main, .api-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.api-credentials { padding-bottom: 13px; }
.secure-pill {
  padding: 2px 6px;
  border: 1px solid rgba(230, 193, 123, 0.18);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 13px; background: rgba(148, 169, 200, 0.07); border: 1px solid rgba(148, 169, 200, 0.05); }
.credential-item { position: relative; padding: 10px 12px; background: rgba(8, 13, 22, 0.9); }
.credential-item.wide { grid-column: span 1; }
.credential-item.key-item { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.credential-item > span { display: block; margin-bottom: 4px; font-size: 7.5px; color: var(--muted-2); }
.credential-item code { display: block; color: var(--text-soft); font-size: 9.5px; word-break: break-all; }
.credential-item.key-item > span { grid-column: 1 / -1; margin-bottom: -3px; }
.credential-item.key-item code { font-size: 10px; color: var(--gold-bright); }
.copy-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted-2);
  transition: all 120ms ease;
}
.copy-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
  box-shadow: 3px -3px 0 -1px var(--panel-solid), 3px -3px 0 0 currentColor;
}
.copy-icon:hover { color: var(--gold); border-color: rgba(230, 193, 123, 0.24); }
.credential-note { display: flex; gap: 6px; margin: 9px 13px 0; padding: 7px 8px; border-radius: 5px; background: rgba(230, 193, 123, 0.045); color: var(--muted-2); font-size: 8px; line-height: 1.55; }
.warn-icon { width: 13px; height: 13px; flex: none; display: grid; place-items: center; border: 1px solid rgba(230, 193, 123, 0.25); border-radius: 50%; color: var(--gold); font-family: var(--mono); font-size: 7px; }
.code-tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 5px; }
.code-tabs button { padding: 3px 8px; border-radius: 3px; color: var(--muted-2); font-family: var(--mono); font-size: 7.5px; }
.code-tabs button.active { color: var(--gold); background: rgba(230, 193, 123, 0.08); }
.code-block { margin: 0; padding: 0; background: rgba(4, 8, 14, 0.55); }
.code-block pre { margin: 0; padding: 15px 16px; overflow-x: auto; color: var(--text-soft); font-size: 9.5px; line-height: 1.75; }
.code-block .c-key { color: #cfae74; }
.code-block .c-str { color: #a9ddc8; }
.code-block .c-com { color: var(--muted-2); }
.endpoint-list { padding: 2px 0; }
.endpoint-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(148, 169, 200, 0.04);
  transition: background 120ms ease;
}
.endpoint-row:hover { background: rgba(255, 255, 255, 0.022); }
.method { font-family: var(--mono); font-size: 7px; font-weight: 600; padding: 2px 3px; border-radius: 3px; text-align: center; }
.method.get { color: var(--down); background: var(--down-soft); }
.method.post { color: var(--gold); background: var(--gold-soft); }
.method.delete { color: var(--up); background: var(--up-soft); }
.endpoint-row code { font-size: 8.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; }
.endpoint-row p { color: var(--muted-2); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-version { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); letter-spacing: 0.08em; }
.ws-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(148, 169, 200, 0.06); }
.ws-step { padding: 12px 14px; background: rgba(8, 13, 22, 0.86); display: flex; flex-direction: column; gap: 3px; }
.ws-step span { font-family: var(--mono); font-size: 7px; color: var(--gold); }
.ws-step b { font-size: 9.5px; color: var(--text-soft); }
.ws-step code { font-size: 7.5px; color: var(--muted-2); word-break: break-all; }
.ws-channels { display: flex; flex-wrap: wrap; gap: 5px; padding: 11px 14px; }
.ws-channels span { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.ws-channels i { width: 4px; height: 4px; border-radius: 50%; }
.ch-market { background: var(--gold); }
.ch-book { background: var(--cyan); }
.ch-trade { background: var(--up); }
.ch-leader { background: #a78bfa; }
.ch-news { background: #fb923c; }
.ch-private { background: var(--down); }
.prompt-card { overflow: hidden; }
.prompt-preview { margin: 0; padding: 14px 16px; background: rgba(4, 8, 14, 0.5); color: var(--muted); font-size: 8.5px; line-height: 1.7; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.rule-card, .sample-agent-card, .sandbox-card, .links-card { padding: 15px; }
.rule-list { margin-top: 9px; display: flex; flex-direction: column; gap: 0; }
.rule-list div { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(148, 169, 200, 0.045); }
.rule-list span { font-size: 8.5px; color: var(--muted-2); }
.rule-list b { font-family: var(--mono); font-size: 9px; font-weight: 500; color: var(--text-soft); }
.sample-agent-card h3, .sandbox-card h3 { margin-top: 11px; font-size: 13px; font-weight: 560; color: var(--text-soft); }
.sample-agent-card p, .sandbox-card p { margin-top: 5px; color: var(--muted-2); font-size: 9px; line-height: 1.65; }
.sample-agent-card pre { margin: 10px 0; padding: 8px 9px; border: 1px solid var(--border); border-radius: 5px; background: rgba(4, 8, 14, 0.5); color: var(--cyan); font-size: 8px; line-height: 1.7; overflow-x: auto; }
.text-link { display: inline-block; margin-top: 3px; color: var(--gold); font-size: 8.5px; }
.text-link:hover { color: var(--gold-bright); }
.sandbox-orbit { position: relative; width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 4px; }
.sandbox-orbit b { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(230, 193, 123, 0.22); color: var(--gold); font-family: var(--mono); font-size: 9px; }
.sandbox-orbit span, .sandbox-orbit i { position: absolute; inset: 4px; border: 1px dashed rgba(148, 169, 200, 0.2); border-radius: 50%; animation: spin 20s linear infinite; }
.sandbox-orbit i { inset: 0; border-color: rgba(99, 212, 255, 0.1); animation-direction: reverse; animation-duration: 30s; }
.links-card { display: flex; flex-direction: column; gap: 1px; }
.links-card .panel-kicker { margin-bottom: 8px; }
.links-card a { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 8.5px; border-bottom: 1px solid rgba(148, 169, 200, 0.04); }
.links-card a:hover { color: var(--gold); }
.links-card a span { color: var(--muted-2); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: 1920px;
  margin: 30px auto 0;
  padding: 18px 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted-2);
  font-size: 8px;
  border-top: 1px solid rgba(148, 169, 200, 0.06);
}
.site-footer span:first-child { color: var(--muted); font-family: var(--mono); letter-spacing: 0.12em; }

/* ── toasts / modals ────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  z-index: 300;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(330px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 10px;
  padding: 10px 12px 10px 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(10, 17, 28, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  animation: toastIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.toast::before { content: ""; background: var(--gold); border-radius: 0 3px 3px 0; }
.toast.success::before { background: var(--down); }
.toast.error::before { background: var(--up); }
.toast.info::before { background: var(--cyan); }
.toast-body { min-width: 0; }
.toast-title { font-size: 9.5px; font-weight: 600; color: var(--text); }
.toast-text { margin-top: 2px; font-size: 8.5px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.toast.leaving { animation: toastOut 220ms ease forwards; }

.modal-root { position: fixed; inset: 0; z-index: 400; display: none; }
.modal-root.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(10px);
  animation: fadeIn 180ms ease;
}
.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(230, 193, 123, 0.2);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(20, 32, 50, 0.98), rgba(7, 12, 21, 0.99));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 80px rgba(230, 193, 123, 0.045);
  animation: modalIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted-2);
  font-size: 18px;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.modal-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--gold); font-family: var(--mono); font-size: 8px; letter-spacing: 0.15em; }
.modal-title { margin-top: 13px; font-size: 23px; line-height: 1.2; font-weight: 620; letter-spacing: -0.03em; }
.modal-title span { display: block; color: var(--gold); }
.modal-desc { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.modal-account { display: flex; align-items: center; gap: 10px; margin-top: 17px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(5, 9, 16, 0.45); }
.modal-account .account-avatar { width: 35px; height: 35px; font-size: 12px; }
.modal-account-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.modal-account-info b { font-size: 12px; color: var(--text); }
.modal-account-info span { font-family: var(--mono); font-size: 8px; color: var(--muted-2); }
.modal-balance { text-align: right; }
.modal-balance span { display: block; font-size: 7px; color: var(--muted-2); }
.modal-balance b { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.key-reveal {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(230, 193, 123, 0.18);
  border-radius: 7px;
  background: rgba(230, 193, 123, 0.045);
}
.key-reveal-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.key-reveal-label span:last-child { color: var(--gold); font-family: var(--mono); font-size: 7px; }
.key-reveal code { display: block; margin-top: 6px; color: var(--gold-bright); font-family: var(--mono); font-size: 11px; word-break: break-all; line-height: 1.5; }
.key-actions { display: flex; gap: 6px; margin-top: 8px; }
.modal-warning { margin-top: 11px; color: var(--muted-2); font-size: 8.5px; line-height: 1.65; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .primary-btn, .modal-actions .ghost-btn { flex: 1; text-align: center; padding: 10px; }
.confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 93, 117, 0.25); color: var(--up); font-size: 18px; }
.confirm-message { margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.7; }

/* ── boot ───────────────────────────────────────────────────────────────── */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 400px at 50% 38%, rgba(230, 193, 123, 0.06), transparent 70%),
    #05080e;
  transition: opacity 500ms ease, visibility 500ms ease;
}
.boot-overlay.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark {
  width: 72px;
  height: 72px;
  animation: bootFloat 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(230, 193, 123, 0.16));
}
.boot-title { margin-top: 18px; font-family: var(--mono); font-size: 19px; letter-spacing: 0.34em; color: var(--gold-bright); }
.boot-text { margin-top: 9px; color: var(--muted-2); font-size: 9.5px; letter-spacing: 0.05em; }
.boot-bar { width: 180px; height: 2px; margin-top: 20px; border-radius: 99px; background: rgba(230, 193, 123, 0.1); overflow: hidden; }
.boot-bar i { display: block; width: 38%; height: 100%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: bootScan 1.4s ease-in-out infinite; }

/* ── rail drawer scrim ──────────────────────────────────────────────────── */
.rail-scrim { display: none; }

/* ── animations ─────────────────────────────────────────────────────────── */
@keyframes breathe { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -48%) scale(0.985); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }
@keyframes bootFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bootScan { 0% { transform: translateX(-110%); } 100% { transform: translateX(420%); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rowFlashUp { 0% { background: rgba(255, 93, 117, 0.16); } 100% { background: transparent; } }
@keyframes rowFlashDown { 0% { background: rgba(47, 211, 162, 0.14); } 100% { background: transparent; } }
@keyframes tapeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1500px) {
  .trade-layout { grid-template-columns: 278px minmax(0, 1fr) 326px; }
  .hero-stat { padding-left: 13px; }
  .hero-price { font-size: 34px; }
}

@media (max-width: 1280px) {
  .topbar { gap: 20px; padding: 0 16px; }
  .brand { min-width: 190px; }
  .brand-sub { letter-spacing: 0.15em; }
  .account-name { max-width: 86px; }
  .trade-layout { grid-template-columns: 258px minmax(0, 1fr) 310px; gap: 11px; }
  .app-main { padding: 13px 14px 0; }
  .hero-name { font-size: 22px; }
  .hero-price { font-size: 31px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-stat:nth-child(3) { border-right: 0; }
  .hero-stat:nth-child(n+4) { border-top: 1px solid rgba(148, 169, 200, 0.05); }
  .chart-shell { height: 360px; }
  .arena-hero { padding: 32px; }
  .arena-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1130px) {
  .mobile-only { display: grid !important; }
  .topbar { gap: 14px; }
  .brand { min-width: 0; }
  .brand-sub { display: none; }
  .main-nav { margin-left: 0; }
  .sim-clock { padding: 5px 9px; }
  .trade-layout { grid-template-columns: minmax(0, 1fr) 318px; }
  .market-rail {
    position: fixed;
    z-index: 120;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(330px, calc(100vw - 54px));
    height: 100vh;
    padding: 12px;
    background: #070c15;
    border-right: 1px solid var(--border);
    transform: translateX(-104%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45);
    min-height: 0;
  }
  .market-rail.open { transform: none; }
  .rail-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(2, 5, 9, 0.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }
  .rail-scrim.open { opacity: 1; pointer-events: auto; }
  .market-browser { min-height: 0; }
  .arena-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .api-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .api-hero { padding: 30px; gap: 22px; }
  .arena-hero { grid-template-columns: 1fr 0.7fr; }
  .arena-hero-visual { transform: scale(0.9); }
}

@media (max-width: 940px) {
  .topbar { height: 60px; padding: 0 12px; gap: 10px; }
  :root { --topbar-h: 60px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 15px; }
  .main-nav { padding: 3px; }
  .nav-btn { padding: 6px 11px; font-size: 11px; }
  .sim-clock { display: none; }
  .account-equity { display: none; }
  .account-chip { padding: 4px 7px 4px 4px; }
  .account-avatar { width: 26px; height: 26px; }
  .trade-layout { grid-template-columns: 1fr; }
  .trade-panel { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
  .account-card, .order-ticket, .agent-mini, .side-disclaimer { min-width: 0; }
  .agent-mini { align-self: start; }
  .side-disclaimer { grid-column: 1 / -1; padding-bottom: 0; }
  .app-main { padding: 11px 10px 0; }
  .chart-shell { height: 340px; }
  .arena-hero { grid-template-columns: 1fr; min-height: 0; }
  .arena-hero-visual { display: none; }
  .arena-layout { grid-template-columns: 1fr; }
  .arena-detail { position: static; max-height: none; min-height: 0; }
  .agent-detail-empty { min-height: 210px; }
  .api-layout { grid-template-columns: 1fr; }
  .api-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .api-side .sandbox-card { grid-column: 1 / -1; }
  .api-hero { grid-template-columns: 1fr; }
  .api-terminal { display: none; }
  .arena-hero-copy h1, .api-hero h1 { font-size: 36px; }
  .podium-card { padding: 13px; }
  .podium-return { font-size: 21px; }
  .flow-grid { grid-template-columns: 1fr 1fr; }
  .book-head, .tape-head { font-size: 7.5px; }
  .site-footer { flex-wrap: wrap; gap: 6px 18px; }
}

@media (max-width: 720px) {
  .toast-stack { bottom: 10px; right: 10px; }
  .brand-copy { display: none; }
  .brand { gap: 4px; }
  .brand-beta { display: none; }
  .main-nav { margin-left: auto; }
  .nav-btn { padding: 6px 9px; font-size: 10.5px; }
  .conn-badge { padding: 5px 7px; }
  #connText { display: none; }
  .account-meta { display: none; }
  .account-chip { padding: 3px; }
  .hero-name { font-size: 20px; }
  .hero-price { font-size: 29px; }
  .hero-main { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero-quote { text-align: left; display: flex; align-items: baseline; gap: 9px; }
  .hero-change { margin-top: 0; justify-content: flex-start; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat { border-right: 0 !important; }
  .hero-stat:nth-child(odd) { border-right: 1px solid rgba(148, 169, 200, 0.06) !important; }
  .hero-stat:nth-child(n+3) { border-top: 1px solid rgba(148, 169, 200, 0.05); }
  .flow-grid { grid-template-columns: 1fr; }
  .trade-panel { grid-template-columns: 1fr; }
  .side-disclaimer { grid-column: auto; }
  .agent-mini { display: none; }
  .chart-shell { height: 300px; }
  .chart-legend { gap: 7px; font-size: 7.5px; }
  .chart-watermark { font-size: 36px; }
  .blotter-actions { display: none; }
  .blotter-tabs { overflow-x: auto; }
  .blotter-tab { flex: none; }
  .arena-hero { padding: 24px 20px; }
  .arena-hero-copy h1, .api-hero h1 { font-size: 30px; }
  .arena-metric-row { gap: 18px; flex-wrap: wrap; }
  .api-hero { padding: 25px 20px; }
  .api-hero-actions { flex-wrap: wrap; }
  .podium { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .api-side { grid-template-columns: 1fr; }
  .api-side .sandbox-card { grid-column: auto; }
  .credential-grid { grid-template-columns: 1fr; }
  .credential-item.wide { grid-column: auto; }
  .credential-item.key-item { grid-column: auto; grid-template-columns: 1fr auto; }
  .credential-item.key-item .ghost-mini { grid-column: 2; grid-row: 2; }
  .credential-item.key-item .copy-icon { grid-column: 2; grid-row: 3; }
  .endpoint-row { grid-template-columns: 38px 1fr; }
  .endpoint-row p { display: none; }
  .ws-flow { grid-template-columns: 1fr; }
  .card-head { flex-wrap: wrap; }
  .chart-toolbar { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
  .chart-toolbar-left { flex-wrap: wrap; }
  .chart-source { display: none; }
  .leaderboard-filters { margin-left: 0; }
  .leaderboard-head { gap: 8px; }
  .leaderboard-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .toast-stack { top: calc(var(--topbar-h) + 8px); right: 10px; }
}

@media (max-width: 480px) {
  .brand-mark { width: 28px; height: 28px; }
  .main-nav { padding: 2px; gap: 0; }
  .nav-btn { padding: 5px 7px; font-size: 9.5px; }
  .topbar { gap: 6px; }
  .hero-stats { margin-left: -13px; margin-right: -13px; }
  .hero-stat { padding-left: 12px; }
  .stock-hero { padding-left: 13px; padding-right: 13px; }
  .card-head { padding: 9px 11px; }
  .order-ticket { padding: 11px; }
  .account-card { padding: 12px; }
  .arena-metric b { font-size: 16px; }
  .site-footer { justify-content: flex-start; }
}
