@font-face{font-family:Inter;font-style:normal;font-weight:100 700;font-display:swap;src:url('/fonts/inter-v20-latin.woff2') format('woff2')}
:root {
  --paper: #f4ecd8;
  --page: #ede5d0;
  --panel: #faf6ed;
  --ink: #2a2520;
  --muted: #7a7060;
  --line: rgba(42, 37, 32, 0.12);
  --green: #2d5f3a;
  --red: #8b2020;
  --brown: #7a6235;
  --font: Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
}
.shell, .page { background: var(--paper); }
.risk-cell { min-width: 88px; }
.risk-bar {
  height: 4px; border-radius: 99px; background: rgba(42, 37, 32, 0.08); overflow: hidden; margin-bottom: 2px;
}
.risk-bar i { display: block; height: 100%; background: var(--red); }
.pos-table .hint { font-size: 11px; margin-top: 2px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: 0; }
.hidden { display: none !important; }
.top {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: 13px;
}
.brand .cursor { animation: brand-cursor-blink 1.1s step-end infinite; }
@keyframes brand-cursor-blink { 50% { opacity: 0; } }
.chip.fresh { animation: chip-in 280ms ease; }
@keyframes chip-in { from { transform: translateX(14px); opacity: 0; } }
nav { display: flex; align-items: center; gap: 4px; height: 100%; }
nav > button, .pop > button, .textbtn {
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}
nav > button, .pop > button, .textbtn, .dock-tabs button { font-weight: 600; }
nav > button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.session { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon { width: 32px; }
.shell {
  height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 8px;
  padding-right: 8px;
}
.stage { min-width: 0; display: grid; grid-template-rows: minmax(280px, 1fr) 176px; }
.chart-wrap { position: relative; min-height: 0; }
canvas { width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; left: 12px; right: 12px; top: 10px;
  display: flex; align-items: flex-start; gap: 16px; pointer-events: none;
}
.hud .pop, .hud button, .mstats { pointer-events: auto; }
.pill {
  border: 1px solid var(--line);
  background: rgba(247, 241, 228, 0.96);
  border-radius: 5px;
}
.pill { padding: 6px 10px; text-align: left; min-width: 180px; }
.pill b { font-size: 14px; }
.pill em { font-style: normal; color: var(--green); margin-left: 6px; }
.mstats { display: flex; gap: 14px; padding-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.mstats b { display: inline; margin-left: 4px; color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.hud-right { margin-left: auto; display: flex; gap: 6px; }
.live { color: #91d8bd; font-weight: 640; font-size: 12px; padding: 6px 8px; transition: color 0.12s, background 0.12s; }
.live.off { color: var(--muted); }
nav > button, .pill, .dock-tabs button, .top .textbtn { transition: color 0.12s, background 0.12s, border-color 0.12s; }
nav > button:hover, .pill:hover, .dock-tabs button:hover { color: var(--ink); }
.menu {
  position: absolute; z-index: 5; margin-top: 4px; min-width: 140px;
  background: #f7f1e4; border: 1px solid var(--line); border-radius: 8px; padding: 4px;
  box-shadow: 0 8px 24px rgba(42, 37, 32, 0.08);
}
.menu button { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: 6px; }
.menu button:hover, .menu button.on { background: rgba(42, 37, 32, 0.06); }
.pop { position: relative; }
.dock { border-top: 1px solid var(--line); display: grid; grid-template-rows: 38px minmax(0, 1fr); min-height: 0; }
.dock-tabs { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0; }
.ambient { pointer-events: none; user-select: none; opacity: 0.24; position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; }
.ambient-track { display: flex; width: max-content; min-width: 200%; animation: ambient-drift 70s linear infinite; }
.ambient-group { flex: 1 0 auto; display: flex; justify-content: space-around; align-items: center; gap: 26px; padding-inline: 13px; }
.ambient span { font: 700 11px var(--font); letter-spacing: 0.18em; white-space: nowrap; color: rgba(42, 37, 32, 0.28); }
@keyframes ambient-drift { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.dock-tabs > button, .dock-tabs > .heat, .dock-tabs > .pop { position: relative; z-index: 1; }
#chart { cursor: crosshair; touch-action: none; }
.table-wrap.fade { animation: tabFadeIn 0.15s ease; }
@keyframes tabFadeIn { from { opacity: 0; } to { opacity: 1; } }
tr.liqwarn { animation: liqflash 0.5s ease-in-out infinite; }
@keyframes liqflash { 0%, 100% { background: rgba(139, 32, 32, 0.06); } 50% { background: rgba(139, 32, 32, 0.15); } }
#leaderboard .dock-tabs button.holo {
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%), linear-gradient(90deg, rgba(122, 98, 53, 0.12), transparent 55%);
  background-size: 280px 100%, 200px 100%;
  background-repeat: no-repeat;
  animation: lbHoloShift 9s linear infinite;
}
@keyframes lbHoloShift { to { background-position: 280px 0, -200px 0; } }
@media (prefers-reduced-motion: reduce) {
  .ambient-track, #leaderboard .dock-tabs button.holo, tr.liqwarn, .chip.fresh, .brand .cursor { animation: none; }
}
.heat { margin-left: auto; justify-content: flex-end; max-width: 58%; }
.heat.off { display: none; }
.check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--ink); }
.dock-tabs button { color: var(--muted); height: 100%; }
.dock-tabs button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.heat { display: flex; gap: 8px; overflow: hidden; padding: 2px 12px; align-items: center; }
.chip {
  display: inline-flex; gap: 4px; align-items: center; border-radius: 999px;
  padding: 3px 8px; background: rgba(42, 37, 32, 0.05); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(42, 37, 32, 0.08); font-size: 9px; }
.chip.up { background: rgba(45, 95, 58, 0.12); }
.chip.down { background: rgba(139, 32, 32, 0.12); }
.table-wrap.empty { display: grid; place-items: center; min-height: 88px; }
.status-kpis { display: flex; gap: 28px; padding: 4px 0 12px; }
.status-kpis b { display: block; color: var(--ink); font-size: 16px; }
.blocks { display: flex; gap: 14px; overflow: auto; }
.blocks div { min-width: 132px; }
.pager { display: flex; justify-content: flex-end; gap: 8px; color: var(--muted); padding: 8px 0; }
.chip.up { color: var(--green); }
.chip.down { color: var(--red); }
.table-wrap { overflow: auto; padding: 8px 16px 16px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-weight: 420; }
th { color: var(--muted); font-size: 11px; }
.up { color: var(--green); }
.down { color: var(--red); }
.ticket {
  border-radius: 8px;
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.acct { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.equity { width: 100%; display: flex; justify-content: space-between; padding: 0; border: 0; background: transparent; font-weight: 600; }
.equity b { font-weight: 600; }
.metrics { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.metrics div { display: flex; justify-content: space-between; }
.metrics b { color: var(--ink); font-weight: 520; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sides button { height: 32px; border-radius: 8px; border: 1px solid var(--line); }
.sides .long.on { color: var(--green); background: rgba(45, 95, 58, 0.12); }
.sides .short.on { color: var(--red); background: rgba(139, 32, 32, 0.12); }
.ov { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.avail, .ov div, .lev-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.field-label { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.avail b, .ov b { color: var(--ink); letter-spacing: 0; font-size: 13px; }
.inline { display: flex; gap: 6px; align-items: center; }
.qb { height: 22px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); }
.field-label { margin-left: auto; }
input[type="number"], input[type="password"] {
  width: 100%; border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 6px 8px;
}
#leverage { width: 54px; text-align: right; }
#board-search, #name-form input { width: 180px; border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 4px 8px; }
input[type="range"] {
  flex: 1; height: 4px; appearance: none; background: linear-gradient(90deg, var(--green), var(--brown) 60%, var(--red));
  border-radius: 99px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #f7f1e4; border: 2px solid var(--ink);
}
.gobtn, .card button[type="submit"] {
  background: var(--brown); color: #f7f1e4; border-radius: 6px; height: 36px; font-weight: 600;
}
.gobtn.long { background: var(--green); }
.gobtn.short { background: var(--red); }
.gobtn:disabled, #close-all:disabled { opacity: 0.45; }
.error { color: var(--red); min-height: 1em; margin: 0; font-size: 12px; }
.pos-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
#close-all { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }
.page { padding: 16px 18px 32px; }
.pf { display: grid; grid-template-columns: 240px 260px minmax(280px, 1fr); gap: 14px; align-items: start; }
.panel h3 { margin: 12px 0 6px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.panel h3:first-child { margin-top: 0; }
.panel > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.chartbox canvas { width: 100%; height: 180px; background: transparent; }
.card, .page .panel {
  background: rgba(255, 252, 245, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hint { color: var(--muted); }
.modal { position: fixed; inset: 0; background: rgba(42, 37, 32, 0.28); display: grid; place-items: center; }
.modal .card { width: min(420px, calc(100% - 32px)); background: var(--paper); }
.row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
h2 { font-size: 18px; margin: 0 0 10px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .stage { height: 100vh; }
}
