/* GOLD BRAIN — phòng chỉ huy hologram */
:root {
  --bg: #01040a;
  --cy: #4fd8ff; --cy-2: #a6f3ff; --cy-line: rgba(79, 216, 255, .3);
  --amber: #ffb547; --gold: #ffd27a;
  --up: #2ef2b0; --down: #ff5a4e;
  --text: #d3f1ff; --muted: #6a93b0; --faint: #2a4862;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --orb: "Orbitron", "Chakra Petch", sans-serif;
  --vn: "Chakra Petch", system-ui, sans-serif;
  --cut: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--vn); }
body { min-height: 100vh; overflow-x: hidden; cursor: crosshair; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); }
.pos { color: var(--up); } .neg { color: var(--down); }

/* ===== Lớp nền ===== */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: -2; background: radial-gradient(ellipse at 50% 42%, transparent 35%, rgba(0, 0, 0, .75) 100%); }
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(140, 230, 255, .03) 0 1px, transparent 1px 3px); }
.scanlines::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(79, 216, 255, .05) 50%, transparent); height: 30vh; animation: sweep 7s linear infinite; }
@keyframes sweep { from { transform: translateY(-30vh); } to { transform: translateY(110vh); } }

/* Tâm ngắm chuột */
.reticle { position: fixed; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; z-index: 90; border: 1px solid rgba(79, 216, 255, .55); border-radius: 50%;
  box-shadow: 0 0 10px rgba(79, 216, 255, .35); transition: width .15s, height .15s, margin .15s; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: var(--cy); }
