:root {
  --bg: #000;
  --panel: #050505;
  --line: #262626;
  --amber: #ffa028;
  --amber-dim: #b86e12;
  --orange: #fb8b1e;
  --white: #f2f2f2;
  --grey: #8a8a8a;
  --up: #3ddc84;
  --down: #ff433d;
  --blue: #2f6fd1;
  --blue-dim: #12305e;
  --yellow: #f5d300;
  --head: #1a1a1a;
  --font: 'IBM Plex Mono', Consolas, 'Lucida Console', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--amber); font: 12px/1.35 var(--font); overflow: hidden; }
button { font: inherit; }
a { color: var(--amber); }

.topbar { display: flex; align-items: center; gap: 16px; height: 26px; padding: 0 8px; background: #111; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--white); letter-spacing: 1px; }
.brand-mark { background: var(--orange); color: #000; padding: 0 4px; margin-right: 2px; }
.clocks { display: flex; gap: 14px; color: var(--grey); }
.clocks b { color: var(--amber); font-weight: 500; }
.status { margin-left: auto; display: flex; gap: 10px; }
.badge { padding: 0 6px; border: 1px solid currentColor; font-size: 11px; }
.badge.ok { color: var(--up); } .badge.warn { color: var(--yellow); } .badge.bad { color: var(--down); }

.tape { height: 22px; overflow: hidden; white-space: nowrap; background: #080808; border-bottom: 1px solid var(--line); }
.tape-inner { display: inline-block; padding-left: 100%; animation: tape 90s linear infinite; line-height: 22px; }
.tape:hover .tape-inner { animation-play-state: paused; }
.tape-item { margin-right: 26px; cursor: pointer; }
.tape-item .n { color: var(--white); margin-right: 6px; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.grid { display: grid; grid-template-columns: var(--cols, 1fr 1fr); grid-template-rows: var(--rows, 1fr 1fr); gap: 3px; padding: 3px; height: calc(100% - 26px - 22px - 22px); }
.grid.maxed { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.grid.maxed .panel:not(.max) { display: none; }

.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); }
.panel.active { border-color: var(--amber-dim); }
.panel-head { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px; background: var(--head); border-bottom: 1px solid var(--line); }
.panel-num { background: var(--grey); color: #000; font-weight: 700; padding: 0 5px; }
.panel.active .panel-num { background: var(--amber); }
.cmd-wrap { position: relative; flex: 0 1 340px; min-width: 120px; }
.cmd { width: 100%; height: 18px; background: #000; color: var(--yellow); border: 1px solid #333; padding: 0 4px; font: 600 12px var(--font); text-transform: uppercase; outline: none; caret-color: var(--yellow); }
.cmd:focus { border-color: var(--amber); }
.cmd::placeholder { color: #555; text-transform: none; font-weight: 400; }
.suggest { position: absolute; top: 19px; left: 0; right: -120px; z-index: 20; background: #0b0b0b; border: 1px solid var(--amber-dim); display: none; max-height: 260px; overflow: auto; }
.suggest.open { display: block; }
.suggest div { padding: 2px 6px; display: flex; gap: 8px; cursor: pointer; white-space: nowrap; }
.suggest div.sel, .suggest div:hover { background: var(--blue-dim); }
.suggest .s-sym { color: var(--white); min-width: 120px; }
.suggest .s-name { color: var(--amber); overflow: hidden; text-overflow: ellipsis; }
.suggest .s-type { color: var(--grey); margin-left: auto; }
.panel-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--white); }
.panel-title .fn { color: #000; background: var(--orange); padding: 0 4px; margin-right: 6px; font-weight: 600; }
.panel-max { background: none; border: 1px solid #333; color: var(--grey); cursor: pointer; padding: 0 4px; line-height: 14px; }
.panel-max:hover { color: var(--amber); border-color: var(--amber); }
.panel-sub { display: flex; gap: 2px; padding: 2px 4px; border-bottom: 1px solid var(--line); min-height: 22px; flex-wrap: wrap; align-items: center; }
.panel-sub:empty { display: none; }
.panel-body { flex: 1; overflow: auto; position: relative; padding: 4px 6px; min-height: 0; }
.panel-body.chart-body { overflow: hidden; display: flex; flex-direction: column; }

.tab { background: #151515; color: var(--amber); border: none; padding: 1px 7px; cursor: pointer; }
.tab:hover { background: #222; }
.tab.on { background: var(--blue); color: var(--white); }
.sub-label { color: var(--grey); margin: 0 4px 0 8px; }
.sub-spacer { flex: 1; }

/* tables */
table.t { width: 100%; border-collapse: collapse; white-space: nowrap; }
.t th { position: sticky; top: -4px; background: #0d0d0d; color: var(--grey); font-weight: 500; text-align: right; padding: 2px 6px; border-bottom: 1px solid var(--line); }
.t td { text-align: right; padding: 1px 6px; color: var(--white); }
.t th:first-child, .t td:first-child, .t .l { text-align: left; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #161616; }
.t tr.group td { color: var(--orange); font-weight: 600; text-align: left; padding-top: 6px; border-bottom: 1px solid #222; }
.t td.sym { color: var(--amber); }
.t td.name { color: var(--amber); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.num-row { color: var(--grey); width: 22px; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flash-up { animation: flup 1s; } .flash-down { animation: fldn 1s; }
@keyframes flup { from { background: rgba(61,220,132,.35); } to { background: transparent; } }
@keyframes fldn { from { background: rgba(255,67,61,.35); } to { background: transparent; } }

/* DES */
.des-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.des-name { color: var(--white); font-size: 15px; font-weight: 600; }
.des-px { font-size: 20px; color: var(--white); font-weight: 600; }
.des-chg { font-size: 14px; }
.des-meta { color: var(--grey); }
.des-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; }
.box h4 { margin: 0 0 3px; color: #000; background: var(--amber); font-size: 11px; padding: 0 4px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 0 2px; }
.kv span:first-child { color: var(--amber); }
.kv span:last-child { color: var(--white); text-align: right; }
.des-text { color: #d9d9d9; margin: 8px 0; max-width: 100ch; }
.mini-chart { height: 110px; margin: 6px 0; }

/* charts */
.chart-stats { display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 0 4px; }
.chart-stats span { color: var(--grey); } .chart-stats b { color: var(--white); font-weight: 500; }
.chart-wrap { flex: 1; position: relative; min-height: 0; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 2px 0; }
.legend i { display: inline-block; width: 10px; height: 3px; vertical-align: middle; margin-right: 4px; }

/* ANR */
.bar-row { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.bar-row .lbl { width: 90px; color: var(--amber); }
.bar-row .bar { height: 12px; }
.bar-row .cnt { color: var(--white); }

/* news */
.news-item { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dotted #222; }
.news-item .nt { color: var(--grey); width: 92px; flex: none; }
.news-item .nh { color: var(--white); flex: 1; }
.news-item a.nh { text-decoration: none; } .news-item a.nh:hover { color: var(--amber); }
.news-item .np { color: var(--amber-dim); flex: none; }

.help h3 { color: var(--orange); margin: 6px 0 2px; font-size: 12px; }
.help .row { display: flex; gap: 12px; } .help .code { color: var(--yellow); width: 70px; flex: none; }
.help .ex { color: var(--grey); }
.msg { color: var(--grey); padding: 10px; }
.err { color: var(--down); padding: 10px; }
.loading { color: var(--amber-dim); padding: 10px; }
.loading::after { content: '_'; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.src { color: #555; font-size: 10px; text-align: right; padding-top: 4px; }

.keybar { height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #111; border-top: 1px solid var(--line); color: var(--grey); white-space: nowrap; overflow: hidden; }
.key { background: #2a2a2a; color: var(--white); padding: 0 5px; margin-left: 8px; }
.key-help { background: var(--yellow); color: #000; } .key-menu { background: var(--down); color: #fff; } .key-go { background: var(--up); color: #000; }
.hint { margin-left: auto; } .hint b { color: var(--amber); font-weight: 500; }

::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: #000; } ::-webkit-scrollbar-thumb { background: #333; }

/* phones and narrow windows: one panel at a time, switched from the bottom bar */
.mtabs { display: none; }
@media (max-width: 900px) {
  .clocks, .hint, .keybar, .split, .panel-resize, .panel-max, .brand { display: none !important; }
  .topbar { gap: 8px; overflow-x: auto; }
  .topbar > *, .menu button, .badge { flex: none; white-space: nowrap; }
  .status { margin-left: 0; }
  .menu { overflow-x: auto; flex-wrap: nowrap; }
  .menu button:not(.menu-help) { display: inline-block !important; }
  .grid, .grid.free { display: block; height: calc(100% - 26px - 22px - 44px); padding: 0; }
  .grid .panel, .grid.free .panel { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; height: 100% !important; box-shadow: none; }
  .grid .panel:not(.active) { display: none; }
  .panel-head { height: 34px; }
  .cmd { font-size: 16px !important; }
  .panel-title { display: none; }
  .panel-btn { padding: 2px 6px; }
  .panel-sub { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .panel-sub .tab { flex: none; padding: 4px 8px; }
  .panel-body { -webkit-overflow-scrolling: touch; }
  .des-grid { grid-template-columns: 1fr; }
  .t td, .t th { white-space: nowrap; }
  .mtabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 44px; background: #111; border-top: 1px solid var(--line); z-index: 200; }
  .mtabs button { flex: 1; background: none; border: none; border-right: 1px solid var(--line); color: var(--grey); font-weight: 600; }
  .mtabs button.on { color: #000; background: var(--amber); }
  .bt-low { flex-direction: column; }
  .t.bt-stats { width: 100%; }
}

/* EQS form */
.eqs-form { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 4px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.eqs-form label { color: var(--amber); display: flex; align-items: center; gap: 4px; }
.eqs-form input, .eqs-form select { background: #000; color: var(--yellow); border: 1px solid #333; font: 12px var(--font); height: 18px; padding: 0 3px; }
.eqs-form input { width: 64px; }
.eqs-form input:focus, .eqs-form select:focus { outline: none; border-color: var(--amber); }
.eqs-form .go { background: var(--up); color: #000; border: none; padding: 0 10px; height: 18px; cursor: pointer; font-weight: 600; }
.eqs-form .reset { background: #222; color: var(--amber); border: none; padding: 0 8px; height: 18px; cursor: pointer; }
.eqs-sum { color: var(--grey); margin: 2px 0 4px; } .eqs-sum b { color: var(--white); font-weight: 500; }

/* FA */
.fa-unit { color: var(--grey); padding: 2px 0 4px; }
.t tr.sect td { color: var(--orange); font-weight: 600; text-align: left; padding-top: 6px; }
.t td.lbl { color: var(--amber); text-align: left; }
.t tr.click:hover td.lbl { color: var(--yellow); }

/* TOP news */
.top-item { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #1d1d1d; align-items: baseline; }
.top-item .tn { color: var(--grey); width: 26px; text-align: right; flex: none; }
.top-item .tt { color: var(--grey); width: 44px; flex: none; }
.top-item .tg { flex: none; font-size: 10px; padding: 0 3px; background: #222; color: var(--white); min-width: 30px; text-align: center; }
.top-item .tg.BN { background: var(--orange); color: #000; }
.top-item .th { color: var(--white); flex: 1; text-decoration: none; }
.top-item a.th:hover { color: var(--yellow); }
.top-item.hot .th { color: var(--yellow); }
.gf-wrap { flex: 1; position: relative; min-height: 160px; }

/* news reader */
.click-row { cursor: pointer; }
.click-row:hover .th, .click-row:hover .nh { color: var(--yellow); }
.reader { max-width: 110ch; }
.reader-bar { display: flex; gap: 10px; align-items: center; padding: 2px 0 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader-bar .tg { font-size: 10px; padding: 0 3px; background: #222; color: var(--white); }
.reader-bar .tg.BN { background: var(--orange); color: #000; }
.rd-pub { color: var(--amber); } .rd-time { color: var(--grey); }
.rd-orig { margin-left: auto; color: var(--yellow); text-decoration: none; }
.rd-orig:hover { text-decoration: underline; }
.rd-title { color: var(--white); font-size: 16px; line-height: 1.3; margin: 10px 0 4px; font-weight: 600; }
.rd-meta { color: var(--grey); margin-bottom: 8px; }
.rd-lede { color: var(--amber); font-size: 13px; }
.reader [data-text] p { color: #e6e6e6; font-size: 13px; line-height: 1.55; margin: 0 0 10px; }
.rd-note { color: var(--grey); border-left: 2px solid var(--amber-dim); padding: 4px 8px; margin-top: 8px; }

/* Top menu + clickable help */
.menu { display: flex; gap: 2px; }
.menu button { background: #222; color: var(--orange); border: 1px solid #333; font: inherit; font-size: 11px; padding: 1px 7px; cursor: pointer; }
.menu button:hover { background: var(--orange); color: #000; }
.menu .menu-help { background: #2a1d00; color: var(--yellow); border-color: var(--orange); font-weight: bold; }
.click-help { cursor: pointer; } .click-help:hover { color: var(--yellow); }
.help .row.click { cursor: pointer; } .help .row.click:hover { background: #1c1c1c; }
@media (max-width: 1100px) { .menu button:not(.menu-help) { display: none; } }
.reader [data-text] p.rd-tbl { font-size: 12px; color: #cfcfcf; white-space: pre-wrap; margin: 0 0 3px; }

/* research functions */
.t tr.self td { background: #1d1405; }
.t tr.med td { color: var(--yellow); border-top: 1px solid var(--line); }
.t tr.grp td { color: #000; background: var(--amber-dim); font-weight: 600; }
.t tr.past td { color: var(--grey); }
.t th .dim, .dim { color: var(--grey); }
.scroll-tbl { flex: 1; overflow: auto; min-height: 80px; }
.sec-h { margin: 10px 0 3px; color: #000; background: var(--amber); font-size: 11px; padding: 0 4px; font-weight: 600; }
.omon-head { padding: 2px 0 6px; color: var(--grey); } .omon-head b { color: var(--white); font-weight: 500; }
.omon th.calls-h { text-align: center; color: var(--up); } .omon th.puts-h { text-align: center; color: var(--down); }
.omon td.strike, .omon th.strike { text-align: center; color: var(--yellow); background: #111; }
.omon td.itm { background: #0f1a2a; }
.omon tr.atm td { border-top: 1px solid var(--amber-dim); border-bottom: 1px solid var(--amber-dim); }
.imp-High { color: var(--down); font-weight: 600; } .imp-Medium { color: var(--amber); } .imp-Low { color: var(--grey); } .imp-Holiday { color: var(--blue); }
.ev-EARNINGS { color: var(--yellow); } .ev-EX-DIVIDEND, .ev-DIVIDEND { color: var(--up); }
.imap { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.imap-g { position: absolute; border: 1px solid #000; background: #111; }
.imap-gh { height: 15px; line-height: 15px; padding: 0 4px; color: var(--white); font-size: 11px; overflow: hidden; white-space: nowrap; }
.imap-t { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; color: #fff; font-size: 11px; line-height: 1.2; }
.imap-t:hover { outline: 1px solid var(--yellow); z-index: 1; }
.imap-t span { font-size: 10px; opacity: .9; }
.splc-p { color: #e6e6e6; line-height: 1.5; margin: 0 0 8px; max-width: 120ch; }
.t td.soon { color: var(--yellow); }
.sent-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
.sent-fg .gauge { width: 140px; display: block; margin: 2px auto 0; }
.fg-score { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 4px; } .fg-score span { font-size: 11px; }
.sent-s { display: inline-block; width: 34px; text-align: right; margin-right: 8px; }
.badge.upd { background: var(--up); color: #000; cursor: pointer; font-weight: 600; } .updt-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.toast { position: fixed; right: 12px; bottom: 30px; z-index: 50; background: #1d1405; border: 1px solid var(--orange); color: var(--white); padding: 8px 12px; max-width: 360px; cursor: pointer; box-shadow: 0 4px 18px #000; }
.toast b { color: var(--yellow); margin-right: 6px; } .toast span { color: var(--grey); }
.toast + .toast { bottom: 80px; }
.alrt-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.alrt-form input, .alrt-form select { background: #111; color: var(--white); border: 1px solid #333; font: inherit; padding: 1px 4px; }
.panel-btn.off { opacity: 0.35; }
.panel-btn { background: none; border: 1px solid #333; color: var(--grey); cursor: pointer; padding: 0 3px; line-height: 14px; font-size: 10px; margin-right: 2px; } .panel-btn:hover { color: var(--amber); border-color: var(--amber); }
/* layout: splitters, swap-by-drag, free windows */
.grid { position: relative; }
.split { position: absolute; z-index: 5; background: transparent; }
.split:hover, body.dragging .split:active { background: var(--amber-dim); }
.split-v { top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.split-h { left: 0; right: 0; height: 6px; cursor: row-resize; }
.grid.free .split, .grid.maxed .split { display: none; }
.grid.free { display: block; }
.grid.free .panel { position: absolute; box-shadow: 0 4px 18px rgba(0,0,0,.6); }
.grid.free .panel-head { cursor: move; }
.grid.maxed .panel.max { position: static; width: auto !important; height: 100% !important; }
.grid.free.maxed .panel.max { position: absolute; left: 0 !important; top: 0 !important; width: 100% !important; z-index: 100 !important; }
.panel { position: relative; }
.panel-resize { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; display: none; background: linear-gradient(135deg, transparent 50%, var(--grey) 50%); opacity: .6; }
.grid.free .panel-resize { display: block; }
.grid:not(.free) .panel-head { cursor: grab; }
.panel.lifted { opacity: .6; }
.panel.drop { outline: 2px dashed var(--amber); outline-offset: -2px; }
body.dragging, body.dragging * { user-select: none !important; }
.layout-top { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.layout-top .alrt-form { margin: 0 0 0 10px; }
/* GC, CORR, FXC, BT */
.gc-wrap { height: 260px; flex: none; }
.gc-svg { width: 100%; height: 100%; display: block; }
.gc-svg text { font-family: "IBM Plex Mono", Consolas, monospace; }
.t.corr td.corr-c { text-align: center; color: #fff; min-width: 54px; }
.t.corr td.click-c { cursor: pointer; } .t.corr td.click-c:hover { outline: 1px solid var(--amber); }
.t.fxc td { min-width: 70px; }
.bt-low { display: flex; gap: 10px; min-height: 0; flex: 1; }
.t.bt-stats { width: 380px; flex: none; align-self: flex-start; }
.alrt-form label input { background: #000; color: var(--amber); border: 1px solid #333; font: inherit; }
/* login */
.login { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 500; display: flex; align-items: center; justify-content: center; }
.login-box { display: flex; flex-direction: column; gap: 10px; width: min(340px, 90vw); border: 1px solid var(--amber-dim); background: #080808; padding: 20px; }
.login-box input { background: #000; border: 1px solid #333; color: var(--amber); font: 16px var(--font); padding: 6px 8px; }
.login-box button { background: var(--amber); color: #000; border: none; padding: 8px; font-weight: 700; cursor: pointer; }
.alrt-form input[type=password] { background: #000; color: var(--amber); border: 1px solid #333; font: inherit; padding: 1px 4px; }
/* AI summary */
.ai-btn { margin-left: 8px; color: #000 !important; background: #9a7cff !important; }
.ai-box { border: 1px solid #5b4aa8; background: #0c0a16; padding: 6px 10px; margin: 6px 0 10px; color: var(--white); }
.ai-box .ai-head { color: #b9a6ff; font-weight: 600; margin-bottom: 4px; }
.ai-box h4 { color: var(--amber); margin: 8px 0 2px; font-size: 11px; }
.ai-box p { margin: 2px 0; }
.ai-box .ai-li { padding-left: 12px; text-indent: -10px; } .ai-box .ai-li::before { content: '\25B8  '; color: var(--amber); }
.seg-t tr.seg-main td { border-top: 1px solid #2a2a2a; font-weight: 600; }
.seg-t tr.seg-main td.name { color: #ffa028; }
.seg-t tr.sub td { font-size: 11px; }
.omon td.opt { cursor: pointer; }
.omon tr:hover td.opt:hover { outline: 1px solid var(--amber-dim); }
.mgmt { padding: 2px 2px 3px; border-bottom: 1px solid #222; }
.mgmt:last-child { border-bottom: 0; }
.mgmt-n { color: var(--white); }
.mgmt-t { color: var(--grey); font-size: 11px; line-height: 1.25; }
