:root {
  --bg: #11161f;
  --panel: #161d29;
  --panel-2: #121822;
  --line: #273142;
  --text: #e7edf7;
  --muted: #8091a7;
  --green: #17c784;
  --red: #ea3943;
  --blue: #4c8dff;
  --yellow: #f0b90b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.exchange-header {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line); background: #0f141c;
}
.brand-area { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4c8dff, #7f5cff); font-weight: 800;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy span { color: var(--muted); font-size: 12px; }
.main-nav, .header-actions { display: flex; align-items: center; gap: 18px; }
.main-nav a, .header-link { color: var(--muted); text-decoration: none; }
.main-nav a:hover, .header-link:hover { color: var(--text); }
.primary-btn, .ghost-btn, .buy-btn {
  border: none; border-radius: 10px; padding: 10px 14px; cursor: pointer;
}
.primary-btn { background: var(--blue); color: white; }
.ghost-btn { background: #1e2634; color: var(--text); border: 1px solid var(--line); }
.buy-btn { background: var(--green); color: #06130d; font-weight: 700; }
.full { width: 100%; }
.ticker-bar {
  display: grid; grid-template-columns: 1.2fr repeat(4, 1fr) auto; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #121822;
}
.pair-wrap { display: flex; align-items: center; gap: 12px; }
.pair-icon { width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.pair-main { font-size: 22px; font-weight: 800; }
.pair-sub, .ticker-stat span, .status-pill, .tools { color: var(--muted); font-size: 12px; }
.ticker-stat strong { display: block; margin-top: 4px; font-size: 16px; color: var(--text); }
.status-pill { align-self: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; }
.exchange-layout {
  flex: 1; display: grid; grid-template-columns: 260px minmax(560px, 1fr) 340px;
  gap: 10px; padding: 10px;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head.compact { padding-bottom: 8px; }
.market-panel, .right-stage { display: flex; flex-direction: column; gap: 10px; }
.market-panel { padding-bottom: 12px; }
.search {
  width: calc(100% - 28px); margin: 0 14px 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 10px;
}
.market-tabs, .order-tabs, .switch-row, .intervals { display: flex; gap: 8px; flex-wrap: wrap; }
.market-tabs { padding: 0 14px 12px; }
.tab, .mini-tab {
  background: #1a2230; color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; cursor: pointer;
}
.tab.active, .mini-tab.active { color: var(--text); background: #243147; }
.market-list { display: flex; flex-direction: column; }
.market-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; color: var(--muted); border: none; border-top: 1px solid rgba(255,255,255,0.03);
  background: transparent; text-align: left; cursor: pointer;
}
.market-left { display: flex; align-items: center; gap: 10px; }
.coin-mini { width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.market-row.active, .market-row:hover { background: #1a2230; color: var(--text); }
.up { color: var(--green); }
.down { color: var(--red); }
.center-stage { display: grid; grid-template-rows: 1fr 250px; gap: 10px; }
.chart-panel { display: flex; flex-direction: column; }
#chart { width: 100%; height: 100%; display: block; background: #111722; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.right-stage { display: grid; grid-template-rows: 1.15fr auto auto; }
.trade-head {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 10px 14px; font-size: 12px; color: var(--muted);
}
.book-list, .data-list { list-style: none; margin: 0; padding: 0 14px 14px; }
.book-list li, .data-list li {
  display: grid; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.book-list li { grid-template-columns: 1fr 1fr; }
.data-list li { grid-template-columns: repeat(4, 1fr); }
.dense li { font-size: 13px; }
.compact li { grid-template-columns: 1fr 1fr; }
.mid-price {
  padding: 10px 14px; font-size: 22px; font-weight: 700; color: var(--yellow);
  border-top: 1px solid rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stack-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.stack-form.slim { padding-top: 8px; }
.stack-form input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 11px 12px; border-radius: 10px;
}
.console-box {
  margin: 0 14px 14px; padding: 12px; min-height: 80px;
  background: #101621; border: 1px solid var(--line); border-radius: 10px; color: #9cb0cb; white-space: pre-wrap; overflow: auto;
}
.asset-box { padding: 0 14px 14px; }
.asset-title { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.muted-top { padding-top: 0; }
@media (max-width: 1280px) {
  .exchange-layout { grid-template-columns: 220px 1fr 320px; }
}
@media (max-width: 1080px) {
  .ticker-bar { grid-template-columns: repeat(2, 1fr); }
  .exchange-layout { grid-template-columns: 1fr; }
  .center-stage { grid-template-rows: auto auto; }
  .right-stage { grid-template-rows: auto; }
  .bottom-grid { grid-template-columns: 1fr; }
}