.reticle::before { left: 50%; top: -8px; bottom: -8px; width: 1px; -webkit-mask: linear-gradient(#000 0 8px, transparent 8px calc(100% - 8px), #000 0); mask: linear-gradient(#000 0 8px, transparent 8px calc(100% - 8px), #000 0); }
.reticle::after { top: 50%; left: -8px; right: -8px; height: 1px; -webkit-mask: linear-gradient(90deg, #000 0 8px, transparent 8px calc(100% - 8px), #000 0); mask: linear-gradient(90deg, #000 0 8px, transparent 8px calc(100% - 8px), #000 0); }
.reticle i { position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(255, 181, 71, .6); animation: spin 4s linear infinite; }
.reticle span { position: absolute; left: 50px; top: 28px; font: 500 9px var(--mono); color: var(--cy); white-space: nowrap; letter-spacing: .1em; text-shadow: 0 0 6px var(--cy); }
.reticle.hot { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-color: var(--amber); }
@media (hover: none) { .reticle { display: none; } body { cursor: auto; } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .6; transform: scale(.88); } }
@keyframes blink { 50% { opacity: .2; } }

/* ===== Chữ glitch ===== */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: .8; pointer-events: none; }
.glitch::before { color: #ff2d75; transform: translate(-2px, 0); clip-path: inset(0 0 60% 0); animation: gl1 4.5s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: #00f0ff; transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: gl2 4.5s infinite steps(1); mix-blend-mode: screen; }
@keyframes gl1 { 0%, 88%, 100% { transform: translate(0); opacity: 0; } 89% { transform: translate(-3px, -1px); opacity: .9; clip-path: inset(10% 0 55% 0); } 92% { transform: translate(2px, 1px); clip-path: inset(60% 0 10% 0); } 95% { transform: translate(-1px); opacity: .6; } }
@keyframes gl2 { 0%, 88%, 100% { transform: translate(0); opacity: 0; } 90% { transform: translate(3px, 1px); opacity: .9; clip-path: inset(40% 0 30% 0); } 93% { transform: translate(-2px, -1px); clip-path: inset(5% 0 75% 0); } 96% { transform: translate(1px); opacity: .5; } }

/* ===== Khung kính hologram (cắt góc) ===== */
.holo {
  --c1: var(--cy); --c2: var(--amber);
  position: relative; padding: 14px 16px 14px; min-width: 0;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--c1) 50%, transparent calc(50% + 1.5px)) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), var(--c2) 50%, transparent calc(50% + 1.5px)) bottom right / var(--cut) var(--cut) no-repeat,
    radial-gradient(120% 60% at 0 0, rgba(79, 216, 255, .13), transparent 60%),
    linear-gradient(160deg, rgba(12, 42, 70, .62), rgba(3, 14, 28, .72) 55%, rgba(2, 9, 20, .8));
  backdrop-filter: blur(6px) saturate(1.3);
}
body:not(.live) .holo { opacity: 0; }
.live .holo { animation: materialize .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.holo::before { /* viền phát sáng */
  content: ""; position: absolute; inset: 0; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--c1), rgba(79, 216, 255, .18) 25%, rgba(79, 216, 255, .05) 55%, rgba(255, 181, 71, .25) 85%, var(--c2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.holo::after { /* vệt sáng quét qua kính */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(166, 243, 255, .06), transparent); animation: glass 9s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes glass { 0%, 70% { left: -50%; } 100% { left: 120%; } }
@keyframes materialize {
  0% { opacity: 0; transform: scaleY(.015) scaleX(.6); filter: brightness(4) hue-rotate(-20deg); }
  55% { opacity: 1; transform: scaleY(1.01) scaleX(1); filter: brightness(1.5); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* Đầu khung */
.ph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px; padding-bottom: 8px; position: relative; }
.ph::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--cy), rgba(79, 216, 255, .1) 60%, transparent); }
.ph::before { content: ""; position: absolute; bottom: -1px; height: 3px; width: 40px; background: var(--cy); box-shadow: 0 0 10px var(--cy); animation: phscan 5s ease-in-out infinite; }
@keyframes phscan { 0%, 100% { left: 0; } 50% { left: calc(100% - 40px); opacity: .3; } }
.ph-id { font: 700 10px var(--mono); color: #001018; background: var(--cy); padding: 1px 6px; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); box-shadow: 0 0 10px var(--cy); }
.ph-t { font: 700 12.5px var(--vn); letter-spacing: .22em; text-transform: uppercase; color: var(--cy-2);
  text-shadow: 0 0 10px rgba(79, 216, 255, .6), -1px 0 rgba(255, 45, 117, .35), 1px 0 rgba(0, 240, 255, .35); }
.ph-s { margin-left: auto; font: 400 10.5px var(--mono); color: var(--muted); }

/* ===== Header ===== */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; padding: 12px 22px 10px; position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(1, 6, 14, .95), rgba(1, 6, 14, .78)); backdrop-filter: blur(10px); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cy) 20%, var(--amber) 50%, var(--cy) 80%, transparent); box-shadow: 0 0 12px var(--cy); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-txt b { display: block; font: 900 18px var(--orb); letter-spacing: .3em; color: var(--gold); text-shadow: 0 0 16px rgba(255, 181, 71, .75); }
.brand-txt small { color: var(--muted); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.reactor { position: relative; width: 46px; height: 46px; flex: none; }
.reactor i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--cy); animation: spin 6s linear infinite; }
.reactor i:nth-child(1) { border-color: var(--cy) transparent var(--cy) transparent; filter: drop-shadow(0 0 4px var(--cy)); }
.reactor i:nth-child(2) { inset: 7px; border-color: transparent var(--amber) transparent var(--amber); animation-duration: 3s; animation-direction: reverse; }
.reactor i:nth-child(3) { inset: 12px; border-style: dashed; border-color: var(--cy-2); animation-duration: 9s; }
.reactor b { position: absolute; inset: 16px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--cy) 55%, transparent 75%); box-shadow: 0 0 18px var(--cy), 0 0 40px rgba(79, 216, 255, .6); animation: pulse 2.4s ease-in-out infinite; }
.quote-plate { position: relative; display: flex; align-items: baseline; gap: 12px; padding: 4px 26px 5px; border: 1px solid rgba(255, 181, 71, .35);
  background: linear-gradient(180deg, rgba(255, 181, 71, .1), rgba(255, 181, 71, .02)); clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%); }
.sym { font: 600 9.5px var(--orb); letter-spacing: .22em; color: var(--muted); }
.px { font: 700 28px var(--orb); color: var(--gold); letter-spacing: .04em; min-width: 150px; transition: color .3s;
  text-shadow: 0 0 18px rgba(255, 181, 71, .7), -1.5px 0 rgba(255, 45, 117, .35), 1.5px 0 rgba(0, 240, 255, .35); }
