@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --base: #121113;
  --panel: #19181b;
  --panel-surface: #19181bef;
  --panel-raised: #222125;
  --line: #302e33;
  --line-bright: #454249;
  --ink: #f6f3ee;
  --muted: #ada8ae;
  --accent: #d1f48c;
  --negative: #ffa0ab;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --text-size: 16px;
  --sans: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  min-width: 300px;
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font: var(--text-size)/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 15px;
  background: var(--accent);
  color: var(--base);
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.topbar { position: relative; z-index: 4; }
.top-inner, main { width: min(1232px, calc(100% - 80px)); margin: 0 auto; }
.top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 67px;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--ink);
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.brand img { display: block; width: clamp(104px, 12vw, 151px); height: auto; }
nav { display: flex; align-items: center; gap: clamp(13px, 2.45vw, 35px); }
.nav-icon { display: none; }
nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline-start: 12px;
  color: var(--muted);
  font-size: var(--text-size);
  font-weight: 650;
  white-space: nowrap;
  transition: color .16s;
}
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] { color: var(--ink); }
nav a[aria-current="page"]::before {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(50% - 2.5px);
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
  content: '';
}

main { position: relative; z-index: 1; min-height: 100vh; padding-top: 28px; }
.hero {
  position: relative;
  display: flex;
  isolation: isolate;
  align-items: center;
  min-height: 141px;
  overflow: hidden;
  margin-bottom: 19px;
}
.matrix-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: .46;
  pointer-events: none;
}
.hero-content { padding-block: 12px; }
.hero h1 {
  margin: 8px 0 6px;
  font-size: clamp(36px, 4.2vw, 59px);
  font-weight: 770;
  line-height: 1.02;
  letter-spacing: -.058em;
}
.hero-description { color: var(--muted); font-size: var(--text-size); font-weight: 550; }
.data-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: -5px 0 12px;
  padding: 3px 2px;
  color: var(--muted);
  font-size: var(--text-size);
}
.data-source { display: flex; align-items: center; gap: 8px; color: #d9e1d1; white-space: nowrap; font-size: var(--text-size); font-weight: 700; }
.data-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #d4ae72; }
.streaming .data-dot { background: var(--accent); }
#data-status { text-align: right; }

.summary {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  padding: 6px 0;
  border-block: 1px solid var(--line);
}
.panel { min-width: 0; background: var(--panel-surface); border: 1px solid var(--line); border-radius: 12px; }
.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 95px;
  min-width: 0;
  padding: 10px 17px;
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric-title { color: var(--ink); font-size: var(--text-size); font-weight: 650; }
.metric-number {
  min-width: 0;
  margin: 3px 0 5px;
  color: var(--ink);
  font: 640 clamp(22px,2.4vw,32px)/1.13 var(--sans);
  letter-spacing: -.043em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-number small { margin-inline-start: .14em; color: var(--muted); font: 620 var(--text-size) var(--mono); letter-spacing: .035em; }
.metric-meta { color: var(--muted); font-size: var(--text-size); }
.positive { color: var(--accent); }
.negative { color: var(--negative); }

.market-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.chart-panel { padding: 20px 24px 12px; display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.section-head p { color: var(--muted); font-size: var(--text-size); }
.instrument { display: flex; align-items: center; gap: 9px; }
.instrument h2 { font-size: 23px; line-height: 1; letter-spacing: -.048em; }
.instrument p { font-size: var(--text-size); color: var(--muted); margin-top: 5px; }
.coin {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  color: #d7ffc0;
  background: #1c3217;
  font: 700 18px var(--mono);
}
.btc { background: #362a13; color: #ffc788; }
.eth { background: #272c44; color: #c5caff; }
.sol { background: #19332b; color: #a0f4d4; }
.bnb { background: #3b311a; color: #f6d685; }
.xrp { background: #27312b; color: #d7e6db; }
.chart-ranges { display: flex; gap: 3px; padding: 3px; background: #151417; border: 1px solid var(--line); border-radius: 9px; }
.chart-ranges button {
  min-width: 32px;
  min-height: 30px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: 650 var(--text-size) var(--mono);
  transition: color .14s, background .14s;
}
.chart-ranges button:hover { background: #2a282e; color: var(--ink); }
.chart-ranges button[aria-pressed=true] { background: #32382a; color: var(--accent); }
.chart-quote { display: flex; align-items: baseline; gap: 11px; margin: 9px 0 3px; }
.chart-quote strong { font-size: clamp(28px,4.15vw,49px); font-weight: 720; letter-spacing: -.06em; line-height: 1.07; }
.chart-quote span { font: 620 var(--text-size) var(--mono); }
.plot { position: relative; flex: 1; min-height: 272px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; outline-offset: 0; }
.chart-message, .chart-point {
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 6px;
  padding: 6px 9px;
  pointer-events: none;
  color: #d8e5cf;
  background: #222126;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  font: var(--text-size) var(--mono);
}
.chart-point-controls { display: inline-flex; align-items: center; gap: 6px; }
.chart-point-controls button, .chart-retry {
  min-height: 27px;
  padding: 3px 7px;
  background: var(--panel-raised);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: var(--ink);
  font: var(--text-size) var(--mono);
}
.chart-point-controls button { min-width: 29px; }
.chart-point-controls button:disabled { opacity: .48; }
.chart-point-controls button:hover:enabled, .chart-retry:hover { color: var(--accent); }
.chart-retry { position: absolute; z-index: 2; top: 45px; left: 6px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.chart-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font: var(--text-size) var(--mono); }

.tape-heading, .fx-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 7px;
}
.tape-heading h2 { font-size: var(--text-size); font-weight: 720; }
.tape-heading span, .fx-heading span { color: var(--muted); font: var(--text-size) var(--mono); }
.watch-items {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 7px;
}
.watch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  text-align: left;
  background: #18171ae8;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: background .16s, border-color .16s;
}
.watch-item:hover { background: #242226; }
.watch-item[aria-pressed=true] { background: #22251e; border-color: #63734d; }
.watch-asset { display: flex; align-items: center; gap: 7px; min-width: 0; line-height: 1.16; }
.watch-asset .coin { width: 26px; height: 26px; font-size: var(--text-size); }
.watch-asset strong { display: block; font-size: var(--text-size); }
.watch-asset small, .watch-value small { color: var(--muted); font-size: var(--text-size); }
.watch-value { text-align: right; font: var(--text-size)/1.35 var(--mono); white-space: nowrap; }
.watch-value small { display: block; }
.watch-value small.positive { color: var(--accent); }
.watch-value small.negative { color: var(--negative); }
.cached-quote .watch-value { opacity: .86; }
.account-overview, .fx-panel { margin-top: 26px; }
.account-overview > h2, .fx-heading h2 { margin-bottom: 8px; font-size: 22px; letter-spacing: -.043em; }
#fx-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#fx-rates:empty { display: none; }
.fx-row { display: flex; justify-content: space-between; gap: 5px; padding: 12px 11px; color: var(--ink); font: var(--text-size) var(--mono); }
.fx-row + .fx-row { border-left: 1px solid var(--line); }
.fx-row span:first-child { color: var(--muted); }
.history-overview { display: grid; grid-template-columns: minmax(170px,.3fr) minmax(0,1fr); gap: 12px; }
.history-overview .summary { grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-surface); }
.history-overview .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
.positions-section { margin-top: 18px; }
.positions-section .section-head { padding: 0 0 11px; }
.position-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.position-card { padding: 17px; }
.position-card-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.position-card-header h3 { font-size: 18px; font-weight: 760; letter-spacing: -.03em; }
.position-tags { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); font: var(--text-size) var(--mono); }
.position-pnl { min-width: 0; text-align: right; }
.position-label { color: var(--muted); font-size: var(--text-size); font-weight: 620; }
.position-pnl-value { display: block; font-size: clamp(16px, 2vw, 22px); line-height: 1.25; letter-spacing: -.03em; overflow-wrap: anywhere; }
.position-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding-top: 11px; border-top: 1px solid var(--line); }
.position-details dd { margin: 4px 0 0; font: var(--text-size)/1.45 var(--mono); overflow-wrap: anywhere; }
.position-details dd span { display: block; }
.position-details .position-level-missing { color: var(--muted); font-family: var(--sans); }
.position-exits { padding-top: 9px; }
.position-empty { grid-column: 1 / -1; padding: 18px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

.table-panel { margin-top: 14px; overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 18px 20px; }
.section-head h2 { font-size: 22px; line-height: 1.14; letter-spacing: -.04em; }
.section-head p { margin-top: 4px; }
.table-status { color: var(--muted); font: var(--text-size) var(--mono); text-align: right; }
.table-wrap { overflow: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; min-width: 790px; white-space: nowrap; text-align: left; font: var(--text-size) var(--mono); font-variant-numeric: tabular-nums; }
th,td { padding: 13px 13px; border-top: 1px solid var(--line); }
thead th { background: #222125; color: #c1bbc1; font-size: var(--text-size); letter-spacing: .04em; }
tbody td, tbody th { background: var(--panel); transition: background .16s; }
tbody tr:nth-child(even) td, tbody tr:nth-child(even) th { background: #1c1b1e; }
tbody tr:hover td, tbody tr:hover th { background: #27262a; }
th:first-child,td:first-child { padding-left: 20px; }
th:last-child,td:last-child { padding-right: 20px; }
.table-pnl { font-weight: 720; }
.history-cell-label { display: none; }
.pair-cell { color: var(--ink); font-size: var(--text-size); font-weight: 750; }
td.empty { text-align: left; color: var(--muted); padding: 24px 20px; }
.empty span { display: block; max-width: min(62ch, calc(100vw - 74px)); white-space: normal; }
.side { padding: 4px 6px; border-radius: 3px; background: #2d3929; font-size: var(--text-size); }
.side.negative { background: #39282e; }
.levels { display: grid; gap: 4px; }
.pager { display: flex; justify-content: end; align-items: center; gap: 10px; padding: 11px 18px; color: var(--muted); font: var(--text-size) var(--mono); }
.pager button { border: 1px solid var(--line-bright); background: var(--panel-raised); border-radius: 4px; min-width: 38px; min-height: 32px; }
.pager button:hover:enabled { color: var(--accent); border-color: #83a66b; }
.pager button:disabled { opacity: .45; }
.history-visual { padding-bottom: 15px; }
#history-bars { overflow-x: auto; }
.history-bars__empty, .viz-empty { color: var(--muted); padding: 7px 20px 15px; }
.history-bars {
  margin: 0;
  padding: 0 20px;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px,1fr);
  gap: 6px;
  width: max-content;
  min-width: 100%;
}
.history-bars__item { display: grid; grid-template-rows: 104px auto auto; justify-items: center; min-width: 0; font: var(--text-size)/1.5 var(--mono); }
.history-bars__plot { display: block; position: relative; width: 100%; border-inline-end: 1px solid #302e33; background: linear-gradient(0deg,transparent calc(50% - .5px),#51574b calc(50% - .5px),#51574b calc(50% + .5px),transparent calc(50% + .5px)); }
.history-bars__item:first-child .history-bars__plot { border-inline-start: 1px solid #302e33; }
.history-bars__bar { display: block; position: absolute; left: 50%; width: min(48%,32px); height: max(2px,var(--history-bar-size)); transform: translateX(-50%); }
.history-bars__item--positive .history-bars__bar { bottom: 50%; background: linear-gradient(0deg,#9db16335,#d1f48c); border-radius: 3px 3px 0 0; }
.history-bars__item--negative .history-bars__bar { top: 50%; background: linear-gradient(180deg,#ff858e33,#ffa2ac); border-radius: 0 0 3px 3px; }
.history-bars__item--zero .history-bars__bar { top: calc(50% - 1px); background: #a9bfbe; }
.history-bars__item--missing .history-bars__bar { display: none; }
.history-bars__label { color: var(--ink); margin-top: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.history-bars__value { color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-bars__item--positive .history-bars__value { color: var(--accent); }
.history-bars__item--negative .history-bars__value { color: var(--negative); }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 11px; min-height: 83px; color: var(--muted); font: var(--text-size) var(--mono); }
footer .brand { font: 690 var(--text-size) var(--sans); letter-spacing: -.025em; color: #dcebe9; }

footer .brand img { width: 104px; }
footer a:hover { color: var(--accent); }

@media (min-width: 1100px) {
  .plot { min-height: 315px; }
}
@media (max-width: 940px) {
  .top-inner, main { width: calc(100% - 48px); }
}
@media (max-width: 1120px) {
  .watch-asset small { display: none; }
  .watch-items { grid-template-columns: repeat(5, minmax(181px, 1fr)); overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: thin; }
  .watch-item:focus-visible { outline-offset: -2px; }
}
@media (max-width: 680px) {
  :root { --text-size: 14px; }
  .top-inner, main { width: calc(100% - 28px); }
  .top-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    padding-top: 3px;
    border-bottom: 1px solid var(--line);
  }
  .top-inner .brand { justify-self: center; min-height: 44px; }
  .top-inner .brand img { width: 136px; }
  .section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }
  .section-nav a {
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 48px;
    padding: 0 2px;
    line-height: 1.2;
  }
  .nav-icon { display: block; flex: 0 0 17px; width: 17px; height: 17px; }
  .section-nav a[aria-current="page"] .nav-icon { color: var(--accent); }
  .section-nav a[aria-current="page"]::before {
    inset: auto 13% -1px;
    width: auto;
    height: 2px;
    border-radius: 2px 2px 0 0;
    transform: none;
  }
  .section-nav a:focus-visible { outline-offset: -3px; border-radius: 5px; }
  main { padding-top: 17px; }
  .hero { min-height: 0; margin-bottom: 15px; overflow: visible; }
  .hero-content { padding: 5px 0 0; }
  .hero h1 { font-size: clamp(30px, 6.7vw, 44px); margin: 0 0 7px; line-height: 1.09; }
  .hero-description { max-width: 48ch; }
  .matrix-background { opacity: .31; }

  .data-strip {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 12px;
    margin: 0 0 12px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-surface);
  }
  #data-status { text-align: left; }

  .watch-items { grid-template-columns: repeat(5, minmax(149px, 1fr)); scroll-snap-type: x proximity; }
  .watch-item { min-height: 52px; padding: 6px 7px; gap: 5px; scroll-snap-align: start; }
  .watch-asset .coin { width: 20px; height: 20px; font-size: var(--text-size); }
  .watch-asset { gap: 4px; }
  .market-layout { gap: 7px; }
  .chart-panel { padding: 13px 11px 10px; }
  .chart-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .instrument h2 { font-size: 20px; }
  .chart-quote { flex-wrap: wrap; gap: 5px 8px; }
  .chart-ranges { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .chart-ranges button { min-width: 0; min-height: 44px; }
  .plot { min-height: 226px; }
  .chart-footer { align-items: center; gap: 3px 8px; }
  .chart-point-controls { margin-left: auto; }
  .chart-point-controls button, .pager button, .chart-retry { min-width: 44px; min-height: 44px; }
  .chart-point { max-width: calc(100% - 12px); white-space: normal; }

  .summary, .history-overview .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 0;
    background: none;
    border: 0;
  }
  .summary .metric, .history-overview .summary .metric + .metric {
    min-height: 100px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-surface);
  }
  .metric-title, .metric-meta { line-height: 1.32; }
  .metric-number { margin-block: 4px; }
  .metric-number small { letter-spacing: 0; }
  .history-overview { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .account-overview, .fx-panel { margin-top: 19px; }
  .fx-row { padding: 9px 8px; flex-direction: column; }
  .section-head { padding: 12px 11px; }
  .section-head h2 { font-size: 19px; }
  .position-card { padding: 12px; }
  .position-card-header { gap: 8px; }
  .position-card-header h3 { font-size: 17px; overflow-wrap: anywhere; }
  .position-card-header > div { min-width: 0; }
  .position-details { margin-top: 10px; padding-top: 8px; gap: 5px; }
  .position-details dt { overflow-wrap: anywhere; }
  .positions-section .section-head { align-items: start; flex-wrap: wrap; gap: 5px 12px; }
  .table-status { text-align: left; }

  #history.table-panel { overflow: visible; border: 0; background: none; }
  #history .section-head { align-items: flex-start; flex-wrap: wrap; gap: 5px 12px; padding: 0 0 9px; }
  #history .table-wrap { overflow: visible; }
  .history-table, .history-table tbody { display: block; min-width: 0; }
  .history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history-table tbody { display: grid; gap: 7px; }
  .history-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 11px;
    background: var(--panel-surface);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .history-table tbody :is(td, th) {
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .history-table .pair-cell { align-self: center; }
  .history-table .table-pnl { grid-area: 1 / 2; text-align: right; }
  .history-cell-label { display: block; color: var(--muted); font-family: var(--sans); font-weight: 570; }
  .history-table .history-side { align-self: end; }
  .history-table .history-closed { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; padding-top: 5px; border-top: 1px solid var(--line); }
  .history-table .empty { grid-column: 1 / -1; }

  .history-bars { padding-inline: 11px; grid-auto-columns: minmax(90px, 1fr); }
  footer { min-height: 64px; }
  footer > a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 350px) {
  .top-inner, main { width: calc(100% - 20px); }
  .hero-description { max-width: 32ch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
