:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e5e8ee;
  --line2: #eef1f5;
  --text: #1b2330;
  --muted: #6b7686;
  --faint: #9aa4b2;
  --blue: #1f6feb;
  --blue-bg: #eaf2ff;
  --up: #0a9f6b;
  --up-bg: #e7f7f0;
  --down: #e0464c;
  --down-bg: #fdecec;
  --ref: #c98a00;
  --ref-bg: #fff6df;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 'Be Vietnam Pro', system-ui, sans-serif; }
.mono, .num, td.num { font-family: 'Roboto Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
b { font-weight: 600; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.refc { color: var(--ref); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand b { display: block; font-size: 15px; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11px; }
nav { display: flex; gap: 2px; height: 100%; }
nav button { white-space: nowrap; background: none; border: 0; padding: 0 14px; height: 100%; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; position: relative; }
nav button:hover { color: var(--text); }
nav button.active { color: var(--blue); border-bottom-color: var(--blue); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.status i, .pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.status.on i, .pill.on i { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.status.err i, .pill.err i { background: var(--down); }
.clock { font-size: 12px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 3px 12px; font-size: 12px; cursor: pointer; }
.chip.aggr { border-color: #f3c2c4; color: var(--down); background: var(--down-bg); }
.icon-btn { border: 1px solid var(--line); background: var(--card); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.icon-btn:hover, .chip:hover { border-color: #c9d0da; }
.icon-btn.off { opacity: .45; }
.icon-btn.active { border-color: var(--blue); color: var(--blue); }

/* ---------- Ticker tape ---------- */
.tape { overflow: hidden; border-top: 1px solid var(--line2); background: #fafbfd; height: 36px; position: relative; }
.tape::before, .tape::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 1; pointer-events: none; }
.tape::before { left: 0; background: linear-gradient(90deg, #fafbfd, transparent); }
.tape::after { right: 0; background: linear-gradient(270deg, #fafbfd, transparent); }
.tape-track { display: inline-flex; white-space: nowrap; height: 36px; align-items: center; animation: tape 60s linear infinite; padding-left: 24px; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 18px; font-size: 13px; border-right: 1px solid var(--line); }
.tape-item .lbl { color: var(--muted); font-size: 12px; }
.tape-item .val { font-family: 'Roboto Mono', monospace; font-weight: 600; }
.tape-item .val.txt, .tape-item .chg.txt { font-family: inherit; }
.tape-item .chg { font-family: 'Roboto Mono', monospace; font-size: 12px; }
.tape-item.hl .lbl { color: var(--blue); font-weight: 600; }

/* ---------- Layout ---------- */
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; }
.tab { display: none; }
.tab.active { display: block; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; }
.tab > .card, .tab > .kpis, .tab > .quotes, .tab > .hero, .tab > .layout, .tab > #btResult { margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub, .sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.empty { color: var(--faint); text-align: center; padding: 18px 8px; font-size: 13px; }
.empty.big { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; color: var(--muted); }
.scroll { overflow: auto; max-height: 520px; }

/* ---------- Quotes ---------- */
.quotes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.quote { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.quote .q-name { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.quote .q-val { font-family: 'Roboto Mono', monospace; font-size: 26px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.quote .q-chg { font-family: 'Roboto Mono', monospace; font-size: 13px; }
.quote .q-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.quote svg.spark { position: absolute; right: 14px; top: 38px; width: 96px; height: 34px; opacity: .9; }
.quote.dir-long { border-top: 3px solid var(--up); }
.quote.dir-short { border-top: 3px solid var(--down); }
.quote.dir-flat { border-top: 3px solid var(--ref); }
.big-side { font-size: 24px; font-weight: 700; letter-spacing: .3px; margin-top: 4px; }

/* ---------- Charts ---------- */
.chart { height: 460px; }
.chart.short { height: 240px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- Controls ---------- */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 12px; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 500; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c9d0da; background: #fbfcfd; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1a5fd0; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.ghost-danger { color: var(--down); }
.btn:disabled { opacity: .55; cursor: wait; }
.form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.f.grow { flex: 1; min-width: 200px; }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--card); color: var(--text); min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--blue-bg); border-color: var(--blue); }
.checks { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--blue); font-size: 13px; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px; }

/* ---------- Tags ---------- */
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--line2); color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag.ok, .tag.long { background: var(--up-bg); color: var(--up); }
.tag.no, .tag.short { background: var(--down-bg); color: var(--down); }
.tag.wait { background: var(--ref-bg); color: var(--ref); }
.tag.info { background: var(--blue-bg); color: var(--blue); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
th.num, td.num { text-align: right; white-space: nowrap; }
td.mono { white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fc; }
td.win { background: var(--up-bg); font-weight: 600; }
.kv td { padding: 7px 0; }
.kv td:first-child { white-space: nowrap; padding-right: 16px; }
.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- Phase / trend ---------- */
.phase-top { display: flex; align-items: center; gap: 12px; }
.phase-badge { padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 15px; }
.phase-badge.long { background: var(--up-bg); color: var(--up); }
.phase-badge.short { background: var(--down-bg); color: var(--down); }
.phase-badge.flat { background: var(--ref-bg); color: var(--ref); }
.phase-desc { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.meter { margin-top: 12px; }
.meter .m-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meter .m-track { height: 6px; border-radius: 3px; background: var(--line2); position: relative; overflow: hidden; }
.meter .m-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.align { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.align .tf { border: 1px solid var(--line); border-radius: 8px; padding: 12px; position: relative; }
.align .tf.key { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.align .tf .t { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.align .tf .s { font-size: 18px; font-weight: 700; margin: 4px 0; }
.align .tf .d { font-size: 12px; color: var(--muted); }
.consensus { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--bg); font-size: 13px; }

/* ---------- Hero ---------- */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; box-shadow: var(--shadow); }
.hero .h-side { font-size: 30px; font-weight: 700; }
.hero .h-text h2 { margin: 0 0 4px; font-size: 17px; }
.hero .h-text p { margin: 0; color: var(--muted); font-size: 13px; }
.hero .h-stats { display: flex; gap: 22px; }
.hero .h-stats div { text-align: right; font-size: 12px; color: var(--muted); }
.hero .h-stats b { display: block; font-size: 18px; color: var(--text); font-family: 'Roboto Mono', monospace; }
.hero.long { border-left: 4px solid var(--up); }
.hero.short { border-left: 4px solid var(--down); }
.hero.flat { border-left: 4px solid var(--ref); }
.steps { margin: 0; padding-left: 20px; font-size: 13px; display: grid; gap: 8px; }
.notice { background: var(--ref-bg); border: 1px solid #f4dfa8; color: #7a5600; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }
.notice.err { background: var(--down-bg); border-color: #f5c6c8; color: #a1262b; }
.notice.info { background: var(--blue-bg); border-color: #c8dcfb; color: #1a4fa8; }

/* ---------- Tickets ---------- */
.ticket { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; border-left: 4px solid var(--faint); }
.ticket:last-child { margin-bottom: 0; }
.ticket.long { border-left-color: var(--up); }
.ticket.short { border-left-color: var(--down); }
.ticket.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { background: var(--blue-bg); } }
.t-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-head .side { font-weight: 700; font-size: 16px; }
.t-head .setup { font-family: 'Roboto Mono', monospace; font-weight: 600; background: var(--bg); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.t-head .name { color: var(--muted); font-size: 13px; }
.t-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.t-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.t-grid > div { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 11px; color: var(--muted); }
.t-grid b { display: block; font-family: 'Roboto Mono', monospace; font-size: 15px; color: var(--text); }
.t-grid b.neg { color: var(--down); }
.t-grid b.pos { color: var(--up); }
.t-cond, .t-note, .t-act { font-size: 13px; margin-top: 10px; }
.t-note { color: var(--muted); }
.t-act { background: var(--blue-bg); color: #1a4fa8; border-radius: 8px; padding: 8px 12px; }
.t-adds { font-size: 12px; color: var(--muted); margin-top: 8px; display: grid; gap: 2px; }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 3px; font-size: 12px; }
.checklist li::before { content: '○'; margin-right: 6px; color: var(--faint); }
.checklist li.ok::before { content: '●'; color: var(--up); }
.checklist li.no { color: var(--muted); }

/* ---------- Setup monitor ---------- */
.setup-row { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.setup-row:last-child { border-bottom: 0; }
.setup-row .s-top { display: flex; gap: 8px; align-items: center; }
.setup-row .s-top b { font-family: 'Roboto Mono', monospace; }
.setup-row .s-top span { font-size: 13px; }
.setup-row .s-top .tag { margin-left: auto; }
.prog { display: flex; gap: 3px; margin-top: 6px; }
.prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--line2); }
.prog i.ok { background: var(--up); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-family: 'Roboto Mono', monospace; font-size: 22px; font-weight: 600; margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card .kpis { gap: 10px; }
.card .kpi { box-shadow: none; background: var(--bg); border: 0; }

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed time { font-family: 'Roboto Mono', monospace; font-size: 12px; color: var(--faint); }
.feed li.flash { animation: flash 1.6s ease 2; }
.feed .ev { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--faint); vertical-align: middle; }
.feed .ev.signal { background: var(--blue); }
.feed .ev.fill { background: var(--up); }
.feed .ev.exit, .feed .ev.risk { background: var(--down); }
.feed .ev.cycle, .feed .ev.regime { background: var(--ref); }

/* ---------- Backtest ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .pos { background: #7fd1b0; }
.bars .neg { background: #f2a3a6; }
.axis { display: flex; gap: 3px; font-size: 10px; color: var(--faint); margin-top: 4px; }
.axis span { flex: 1; text-align: center; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.verdict { display: flex; gap: 12px; align-items: center; }
.verdict .tag { font-size: 12px; padding: 3px 10px; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-nav { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; position: sticky; top: 112px; }
.side-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.side-nav button.active { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.set-pane { display: none; }
.set-pane.active { display: grid; gap: 16px; }
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-opt { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.profile-opt.active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.profile-opt h3 { margin: 0 0 6px; font-size: 14px; }
.profile-opt ul { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.cfg { display: grid; gap: 12px; }
.cfg-group { border: 1px solid var(--line); border-radius: 10px; }
.cfg-group summary { padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.cfg-group summary span { font-weight: 400; color: var(--muted); }
.cfg-group .cfg-fields { padding: 4px 14px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, .35); display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal.open { display: flex; }
.modal .card { width: min(1100px, 100%); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1b2330; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--down); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero .h-stats { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 8px; }
  nav { order: 3; width: 100%; overflow-x: auto; height: 40px; }
  main { padding: 16px; }
  .quotes, .align, .grid2, .profiles, .settings { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; }
  .chart { height: 340px; }
}

@media (max-width: 720px) { .clock, .brand small { display: none; } }
input.date { width: 128px; font-variant-numeric: tabular-nums; }

/* ---------- Phiếu lệnh dạng bậc thang ---------- */
.ladder { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ladder table { font-size: 13px; }
.ladder th { position: static; }
.ladder td { border-bottom: 1px solid var(--line2); vertical-align: middle; }
.ladder tr:last-child td { border-bottom: 0; }
.ladder .step { font-weight: 600; white-space: nowrap; }
.ladder .px { font-family: 'Roboto Mono', monospace; font-weight: 600; white-space: nowrap; }
.ladder .qty { font-family: 'Roboto Mono', monospace; font-weight: 600; text-align: right; white-space: nowrap; }
.ladder tr.entry td { background: var(--blue-bg); }
.ladder tr.stop td .px { color: var(--down); }
.ladder tr.tp td .px { color: var(--up); }
.ladder tr.done td { color: var(--faint); text-decoration: line-through; }
.ladder-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 8px 12px; background: #fafbfc; border-top: 1px solid var(--line); }
.ladder-sum b { font-family: 'Roboto Mono', monospace; }
.cap-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cap-grid .kpi { box-shadow: none; background: var(--bg); border: 0; }
.cap-grid .kpi .value { font-size: 20px; }
.stop-table { margin-top: 12px; }
.stop-table td, .stop-table th { text-align: center; }
.stop-table th:first-child, .stop-table td:first-child { text-align: left; }
.watch-row { padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.watch-row:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .cap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ladder { overflow-x: auto; } }

.b8w { padding: 4px 0 12px; border-bottom: 1px solid var(--line2); margin-bottom: 12px; }
.b8w:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.b8w-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.b8w p { margin: 8px 0 0; }
.b8-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.b8-steps li { position: relative; padding-left: 24px; color: var(--muted); }
.b8-steps li::before { content: ''; position: absolute; left: 2px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.b8-steps li.ok { color: var(--text); }
.b8-steps li.ok::before { border-color: var(--up); background: var(--up); box-shadow: inset 0 0 0 2px var(--card); }
.b8-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b8-form .f input { width: 100%; }
#tab-b8 .hero .h-side.pos { color: var(--up); }
#tab-b8 .hero .h-side.neg { color: var(--down); }

.dnse-accs { display: grid; gap: 6px; margin-bottom: 10px; }
.dnse-acc { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.dnse-acc:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }

.layers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.layer-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.layer-chip input { display: none; }
.layer-chip.on { border-color: #c8dcfb; background: var(--blue-bg); color: var(--blue); }

.chart { position: relative; }
.pos-float { position: absolute; left: 12px; top: 10px; z-index: 5; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: 270px; }
.pos-float.bottom { top: auto; bottom: 70px; }
.pf-row { background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow); backdrop-filter: blur(2px); }
.pf-head { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.pf-head.up { color: var(--up); } .pf-head.down { color: var(--down); } .pf-head.pend { color: #b7791f; }
.pf-row b.up { color: var(--up); } .pf-row b.down { color: var(--down); }
.dnse-fold > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 15px; }
.dnse-fold > summary::before { content: '▸'; color: var(--muted); }
.dnse-fold[open] > summary::before { content: '▾'; }
.dnse-fold > summary::-webkit-details-marker { display: none; }
.dnse-sum { font-size: 13.5px; }
.dnse-sum.warn { color: #c2410c; font-weight: 600; }
.dnse-actions { display: flex; gap: 8px; justify-content: flex-end; margin: 10px 0; }