.px.up { color: #b9ffe9; } .px.down { color: #ffc2bd; }
.chg { font: 600 12px var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 10.5px var(--mono); padding: 3px 11px; color: var(--cy-2); border: 1px solid var(--cy-line); background: rgba(79, 216, 255, .06);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); white-space: nowrap; letter-spacing: .05em; }
.chip.sim { color: var(--amber); border-color: rgba(255, 181, 71, .45); background: rgba(255, 181, 71, .07); display: inline-flex; align-items: center; gap: 6px; }
.chip.trend { color: var(--cy); background: rgba(79, 216, 255, .14); }
.chip.range { color: #d0bbff; border-color: rgba(180, 140, 255, .45); background: rgba(180, 140, 255, .09); }
.blink { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1.2s steps(2) infinite; }
.ctrl { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--cy-line); background: rgba(79, 216, 255, .04); }
.seg button { background: transparent; border: 0; padding: 5px 11px; color: var(--muted); font: 600 11px var(--vn); letter-spacing: .06em; }
.seg button:hover { color: var(--cy-2); }
.seg button.on { background: rgba(79, 216, 255, .2); color: #fff; box-shadow: inset 0 -2px 0 var(--cy); text-shadow: 0 0 8px var(--cy); }
.seg.small button { padding: 2px 9px; font-size: 10.5px; }
.btn { background: rgba(79, 216, 255, .07); border: 1px solid var(--cy-line); padding: 6px 15px; font: 700 11.5px var(--vn); letter-spacing: .12em; color: var(--cy-2);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); transition: background .2s, box-shadow .2s; }
.btn:hover { background: rgba(79, 216, 255, .2); box-shadow: 0 0 16px rgba(79, 216, 255, .4); }
.btn.small { padding: 3px 12px; font-size: 10.5px; }
.btn.kill { color: var(--down); border-color: rgba(255, 90, 78, .55); background: rgba(255, 90, 78, .09); }
.btn.kill.on { background: var(--down); color: #fff; box-shadow: 0 0 24px var(--down); animation: blink 1s steps(2) infinite; }

.ticker { overflow: hidden; height: 22px; position: relative; background: linear-gradient(90deg, rgba(79, 216, 255, .06), rgba(79, 216, 255, .015), rgba(79, 216, 255, .06)); border-bottom: 1px solid rgba(79, 216, 255, .12); }
.ticker-track { position: absolute; white-space: nowrap; font: 500 10px/22px var(--mono); color: var(--muted); letter-spacing: .14em; animation: tick 70s linear infinite; }
.ticker-track b { color: var(--cy-2); font-weight: 600; } .ticker-track .d { color: var(--amber); padding: 0 14px; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== Sân khấu 3D ===== */
.stage { display: grid; grid-template-columns: 340px minmax(0, 1fr) 340px; gap: 18px 22px; padding: 18px 22px; perspective: 1700px; perspective-origin: 50% 35%; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; transform-style: preserve-3d; transition: transform .25s ease-out; }
.side.left { transform-origin: 0 50%; transform: rotateY(calc(13deg + var(--mx, 0) * 3deg)) rotateX(calc(var(--my, 0) * -2deg)); }
.side.right { transform-origin: 100% 50%; transform: rotateY(calc(-13deg + var(--mx, 0) * 3deg)) rotateX(calc(var(--my, 0) * -2deg)); }
.center { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.core-wrap { position: relative; }
.core-title { position: absolute; top: 4px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 12px; pointer-events: none; z-index: 1; }
.core-title span:first-child { font: 600 11px var(--vn); letter-spacing: .4em; color: var(--muted); }
.core-title b { font: 700 13px var(--orb); letter-spacing: .4em; color: var(--cy-2); text-shadow: 0 0 12px var(--cy); }
#core { width: 100%; height: 720px; display: block; }
#chart { width: 100%; height: 300px; display: block; }
.wave { display: inline-flex; gap: 2px; align-items: center; height: 14px; }
.wave i { width: 2px; height: 30%; background: var(--cy); box-shadow: 0 0 6px var(--cy); animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(odd) { animation-duration: .8s; } .wave i:nth-child(3n) { animation-duration: 1.4s; } .wave i:nth-child(4n) { animation-delay: -.4s; }
@keyframes wave { 50% { height: calc(var(--amp, .6) * 100%); } }
.legend { margin-left: auto; display: flex; align-items: center; gap: 4px; font: 400 10px var(--mono); color: var(--muted); }
.legend i { width: 12px; height: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); margin-left: 8px; }

/* ===== Tài khoản ===== */
.equity { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.equity span { width: 100%; font: 500 9.5px var(--mono); letter-spacing: .24em; color: var(--muted); }
.equity b { font: 700 31px var(--orb); color: var(--gold); letter-spacing: .02em; text-shadow: 0 0 18px rgba(255, 181, 71, .6), -1.5px 0 rgba(255, 45, 117, .3), 1.5px 0 rgba(0, 240, 255, .3); }
.equity small { color: var(--muted); font: 500 10px var(--orb); letter-spacing: .2em; }
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.ring-wrap { position: relative; }
.ring-wrap::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; border: 1px dashed rgba(79, 216, 255, .3); animation: spin 22s linear infinite; }
.ring-wrap::after { content: ""; position: absolute; inset: -4%; border-radius: 50%; border: 1px solid transparent; border-top-color: rgba(255, 181, 71, .6); animation: spin 3s linear infinite; }
.ring { --v: 0; --c: var(--cy); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), rgba(79, 216, 255, .08) 0);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); filter: drop-shadow(0 0 6px var(--c)); }
.ring-lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-lbl b { font: 700 14px var(--orb); text-shadow: 0 0 8px currentColor; }
.ring-lbl span { font: 500 8.5px var(--mono); color: var(--muted); letter-spacing: .14em; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.kv div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed rgba(79, 216, 255, .12); font-size: 11px; }
.kv span { color: var(--muted); } .kv b { font: 600 11px var(--mono); }
.spark { width: 100%; height: 56px; margin-top: 10px; display: block; }

