:root {
  color-scheme: light;
  --ink: #17243d;
  --nav: #182748;
  --muted: #59677e;
  --line: #dce4f0;
  --surface: #fff;
  --background: #edf2f8;
  --blue: #3156c6;
  --blue-soft: #edf2ff;
  --positive: #127356;
  --negative: #ab3653;
  --warn: #8c5717;
  --data: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--background); color: var(--ink); font: 14px/1.55 var(--sans); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid #4c6ded; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { max-width: 1280px; width: calc(100% - 72px); margin-inline: auto; }
.topbar { background: var(--nav); color: #f5f8ff; }
.topbar-inner { height: 66px; display: flex; align-items: center; gap: 44px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; font-weight: 750; font-size: 16px; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #91a9ff; position: relative; display: inline-block; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; }
.brand-mark::before { inset: 5px; border: 1px solid #91a9ff; border-radius: 50%; }
.brand-mark::after { left: 12px; bottom: 12px; height: 2px; width: 13px; border-radius: 3px; transform: rotate(-42deg); transform-origin: left; background: #c0d2ff; }
.topbar nav { display: flex; align-items: center; gap: 24px; }
.topbar nav a { color: #ccd7ef; font-size: 13px; white-space: nowrap; }
.topbar nav a:hover { color: #fff; }
.mode { margin-left: auto; white-space: nowrap; color: #d9e4ff; border: 1px solid #546588; border-radius: 4px; padding: 3px 9px; font-size: 12px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 22px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 3.6vw, 43px); letter-spacing: -.055em; line-height: 1.12; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 9px; }
.refresh { display: flex; align-items: center; gap: 11px; flex: none; }
.feed-state, .refresh button { min-height: 34px; display: inline-flex; align-items: center; border: 1px solid #d4deee; background: var(--surface); padding: 5px 11px; border-radius: 6px; color: var(--ink); white-space: nowrap; font-size: 12px; }
.refresh button:hover { background: var(--blue-soft); }
.feed-state { gap: 7px; color: var(--muted); }
.feed-state i { width: 7px; height: 7px; border-radius: 50%; background: #8997ad; }
.feed-state.good { color: var(--positive); }
.feed-state.good i { background: var(--positive); box-shadow: 0 0 0 3px #e3f1e9; }
.feed-state.warn { color: var(--warn); }
.feed-state.warn i { background: #a9762c; }
.metrics { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--blue); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.metric { min-width: 0; padding: 14px 18px; display: grid; gap: 3px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric > span { color: var(--muted); font-size: 12px; }
.metric strong { font: 650 clamp(20px, 2.35vw, 30px)/1.22 var(--data); white-space: nowrap; letter-spacing: -.05em; }
.metric small { color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px 13px; }
.panel-heading h2 { font-size: 17px; font-weight: 780; }
.panel-heading > a, .muted { font-size: 12px; color: var(--muted); white-space: nowrap; }
.panel-heading > a:hover { color: var(--blue); }
.market-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 14px; padding: 0 18px; overflow-x: auto; }
.market-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 5px 0 9px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; white-space: nowrap; }
.market-tabs button[aria-pressed="true"] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.chart-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.odds-label { color: var(--muted); font-size: 11px; }
.odds-value { font: 650 clamp(26px, 4vw, 38px)/1.22 var(--data); letter-spacing: -.055em; }
.odds-delta { margin-left: 6px; font-size: 12px; color: var(--muted); }
.periods { display: flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; white-space: nowrap; }
.periods button { padding: 3px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; }
.periods button[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.plot { position: relative; height: 236px; margin: 8px 14px 0 15px; }
.plot canvas { width: 100%; height: 100%; display: block; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; font-size: 13px; }
.chart-tooltip { position: absolute; z-index: 1; top: 5px; padding: 5px 8px; border-radius: 4px; background: var(--nav); color: #fff; pointer-events: none; font: 11px/1.5 var(--data); white-space: nowrap; }
.chart-foot, .spot-footer { display: flex; justify-content: space-between; gap: 6px; padding: 10px 18px 13px; color: var(--muted); font-size: 11px; }
.spot-panel { display: flex; flex-direction: column; }
.spot-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spot-table th, .spot-table td { text-align: right; white-space: nowrap; }
.spot-table th { background: #f2f5fa; font-size: 11px; font-weight: 550; color: var(--muted); padding: 8px 11px; }
.spot-table td { border-bottom: 1px solid var(--line); padding: 15px 11px; font-family: var(--data); }
.spot-table th:first-child, .spot-table td:first-child { text-align: left; padding-left: 18px; }
.spot-table th:last-child, .spot-table td:last-child { padding-right: 18px; }
.spot-volume { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.35 var(--sans); }
.spot-table .table-empty { text-align: center; color: var(--muted); font: inherit; padding: 28px 12px; white-space: normal; }
.asset { display: inline-flex; align-items: center; gap: 8px; }
.asset-icon { width: 26px; height: 26px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; font: 700 13px var(--sans); }
.asset-pair { color: var(--muted); font-size: 10px; margin-left: 2px; }
.asset-icon.btc { color: #9b5b0b; background: #fff1d6; }
.asset-icon.eth { color: #505bbb; background: #edf0ff; }
.asset-icon.sol { color: #6152a8; background: #f0eafe; }
.asset-icon.bnb { color: #866410; background: #fff4ce; }
.spot-footer { margin-top: auto; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.activity-list { margin: 0; padding: 0 18px; list-style: none; }
.activity-row { padding: 11px 0; display: flex; align-items: baseline; gap: 13px; border-top: 1px solid var(--line); }
.activity-symbol { font: 650 12px var(--data); min-width: 45px; }
.activity-content { min-width: 0; flex: 1; }
.activity-content a, .activity-content strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.activity-content p, .activity-row time { color: var(--muted); font-size: 11px; margin-top: 2px; }
.activity-row time { flex: none; }
.empty-state { min-height: 116px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; }
.empty-icon { display: block; width: 17px; height: 12px; border: 1px solid #8b9ab6; border-radius: 3px; position: relative; }
.empty-icon::after { content: ""; position: absolute; inset: 3px 4px; border-block: 1px solid #8b9ab6; }
.position-state { font-size: 11px; color: var(--muted); background: #edf1f7; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.ledger-numbers { margin: 0 18px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger-numbers div { padding: 10px 0; }
.ledger-numbers div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.ledger-numbers dt { color: var(--muted); font-size: 11px; }
.ledger-numbers dd { margin: 3px 0 0; font: 650 16px var(--data); }
.ledger-panel .empty-state { min-height: 64px; }
.footer { display: flex; justify-content: space-between; color: var(--muted); margin: 16px 0 22px; font-size: 11px; }
@media (max-width: 930px) {
  .shell { width: calc(100% - 36px); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .asset { gap: 5px; }
  .spot-table td { padding-inline: 7px; }
}
@media (max-width: 730px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-head { margin-top: 26px; }
  .topbar-inner { gap: 18px; height: 58px; }
  .topbar nav { gap: 14px; }
  .metrics { margin-bottom: 12px; }
  .plot { height: 222px; }
  .spot-table td { padding-block: 11px; }
}
@media (max-width: 480px) {
  .shell { width: calc(100% - 24px); }
  .topbar-inner { gap: 8px; }
  .brand { gap: 7px; font-size: 13px; }
  .brand-mark { transform: scale(.86); transform-origin: left; margin-right: -3px; }
  .topbar nav { margin-left: auto; gap: 9px; }
  .topbar nav a { font-size: 11px; }
  .mode { display: none; }
  .page-head { align-items: start; }
  .page-head p { font-size: 12px; }
  .refresh { gap: 5px; }
  .refresh button, .feed-state { padding: 4px 6px; min-height: 29px; font-size: 10px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 11px 12px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .chart-head, .chart-foot, .panel-heading, .spot-footer { padding-left: 13px; padding-right: 13px; }
  .chart-head { gap: 5px; }
  .market-tabs, .activity-list { padding-inline: 13px; }
  .market-tabs { gap: 10px; }
  .market-tabs button { font-size: 11px; }
  .odds-delta { font-size: 10px; }
  .plot { height: 200px; margin-inline: 9px; }
  .activity-row { gap: 8px; }
  .activity-row time { font-size: 10px; }
}