/* Quant Futures Trading - dark trading dashboard. Desktop grid, phone single column (<= 860 px). */
:root {
  --bg: #060A14; --panel: #0C1424; --panel2: #101A2E; --line: rgba(120,150,255,0.14);
  --text: #EAF0FA; --sub: #9AA8C2; --dim: #8492AC; --accent: #6E9BFF; --accent2: #9DB8FF;
  --long: #3DDC97; --long2: #7DEBB9; --short: #FF7A70; --short2: #FF9C94;
  --gold: #F2C14E; --gold2: #F6D27A; --purple: #B49CFF; --purple2: #C9B8FF;
  --mono: "JetBrains Mono", Consolas, "SF Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--accent2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--sub); }
.small { font-size: 12px; line-height: 1.45; }
.pos { color: var(--long2); } .neg { color: var(--short2); } .zero { color: var(--sub); } .acc { color: var(--accent2); }
.phone-only { display: none !important; }

.app { max-width: 1680px; margin: 0 auto; padding: 14px 18px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 100vh; }

/* ---------- header ---------- */
.head { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.brandbox { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; display: block; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.nav, .syms { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.nav-a, .sym { padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--sub); white-space: nowrap; }
.nav-a.on { background: var(--accent); color: var(--bg); font-weight: 700; }
.nav-a.off, .sym.off { color: #5D6B86; cursor: default; }
.sym.on { background: #1A2A4A; color: var(--text); font-weight: 700; }
.chipbox { margin-left: auto; }
.mode-badge { border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 800; letter-spacing: .6px; white-space: nowrap; }
.m-simulate { background: rgba(242,193,78,.16); color: var(--gold2); border: 1px solid rgba(242,193,78,.4); }
.m-paper { background: rgba(110,155,255,.14); color: var(--accent2); border: 1px solid rgba(110,155,255,.35); }
.m-live { background: rgba(255,122,112,.16); color: var(--short2); border: 1px solid rgba(255,122,112,.45); }
.phase-chip { border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.c-gold { background: rgba(242,193,78,.14); color: var(--gold2); }
.c-green { background: rgba(61,220,151,.14); color: var(--long2); }
.c-red { background: rgba(255,122,112,.14); color: var(--short2); }
.c-purple { background: rgba(180,156,255,.16); color: var(--purple2); }
.health { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--sub); }
.hpills { display: flex; gap: 8px; }
.hp { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hd { width: 7px; height: 7px; border-radius: 4px; background: var(--dim); display: inline-block; }
.hd.ok { background: var(--long); } .hd.alert { background: var(--short); box-shadow: 0 0 0 3px rgba(255,122,112,.2); } .hd.idle { background: #4A5670; }
.hsum.ok { color: var(--long2); } .hsum.alert { color: var(--short2); font-weight: 600; }
.clocks { font-family: var(--mono); text-align: right; line-height: 1.2; }
.clk-b { font-size: 16px; font-weight: 700; } .clk-n { font-size: 11px; color: var(--sub); }
.clk-tz { font-size: 11px; color: var(--sub); font-family: Inter, sans-serif; }

/* ---------- day rail ---------- */
.rail { height: 42px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; }
.rail-inner { position: relative; height: 100%; }
.rail-line, .rail-done { position: absolute; left: 0; top: 27px; height: 3px; border-radius: 2px; }
.rail-line { right: 0; background: rgba(154,168,194,.2); }
.rail-done { background: var(--accent); }
.rail-lbl { position: absolute; top: 6px; font-size: 11px; color: var(--sub); white-space: nowrap; }
.rail-lbl.a-c { transform: translateX(-50%); } .rail-lbl.a-r { transform: translateX(-100%); }
.rail-lbl.key { color: var(--text); font-weight: 600; }
.rail-dot { position: absolute; top: 23px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 6px; background: var(--bg); border: 2px solid #4A5670; }
.rail-dot.key { border-color: var(--text); }
.rail-dot.exit { background: var(--text); }
.rail-now { position: absolute; top: 22px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 7px; background: var(--gold); box-shadow: 0 0 0 4px rgba(242,193,78,.18); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; min-width: 0; }
.lbl { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 11px; color: var(--sub);
  font-weight: 600; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.lbl-r { text-transform: none; letter-spacing: 0; font-weight: 500; text-align: right; }
.eyebrow { font-size: 11px; color: var(--sub); font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.big-msg { font-size: 22px; font-weight: 700; margin: 4px 0 6px; }
.callout { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(110,155,255,.10); color: var(--accent2); font-size: 13px; }
.g-pos { background: linear-gradient(135deg, rgba(61,220,151,.16), var(--panel) 70%); border-color: rgba(61,220,151,.35); }
.g-neg { background: linear-gradient(135deg, rgba(255,122,112,.16), var(--panel) 70%); border-color: rgba(255,122,112,.35); }

/* ---------- phases: desktop grids ---------- */
.main { display: block; }
.phase { gap: 10px; align-items: start; }
.ph-before { grid-template-columns: 430px minmax(0, 1fr);
  grid-template-areas: "count chart" "votes chart" "score bottom"; }
.ph-trade, .ph-after { grid-template-columns: minmax(0, 1fr) 430px;
  grid-template-areas: "hero hero" "chart side"; }
.a-count { grid-area: count; } .a-votes { grid-area: votes; } .a-chart { grid-area: chart; } .a-score { grid-area: score; }
.a-bottom { grid-area: bottom; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.a-bottom > div > .card { height: 100%; }
.a-hero { grid-area: hero; } .a-side { grid-area: side; display: flex; flex-direction: column; gap: 10px; } .a-ladder { grid-area: ladder; }
.chart { padding: 12px 10px 6px; }
.chart .lbl { padding: 0 6px; }
.gwrap { height: 480px; } .ph-before .gwrap { height: 440px; }
.gwrap-s { height: 168px; }

/* ---------- before ---------- */
.count-row { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0%; --c: var(--gold); position: relative; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) var(--p), rgba(154,168,194,.16) 0); }
.ring.r-lg { width: 128px; height: 128px; } .ring.r-md { width: 104px; height: 104px; }
.ring-in { width: calc(100% - 18px); height: calc(100% - 18px); border-radius: 50%; background: var(--panel); display: grid; place-content: center; text-align: center; }
.ring-big { font-family: var(--mono); font-size: 25px; font-weight: 700; }
.r-md .ring-big { font-size: 21px; }
.ring-small { font-size: 11px; color: var(--sub); }
.verdict { font-size: 40px; font-weight: 800; line-height: 1.05; margin-top: 4px; color: var(--sub); }
.verdict.pos { color: var(--long2); } .verdict.neg { color: var(--short2); }
.verdict-box .mono { font-size: 14px; }
.verdict-box .small { margin-top: 6px; }
.votebar { position: relative; height: 64px; margin-top: 14px; }
.vb-end { position: absolute; top: 12px; font-family: var(--mono); font-size: 10px; }
.vb-end.l { left: 0; color: var(--short2); } .vb-end.r { right: 0; color: var(--long2); }
.vb-area { position: absolute; left: 44px; right: 40px; top: 6px; bottom: 0; }
.vb-track { position: absolute; left: 0; right: 0; top: 2px; height: 22px; }
.vb-mid { position: absolute; left: 50%; top: -4px; bottom: -6px; width: 1px; background: rgba(154,168,194,.5); }
.vb-seg { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px;
  color: #06130D; font-weight: 700; overflow: hidden; border-right: 2px solid var(--panel); }
.vb-seg.pos { background: rgba(61,220,151,.78); } .vb-seg.neg { background: rgba(255,122,112,.78); color: #200806; }
.vb-mark { position: absolute; top: 30px; transform: translateX(-50%); text-align: center; }
.vb-tri { width: 0; height: 0; margin: 0 auto; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--text); }
.vb-net { font-family: var(--mono); font-size: 11px; color: var(--text); margin-top: 2px; white-space: nowrap; }
.votelist { display: flex; flex-direction: column; gap: 9px; }
.vl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vl-name { font-size: 13.5px; } .vl-read { font-size: 12px; color: var(--sub); }
.vl-val { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.planboxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.pb { border-radius: 10px; padding: 8px 4px; }
.pb.neg { background: rgba(255,122,112,.08); color: inherit; } .pb.pos { background: rgba(61,220,151,.08); color: inherit; } .pb.acc { background: rgba(110,155,255,.08); color: inherit; }
.pb-k { font-size: 11px; color: var(--sub); } .pb-v { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.pb-s { font-size: 11.5px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ck { display: inline-block; width: 18px; } .ck.ok { color: var(--long); } .ck.wait { color: var(--gold); }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; font-size: 12px; position: relative; margin-top: 8px; }
.pipe::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 9px; height: 2px; background: rgba(154,168,194,.25); }
.ps-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ps-dot { width: 20px; height: 20px; border-radius: 10px; background: var(--panel); border: 2px solid #4A5670; }
.ps-dot.done { background: var(--accent); border-color: var(--accent); }
.ps-dot.next { border-color: var(--gold); }
.nc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nc-dir { font-size: 22px; font-weight: 800; }
.nc-stories { margin: 8px 0 0; padding-left: 18px; color: var(--sub); font-size: 12.5px; line-height: 1.45; }

/* ---------- in the trade ---------- */
.hero-row { display: flex; gap: 10px; align-items: stretch; }
.hero-row > .card { display: flex; flex-direction: column; justify-content: center; }
.hero-main { flex: 0 0 400px; }
.hero-bar { flex: 1 1 auto; }
.hero-time { flex: 0 0 330px; }
.hm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pill { border-radius: 8px; padding: 4px 12px; font-size: 14px; font-weight: 800; }
.pill.pos { background: var(--long); color: #04130C; } .pill.neg { background: var(--short); color: #200806; }
.live-dot { margin-left: auto; font-size: 11px; color: var(--long2); font-weight: 700; white-space: nowrap; }
.pnl { font-family: var(--mono); font-size: 52px; font-weight: 800; line-height: 1; }
.pnl.pos { color: var(--long2); } .pnl.neg { color: var(--short2); }
.sub { color: #C9D3E3; font-size: 14px; margin-top: 4px; }
.riskbar { position: relative; height: 122px; margin: 0 26px; }
.rb-track { position: absolute; left: 0; right: 0; top: 34px; height: 12px; border-radius: 6px; background: rgba(154,168,194,.14); }
.rb-fill, .rb-fill-lock { position: absolute; top: 0; bottom: 0; }
.rb-fill.pos { background: rgba(61,220,151,.35); } .rb-fill.neg { background: rgba(255,122,112,.35); }
.rb-fill-lock { background: rgba(61,220,151,.75); z-index: 1; }
.rb-best { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--gold); z-index: 2; }
.rb-now { position: absolute; top: 0; transform: translateX(-50%); text-align: center; z-index: 3; }
.rb-now-lbl { font-size: 12px; font-weight: 700; white-space: nowrap; }
.rb-now-pin { width: 3px; height: 30px; margin: 2px auto 0; background: var(--text); border-radius: 2px; }
.rb-mark { position: absolute; top: 34px; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.rb-mark[style*="left: 0.00%"] { transform: none; text-align: left; }
.rb-mark[style*="left: 100.00%"] { transform: translateX(-100%); text-align: right; }
.rb-tick { width: 2px; height: 22px; background: var(--text); margin: -5px auto 4px; }
.rb-mark[style*="left: 0.00%"] .rb-tick { margin-left: 0; } .rb-mark[style*="left: 100.00%"] .rb-tick { margin-right: 0; }
.rb-tick.neg { background: var(--short); } .rb-tick.pos { background: var(--long); }
.rb-mark.lo, .rb-mark:has(.lo) { top: 70px; }
.rb-tn { font-size: 11px; color: var(--sub); } .rb-tp { font-size: 12px; } .rb-tu { font-size: 11.5px; font-family: var(--mono); }
.rb-tu.dim, .rb-tick.dim { opacity: .55; }
.tl-row { display: flex; gap: 16px; align-items: center; }
.tl-kvs { display: flex; flex-direction: column; gap: 8px; }
.kv { font-size: 16px; font-weight: 700; }
.kv-big { font-size: 26px; font-weight: 800; font-family: var(--mono); }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; margin-bottom: 10px; }
.chip { border-radius: 10px; padding: 8px 2px; background: rgba(154,168,194,.10); }
.chip.pos { background: rgba(61,220,151,.14); } .chip.neg { background: rgba(255,122,112,.12); }
.chip-k { font-size: 11px; color: var(--sub); } .chip-v { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.chip.pos .chip-v { color: var(--long2); } .chip.neg .chip-v { color: var(--short2); } .chip.zero .chip-v { color: var(--sub); }
.why { font-size: 13px; color: #C9D3E3; line-height: 1.5; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.timeline li { display: flex; gap: 10px; }
.tl-t { font-family: var(--mono); color: var(--sub); flex: none; width: 66px; font-size: 12px; padding-top: 1px; }
.tl-x.k-warn { color: var(--gold2); } .tl-x.k-exit, .tl-x.k-entry, .tl-x.k-decision { color: var(--text); font-weight: 600; }
.tl-x.k-system { color: var(--sub); }

/* ladder (phone) */
.ladder { position: relative; height: 400px; margin: 26px 0 30px; }
.ld-track { position: absolute; left: 86px; width: 20px; top: 0; bottom: 0; border-radius: 10px; background: rgba(154,168,194,.12); }
.ld-lock, .ld-open { position: absolute; left: 86px; width: 20px; }
.ld-lock { background: rgba(61,220,151,.6); } .ld-open { background: rgba(61,220,151,.28); }
.ld-best { position: absolute; left: 80px; width: 32px; height: 2px; background: var(--gold); }
.ld-mark { position: absolute; left: 76px; width: 40px; height: 2px; margin-top: -1px; background: var(--text); }
.ld-mark.neg { background: var(--short); } .ld-mark.pos { background: var(--long); } .ld-mark.now { height: 3px; left: 72px; width: 48px; }
.ld-mark.dim { opacity: .5; }
.ld-row { position: absolute; left: 0; right: 0; transform: translateY(-50%); display: flex; align-items: center; }
.ld-usd { width: 70px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--sub); }
.ld-usd.pos, .ld-usd.now { color: var(--long2); } .ld-usd.neg { color: var(--short2); }
.ld-txt { margin-left: 56px; }
.ld-name { font-size: 13.5px; font-weight: 700; } .ld-px { font-size: 11.5px; color: var(--sub); }
.ld-row.now .ld-txt { background: rgba(234,240,250,.08); border: 1px solid rgba(234,240,250,.3); border-radius: 8px; padding: 4px 10px; }
.ld-row.dim { opacity: .65; }

/* ---------- after ---------- */
.ph-after .hero-main { flex: 0 0 400px; }
.hero-vs, .hero-cap { flex: 1 1 0; }
.hero-next { flex: 0 0 220px; }
.res-line { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.kvrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.kvrow.sum { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.cap-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cap-bar { position: relative; height: 10px; margin: 10px 0 6px; border-radius: 5px; background: rgba(154,168,194,.16); overflow: hidden; }
.cap-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--long); border-radius: 5px; }
.cap-best { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.kvgrid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kvgrid .r { text-align: right; }
.totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.foot { color: #4A5670; font-size: 11px; text-align: center; margin-top: 6px; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .desk-only { display: none !important; }
  .phone-only { display: block !important; }
  .tabbar.phone-only { display: flex !important; }
  .app { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); gap: 12px; }
  .head { flex-wrap: nowrap; gap: 10px; min-height: 40px; }
  .brand { font-size: 16px; } .logo { width: 26px; height: 26px; }
  .syms { padding: 2px; } .sym { padding: 3px 8px; font-size: 11px; } .sym.off { display: none; }
  .hm-top .muted { font-size: 12px; }
  .modebox { order: 11; } .mode-badge { font-size: 10px; padding: 3px 7px; }
  .chipbox { margin-left: 0; order: 10; flex-basis: 100%; }
  .head { flex-wrap: wrap; }
  .clocks { margin-left: auto; } .clk-b { font-size: 14px; } .clk-tz { display: none; }
  .health-m { font-size: 12px; margin-top: -4px; }
  .health-m .hsum::before { content: "● "; }
  .card { border-radius: 16px; padding: 14px 16px; }
  .ph-before, .ph-trade, .ph-after { grid-template-columns: minmax(0, 1fr); }
  .ph-before { grid-template-areas: "count" "votes" "chart" "score" "bottom"; }
  .ph-trade { grid-template-areas: "hero" "ladder" "chart" "side"; }
  .ph-after { grid-template-areas: "hero" "chart" "side"; }
  .a-bottom { grid-template-columns: minmax(0, 1fr); }
  .gwrap, .ph-before .gwrap { height: 290px; }
  .gwrap-s { height: 130px; }
  .hero-row { flex-direction: column; }
  .hero-row > .card { flex: none; }
  .ring.r-lg { width: 104px; height: 104px; } .ring-big { font-size: 22px; }
  .verdict { font-size: 34px; }
  .pnl { font-size: 50px; }
  .count-row { gap: 14px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; justify-content: space-around; align-items: center;
    padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(12,20,36,.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px); }
  .tab { text-align: center; font-size: 11px; font-weight: 600; color: #5D6B86; text-decoration: none; }
  .tab div { font-size: 18px; }
  .tab.on { color: var(--accent2); font-weight: 700; }
  .foot { margin-bottom: 4px; }
}

/* trade hero: mode tag (paper / live / simulated) and the age of position.json */
.live-dot.m-simulate, .live-dot.m-paper, .live-dot.m-live, .live-dot.m-unknown { border-radius: 6px; padding: 2px 7px; }
.live-dot.m-unknown { color: var(--short2); border: 1px solid rgba(255,122,112,.45); }
.stale { color: var(--short2); font-weight: 700; }

/* chart header with the Levels buttons (Auto / ±500 / ±1000 / All) - same on every chart view */
.chart-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head > .lbl { flex: 1 1 260px; margin-bottom: 0; }
.zonebar { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; }
.zb-k { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .6px; margin-right: 4px; }
.zb { font: 600 11px/1 Inter, "Segoe UI", system-ui, sans-serif; color: var(--sub); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
.zb:hover { color: var(--text); border-color: rgba(110,155,255,.4); }
.zb.on { background: #1A2A4A; color: var(--text); border-color: rgba(110,155,255,.55); }