/* ===== Rủi ro ===== */
.rz { padding: 4px 0 10px; }
.rz + .rz { border-top: 1px solid rgba(79, 216, 255, .14); padding-top: 10px; }
.rz-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font: 700 11px var(--orb); letter-spacing: .16em; color: var(--cy-2); }
.rz-h small { font: 400 10px var(--mono); color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.sig { font: 700 11px var(--vn); letter-spacing: .14em; padding: 2px 11px; color: var(--muted); border: 1px solid var(--faint); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.sig.buy { color: #00150e; background: var(--up); border-color: var(--up); box-shadow: 0 0 14px var(--up); }
.sig.sell { color: #1a0300; background: var(--down); border-color: var(--down); box-shadow: 0 0 14px var(--down); }
.pmeter { position: relative; height: 18px; border: 1px solid rgba(79, 216, 255, .22); background: repeating-linear-gradient(90deg, rgba(79, 216, 255, .1) 0 1px, transparent 1px 10%); margin-bottom: 8px; }
.pmeter::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--cy-2); box-shadow: 0 0 6px var(--cy); }
.pmeter i { position: absolute; top: 3px; bottom: 3px; transition: left .3s, width .3s; }
.pmeter b { position: absolute; right: 6px; top: 0; font: 700 11px/16px var(--orb); text-shadow: 0 0 6px currentColor; }
.pmeter span { position: absolute; left: 6px; top: 0; font: 500 9px/16px var(--mono); color: var(--muted); letter-spacing: .1em; }
.rz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rz-grid div { border-left: 2px solid rgba(79, 216, 255, .35); background: rgba(79, 216, 255, .045); padding: 3px 6px; }
.rz-grid span { display: block; font: 500 8.5px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.rz-grid b { font: 600 11px var(--mono); }

/* ===== Guardian ===== */
.guard .g { display: grid; grid-template-columns: 1fr 22px 22px; gap: 6px; align-items: center; padding: 4px 0; font-size: 11.5px; border-bottom: 1px dashed rgba(79, 216, 255, .09); }
.guard .g.head { font: 500 9px var(--mono); letter-spacing: .14em; color: var(--muted); border-bottom: 1px solid rgba(79, 216, 255, .2); }
.guard .g.head span:not(:first-child) { text-align: center; }
.hx { width: 16px; height: 18px; margin: auto; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: grid; place-items: center; font: 700 9px var(--mono); }
.hx.ok { background: rgba(46, 242, 176, .22); color: var(--up); box-shadow: inset 0 0 0 1px var(--up); }
.hx.no { background: var(--down); color: #fff; animation: blink 1s steps(2) infinite; }

/* ===== Agent ===== */
.agent { padding: 8px 0 9px; border-bottom: 1px solid rgba(79, 216, 255, .09); }
.agent:last-of-type { border-bottom: 0; }
.ag-top { display: flex; align-items: center; gap: 8px; }
.ag-id { font: 700 9px var(--mono); color: var(--ac); border: 1px solid var(--ac); padding: 0 4px; box-shadow: 0 0 8px var(--ac) inset, 0 0 6px var(--ac); }
.ag-top b { font-weight: 600; font-size: 12.5px; letter-spacing: .04em; }
.ag-top .tf { font: 500 9px var(--mono); color: var(--muted); }
.ag-top .w { margin-left: auto; font: 400 9.5px var(--mono); color: var(--muted); }
.ag-top .sv { font: 700 13px var(--orb); min-width: 52px; text-align: right; text-shadow: 0 0 8px currentColor; }
.bar { position: relative; height: 5px; margin: 6px 0 5px; background: repeating-linear-gradient(90deg, rgba(79, 216, 255, .16) 0 2px, transparent 2px 5px); }
.bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--cy-2); }
.bar .fill { position: absolute; top: 0; bottom: 0; transition: left .3s, width .3s; }
.agent .txt { font-size: 11px; color: var(--muted); }
.meta { margin-top: 8px; padding: 7px 9px; font-size: 11px; color: var(--muted); border-left: 2px solid var(--amber); background: linear-gradient(90deg, rgba(255, 181, 71, .1), transparent); }
.meta b { font: 700 10px var(--orb); letter-spacing: .16em; color: var(--amber); margin-right: 6px; }

/* ===== Tin ===== */
.ev { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 0; border-bottom: 1px dashed rgba(79, 216, 255, .1); }
.ev:last-child { border-bottom: 0; }
.ev b { font-weight: 600; font-size: 12px; }
.ev .cd { font: 700 12px var(--orb); color: var(--cy-2); text-align: right; text-shadow: 0 0 8px rgba(79, 216, 255, .6); }
.ev small { font: 400 10px var(--mono); color: var(--muted); grid-column: 1 / -1; }
.ev.hot b, .ev.hot .cd { color: var(--down); text-shadow: 0 0 8px var(--down); }

/* ===== Dock: lịch sử / lệnh mở / nhật ký ===== */
.dock { grid-column: 1 / -1; --cut: 22px; padding-top: 0; }
.dock-tabs { display: flex; align-items: stretch; gap: 2px; margin: 0 -16px 14px; padding: 0 16px; border-bottom: 1px solid rgba(79, 216, 255, .2); flex-wrap: wrap; }
.dock-tabs button { background: transparent; border: 0; padding: 12px 16px 10px; font: 700 12px var(--vn); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; position: relative; }
.dock-tabs button .ph-id { opacity: .5; box-shadow: none; }
.dock-tabs button em { font: 600 10px var(--mono); font-style: normal; color: var(--cy); background: rgba(79, 216, 255, .12); padding: 0 6px; letter-spacing: 0; }
.dock-tabs button.on { color: #fff; text-shadow: 0 0 10px var(--cy); background: linear-gradient(180deg, transparent, rgba(79, 216, 255, .14)); }
.dock-tabs button.on .ph-id { opacity: 1; box-shadow: 0 0 10px var(--cy); }
.dock-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--cy); box-shadow: 0 0 12px var(--cy); }
.tab { display: none; } .tab.on { display: block; animation: tabin .35s ease-out; }
@keyframes tabin { from { opacity: 0; transform: translateY(6px); filter: brightness(2); } }

.hist { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; }
.hstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hs { position: relative; padding: 6px 8px; background: rgba(79, 216, 255, .05); border: 1px solid rgba(79, 216, 255, .14); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.hs span { display: block; font: 500 8.5px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.hs b { font: 700 14px var(--orb); text-shadow: 0 0 8px currentColor; }
.hs small { font: 400 9.5px var(--mono); color: var(--muted); margin-left: 4px; }
.rchart-h { display: flex; justify-content: space-between; margin: 12px 0 4px; font: 500 9px var(--mono); letter-spacing: .14em; color: var(--muted); }
.rchart-h em { font-style: normal; }
#rchart { width: 100%; height: 92px; display: block; }
.hfilter { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.hist-table { max-height: 270px; overflow-y: auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font: 500 11px var(--mono); }
th { position: sticky; top: 0; background: rgba(3, 14, 28, .95); text-align: left; font: 500 9px var(--mono); letter-spacing: .14em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid rgba(79, 216, 255, .25); white-space: nowrap; }
td { padding: 5px 8px; border-bottom: 1px dashed rgba(79, 216, 255, .08); white-space: nowrap; }
tr:hover td { background: rgba(79, 216, 255, .06); }
td.empty { color: var(--muted); font-family: var(--vn); padding: 16px 8px; }
.tag { font: 700 9px var(--mono); padding: 1px 5px; border: 1px solid currentColor; letter-spacing: .08em; }
.tag.s { color: var(--cy); } .tag.i { color: var(--amber); }
.rbar { display: inline-block; width: 46px; height: 6px; background: rgba(79, 216, 255, .1); position: relative; vertical-align: middle; margin-right: 6px; }
.rbar i { position: absolute; top: 0; bottom: 0; }
.log { max-height: 300px; overflow-y: auto; font: 400 11px/1.65 var(--mono); }
.log div { display: flex; gap: 10px; }
.log .tm { color: var(--faint); flex: none; }
.log .open { color: var(--cy); } .log .win { color: var(--up); } .log .loss { color: var(--down); } .log .block { color: var(--amber); }
.log div:first-child::after { content: "▌"; color: var(--cy); animation: blink 1s steps(2) infinite; }
::-webkit-scrollbar { width: 5px; height: 5px; } ::-webkit-scrollbar-thumb { background: var(--cy-line); } ::-webkit-scrollbar-track { background: transparent; }

footer { color: var(--faint); font: 500 10px var(--mono); letter-spacing: .24em; text-align: center; padding: 4px 16px 22px; }

/* ===== Màn khởi động ===== */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, #05203a, #010409 70%); transition: opacity .9s, visibility .9s; cursor: pointer; }
#boot.done { opacity: 0; visibility: hidden; }
.boot-rings { position: absolute; width: min(72vmin, 600px); aspect-ratio: 1; }
.boot-rings i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--cy-line); animation: spin 14s linear infinite; }
.boot-rings i:nth-child(1) { border: 2px solid; border-color: var(--cy) transparent rgba(79, 216, 255, .3) transparent; filter: drop-shadow(0 0 10px var(--cy)); }
.boot-rings i:nth-child(2) { inset: 7%; border-style: dashed; animation-direction: reverse; animation-duration: 20s; }
.boot-rings i:nth-child(3) { inset: 14%; border: 3px solid; border-color: transparent var(--amber) transparent transparent; animation-duration: 3s; filter: drop-shadow(0 0 10px var(--amber)); }
.boot-rings i:nth-child(4) { inset: 21%; border: 1px dotted var(--cy-2); animation-duration: 30s; }
.boot-box { position: relative; text-align: center; width: min(90vw, 440px); }
.boot-title { font: 900 36px var(--orb); letter-spacing: .34em; color: var(--gold); text-shadow: 0 0 26px rgba(255, 181, 71, .85); }
.boot-sub { font: 500 11px var(--mono); letter-spacing: .26em; color: var(--cy-2); margin-top: 4px; text-transform: uppercase; }
#boot-log { text-align: left; font: 400 11px/1.7 var(--mono); color: var(--cy); min-height: 140px; margin: 18px 0 10px; white-space: pre-wrap; }
#boot-log .ok { color: var(--up); }
.boot-bar { height: 3px; background: rgba(79, 216, 255, .15); }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cy), var(--amber)); box-shadow: 0 0 12px var(--cy); transition: width .25s; }
.boot-hint { font: 400 10px var(--mono); color: var(--faint); margin-top: 10px; letter-spacing: .22em; }

/* ===== Màn hình nhỏ ===== */
@media (max-width: 1360px) {
  .stage { grid-template-columns: 1fr 1fr; perspective: none; }
  .side.left, .side.right { transform: none; }
  .center { grid-column: 1 / -1; order: -1; }
  .hist { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --cut: 12px; }
  .stage { grid-template-columns: 1fr; padding: 12px; }
  .ctrl { margin-left: 0; }
  #core { height: 440px; } #chart { height: 240px; }
  .px { font-size: 22px; min-width: 0; }
  .quote-plate { padding: 4px 18px; }
  .hstats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation-duration: 200s; }
}

/* ===== Dải chỉ số trên lõi ===== */
.kpi-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.kp { position: relative; padding: 6px 10px 7px; background: linear-gradient(180deg, rgba(79, 216, 255, .1), rgba(79, 216, 255, .02)); border: 1px solid rgba(79, 216, 255, .2);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.kp::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--fill, 0%); background: var(--kc, var(--cy)); box-shadow: 0 0 8px var(--kc, var(--cy)); transition: width .4s; }
.kp span { display: block; font: 500 8.5px var(--mono); letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.kp b { font: 700 15px var(--orb); color: var(--kc, var(--cy-2)); text-shadow: 0 0 10px var(--kc, var(--cy)); white-space: nowrap; }
.kp small { font: 400 9px var(--mono); color: var(--muted); margin-left: 4px; }

/* ===== Detector bank ===== */
.agent .mini { display: block; width: 100%; height: 30px; margin: 4px 0 3px; }

/* ===== Ma trận phiếu ===== */
#heat { width: 100%; height: 190px; display: block; }

/* ===== Đồng hồ phiên ===== */
#clock { width: 100%; height: 230px; display: block; }
.clock-leg { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; font: 400 9.5px var(--mono); color: var(--muted); }
.clock-leg i { width: 8px; height: 8px; background: var(--c); box-shadow: 0 0 6px var(--c); margin: 0 3px 0 8px; display: inline-block; }

/* ===== Sổ lệnh + băng ===== */
.book-wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.book { font: 500 10.5px/1 var(--mono); }
.lv { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 2.5px 4px; }
.lv i { position: absolute; top: 1px; bottom: 1px; }
.lv.ask i { right: 0; background: linear-gradient(270deg, rgba(255, 90, 78, .45), rgba(255, 90, 78, .08)); }
.lv.bid i { right: 0; background: linear-gradient(270deg, rgba(46, 242, 176, .45), rgba(46, 242, 176, .08)); }
.lv span { position: relative; }
.lv span:last-child { text-align: right; color: var(--muted); }
.lv.ask span:first-child { color: #ff9a92; } .lv.bid span:first-child { color: #8ff7d6; }
.lv.mid { margin: 3px 0; padding: 4px; background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .4); }
.lv.mid span:first-child { color: var(--gold); font-weight: 700; } .lv.mid span:last-child { color: var(--amber); }
.tape { font: 500 10px/1 var(--mono); overflow: hidden; max-height: 300px; border-left: 1px solid rgba(79, 216, 255, .15); padding-left: 8px; }
.tp { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px; padding: 2.5px 0; border-bottom: 1px dashed rgba(79, 216, 255, .06); }
.tp .tt { color: var(--faint); } .tp.b .px2 { color: var(--up); } .tp.s .px2 { color: var(--down); }
.tp .sz { color: var(--muted); text-align: right; } .tp.big .sz { color: var(--gold); font-weight: 700; text-shadow: 0 0 6px var(--amber); }
.imb { display: inline-flex; align-items: center; gap: 6px; }
.imb i { display: inline-block; width: 60px; height: 5px; background: var(--down); position: relative; }
.imb i b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--up); }

@media (max-width: 1360px) { .kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .book-wrap { grid-template-columns: 1fr; } }

/* ===== Bảng chi tiết bật ra ===== */
[data-insp] { cursor: pointer; }
.holo[data-insp]:hover::before { filter: brightness(1.7); }
.agent[data-insp]:hover, .rz[data-insp]:hover { background: rgba(79, 216, 255, .06); }
.insp { position: fixed; z-index: 85; width: min(390px, calc(100vw - 20px)); max-height: 84vh; overflow-y: auto; --d: 0s; cursor: auto;
  box-shadow: 0 0 50px rgba(79, 216, 255, .25); background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--cy) 50%, transparent calc(50% + 1.5px)) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), var(--amber) 50%, transparent calc(50% + 1.5px)) bottom right / var(--cut) var(--cut) no-repeat,
    radial-gradient(120% 50% at 0 0, rgba(79, 216, 255, .2), transparent 60%),
    linear-gradient(160deg, rgba(8, 34, 60, .96), rgba(2, 10, 22, .97)); }
.insp-x { margin-left: 8px; width: 22px; height: 22px; padding: 0; background: rgba(255, 90, 78, .1); border: 1px solid rgba(255, 90, 78, .5); color: var(--down); font: 700 11px var(--mono); }
.insp-x:hover { background: var(--down); color: #fff; }
.i-role { font-size: 11px; color: var(--muted); margin: -4px 0 8px; }
.i-score { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.i-score b { font: 700 30px var(--orb); text-shadow: 0 0 14px currentColor; }
.i-score span { font: 700 11px var(--vn); letter-spacing: .16em; color: var(--cy-2); }
.isec { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font: 600 9.5px var(--mono); letter-spacing: .18em; color: var(--amber); text-transform: uppercase; }
.isec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 181, 71, .5), transparent); }
.igrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.igrid.one { grid-template-columns: 1fr; }
.ir { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(79, 216, 255, .1); font-size: 11px; }
.ir span { color: var(--muted); } .ir b { font: 600 11px var(--mono); text-align: right; }
.i-txt { font-size: 12px; }
.i-note { font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.i-mini { width: 100%; height: 64px; display: block; }
.itable { font-size: 10.5px; }
.itable th { position: static; background: none; padding: 4px 6px; }
.itable td { padding: 4px 6px; }
.icon { display: grid; grid-template-columns: 92px 1fr 50px; gap: 8px; align-items: center; font-size: 11px; padding: 2px 0; }
.icon .bar { margin: 0; } .icon b { font: 600 11px var(--mono); text-align: right; }
.ichk { display: flex; gap: 8px; align-items: center; font-size: 11px; padding: 2px 0; }
.ichk .hx { margin: 0; }
.iverd { margin-top: 12px; padding: 8px 10px; font: 700 11.5px var(--vn); letter-spacing: .1em; text-align: center; border: 1px solid; }
.iverd.ok { color: var(--up); border-color: var(--up); background: rgba(46, 242, 176, .1); box-shadow: 0 0 16px rgba(46, 242, 176, .3); }
.iverd.warn { color: var(--amber); border-color: var(--amber); background: rgba(255, 181, 71, .08); }
.iverd.idle { color: var(--muted); border-color: var(--faint); }

/* bảng chi tiết: mở mượt, không nháy */
.live .insp.holo { animation: inspIn .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes inspIn { from { opacity: 0; transform: translateY(6px) scale(.97); filter: brightness(1.4); } to { opacity: 1; transform: none; filter: none; } }

/* ===== Bản đồ mức giá ===== */
.ladder { font: 500 10.5px/1 var(--mono); }
.ld { --c: var(--muted); display: grid; grid-template-columns: 74px 62px 1fr 50px 34px; gap: 6px; align-items: center; padding: 3.5px 4px; border-bottom: 1px dashed rgba(79, 216, 255, .07); }
.ld .ln { color: var(--c); font: 600 10.5px var(--vn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld .lp { color: var(--text); }
.ld .lb { height: 4px; background: rgba(79, 216, 255, .07); }
.ld .lb i { display: block; height: 100%; background: var(--c); opacity: var(--h); box-shadow: 0 0 6px var(--c); }
.ld .lds { text-align: right; color: var(--muted); } .ld .la { text-align: right; color: var(--faint); }
.ld.piv { --c: #ffb547; } .ld.pd { --c: #ffd27a; } .ld.asia { --c: #b48cff; } .ld.vwap { --c: #2ef2d0; } .ld.rnd { --c: #4f7a99; }
.ld.sl { --c: var(--down); } .ld.tp { --c: var(--up); } .ld.pos { --c: #9ff1ff; }
.ld.now { margin: 4px 0; padding: 6px 4px; background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .45); box-shadow: 0 0 14px rgba(255, 181, 71, .2); }
.ld.now .ln, .ld.now .lp { color: var(--gold); font-weight: 700; } .ld.now .lds, .ld.now .la { color: var(--amber); }
.lad-leg { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 8px; font: 400 9.5px var(--mono); color: var(--muted); }
.lad-leg i { width: 8px; height: 8px; background: var(--c); margin: 0 3px 0 8px; display: inline-block; }

.chip.sim.bad { color: var(--down); border-color: rgba(255, 90, 78, .5); background: rgba(255, 90, 78, .1); }
.chip.learn { color: var(--cy, #3fd7ff); border-color: rgba(63, 215, 255, .45); background: rgba(63, 215, 255, .07); white-space: nowrap; }
.chip.sim.real { color: var(--up); border-color: rgba(40, 255, 170, .5); background: rgba(40, 255, 170, .08); font-weight: 700; }

/* Sổ đêm · tiến hoá (tab 13) */
.notes { max-height: 420px; overflow-y: auto; font: 400 12px/1.6 var(--mono); color: var(--text); white-space: pre-wrap; word-break: break-word; padding: 6px 2px; }
.notes h1, .notes h2, .notes h3 { font: 700 12px var(--vn); letter-spacing: .14em; text-transform: uppercase; color: var(--cy); margin: 14px 0 6px; }
.notes h1 { font-size: 13px; color: var(--amber); }
.notes table { border-collapse: collapse; margin: 6px 0; font-size: 11px; }
.notes td, .notes th { border: 1px solid rgba(79, 216, 255, .18); padding: 2px 8px; vertical-align: top; }
.notes th { color: var(--cy); text-align: left; }
.notes b { color: var(--amber); }
.notes-tabs { margin: 8px 0 10px; }
.notes .meta { color: var(--faint); font-size: 10px; margin-bottom: 6px; }

/* ===== Bộ chọn ngôn ngữ (thanh đầu, góc phải) ===== */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; background: rgba(79, 216, 255, .07); border: 1px solid var(--cy-line);
  font: 600 11px var(--mono); letter-spacing: .12em; color: var(--cy-2); clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); transition: background .2s; }
.lang-btn:hover, .lang.open .lang-btn { background: rgba(79, 216, 255, .2); }
.lang-btn i { font-style: normal; color: var(--muted); font-size: 9px; transition: transform .2s; }
.lang.open .lang-btn i { transform: rotate(180deg); }
.flag { font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 15px; line-height: 1; letter-spacing: 0; }
.lang-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; margin: 0; padding: 4px; list-style: none; width: 200px; max-height: min(70vh, 420px); overflow-y: auto;
  background: linear-gradient(160deg, rgba(8, 34, 60, .97), rgba(2, 10, 22, .98)); border: 1px solid var(--cy-line); box-shadow: 0 0 30px rgba(79, 216, 255, .25); }
.lang.open .lang-menu { display: block; }
.lang-menu button { width: 100%; display: grid; grid-template-columns: 22px 38px 1fr; align-items: center; gap: 8px; padding: 7px 10px; background: transparent; border: 0;
  border-left: 2px solid transparent; text-align: left; color: var(--text); font: 500 12px var(--vn); }
.lang-menu button b { font: 600 10.5px var(--mono); letter-spacing: .12em; color: var(--cy); }
.lang-menu button:hover { background: rgba(79, 216, 255, .12); }
.lang-menu button.on { background: rgba(79, 216, 255, .18); border-left-color: var(--cy); }
.notes .i18n-note { display: block; color: var(--amber); font: 400 10px var(--mono); margin-bottom: 6px; opacity: .85; }
@media (max-width: 760px) {
  .ctrl { width: 100%; justify-content: flex-end; }
  .lang { margin-left: auto; }
}
td.empty { white-space: normal; }
.hist > * { min-width: 0; }
.notes-tabs.seg { display: flex; flex-wrap: wrap; }
