/* intraday-flow.css — giao diện MỚI trang "Giao dịch trong ngày" (nhóm C, 21/10/2026).
   Tiền tố ifl- cho mọi class/id; KHÔNG dùng .bigflow-* (chúng dùng chung với tab Quỹ: fund-radar.js/css, theme-dark.css).
   Dùng biến màu có sẵn (--ink --muted --card --line --green --green2 --red --amber) nên tự theo sáng/tối
   (theme-dark.css chỉ cần đổi các biến đó). Chỉ có hiệu lực khi index.html dùng khối HTML trong _staged/intraday-page.html. */

.ifl {
  --ifl-soft: #eef6f6; --ifl-buy-bg: #d6f1f3; --ifl-sell-bg: #fbe7e9;
  --ifl-warn: #8a5f00; --ifl-warn-bg: #fff3d4; --ifl-err-bg: #fbe7e9;
  --ifl-cum: #14232b; --ifl-idx: #7c3aed; --ifl-dcum: #b9770e; --ifl-hatch: rgba(67, 115, 121, .30); --ifl-grid: #dcebec;
  --ifl-buy-ink: #017884; --ifl-focus: #017884;
  color: var(--ink); font-family: Manrope, system-ui, sans-serif; font-size: 13px; line-height: 1.45;
  display: block; width: 100%; min-width: 0;
}
[data-theme="dark"] .ifl {
  --ifl-soft: rgba(255, 255, 255, .05); --ifl-buy-bg: rgba(5, 240, 221, .14); --ifl-sell-bg: rgba(255, 107, 115, .16);
  --ifl-warn: #f0c675; --ifl-warn-bg: rgba(217, 164, 65, .16); --ifl-err-bg: rgba(255, 107, 115, .16);
  --ifl-cum: #f4f7fa; --ifl-idx: #c084fc; --ifl-dcum: #f2b84b; --ifl-hatch: rgba(146, 182, 189, .34); --ifl-grid: #1d3a45;
  --ifl-buy-ink: #05f0dd; --ifl-focus: #05f0dd;
}
.ifl *, .ifl *::before, .ifl *::after { box-sizing: border-box; }
.ifl [hidden] { display: none !important; }
.ifl button, .ifl select, .ifl input { font-family: inherit; color: inherit; }
.ifl :focus-visible { outline: 2px solid var(--ifl-focus); outline-offset: 2px; border-radius: 6px; }
.ifl a { color: inherit; }
.ifl h2, .ifl h3, .ifl p, .ifl ol, .ifl ul { margin: 0; padding: 0; }
.ifl ol, .ifl ul { list-style: none; }
.ifl .ifl-sr, .ifl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- thanh trạng thái ---------- */
.ifl-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.ifl-status {
  display: flex; align-items: center; gap: 10px; flex: 1 1 280px; min-width: 0; min-height: 44px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.ifl-status-label { font: 700 13px Manrope; white-space: nowrap; }
.ifl-status-detail { color: var(--muted); font-size: 12.5px; min-width: 0; }
.ifl-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.ifl-status[data-state="live"] .ifl-dot { background: var(--green2); box-shadow: 0 0 0 4px rgba(2, 191, 200, .18); }
.ifl-status[data-state="slow"] .ifl-dot, .ifl-status[data-state="lunch"] .ifl-dot,
.ifl-status[data-state="waiting"] .ifl-dot, .ifl-status[data-state="partial"] .ifl-dot { background: var(--amber); }
.ifl-status[data-state="error"] .ifl-dot, .ifl-status[data-state="source_error"] .ifl-dot { background: var(--red); border-radius: 2px; transform: rotate(45deg); }
.ifl-status[data-state="closed"] .ifl-dot, .ifl-status[data-state="holiday"] .ifl-dot { background: transparent; border: 2px solid var(--muted); }
.ifl-status[data-state="slow"], .ifl-status[data-state="partial"], .ifl-status[data-state="waiting"], .ifl-status[data-state="lunch"] { border-color: var(--amber); }
.ifl-status[data-state="error"], .ifl-status[data-state="source_error"] { border-color: var(--red); }
@media (prefers-reduced-motion: no-preference) {
  .ifl-status[data-state="live"] .ifl-dot { animation: ifl-pulse 2s ease-in-out infinite; }
}
@keyframes ifl-pulse { 50% { box-shadow: 0 0 0 7px rgba(2, 191, 200, 0); } }

.ifl-info-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: 700 12.5px Manrope; color: var(--ink);
}
.ifl-info-btn[aria-expanded="true"] { background: var(--ifl-soft); }
.ifl-info-ico { font-size: 16px; color: var(--green); }
.ifl-info {
  margin-top: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--ifl-soft);
  font-size: 12.5px; line-height: 1.6; max-width: 980px;
}
.ifl-info p + p { margin-top: 8px; }
.ifl-info b { font-weight: 800; }

/* ---------- tab con ---------- */
.ifl-tabs { display: flex; gap: 4px; margin: 14px 0 0; border-bottom: 1px solid var(--line); }
.ifl-tab {
  flex: 0 1 auto; min-height: 48px; padding: 8px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  color: var(--muted); font: 700 14px/1.25 Manrope; cursor: pointer; text-align: center; text-wrap: balance;
}
.ifl-tab[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }
.ifl-tab:hover { color: var(--ink); }
.ifl-tab[aria-selected="true"]:hover { color: var(--green); }

/* ---------- bộ chọn phiên / lọc ---------- */
.ifl-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; }
.ifl-seg {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 2px; background: var(--ifl-soft);
  border: 1px solid var(--line); border-radius: 11px;
}
.ifl-seg button {
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font: 700 12.5px Manrope; cursor: pointer; white-space: nowrap;
}
.ifl-seg button:hover { color: var(--ink); }
.ifl-seg button[aria-checked="true"] {
  background: var(--card); color: var(--green); box-shadow: 0 0 0 1px var(--line), 0 1px 5px rgba(0, 0, 0, .12);
}
.ifl-seg-sm button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.ifl-picker select, .ifl-filters select, .ifl-filters input, .ifl-custom select {
  min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font: 600 12.5px Manrope; color: var(--ink);
}
.ifl-custom { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.ifl-custom label, .ifl-lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 12px; }
.ifl-count { color: var(--muted); font-size: 12.5px; flex: 1 1 220px; min-width: 0; }
.ifl-count b { color: var(--ink); }
.ifl-sortbox { display: none; align-items: center; gap: 6px; }
.ifl-dir { min-width: 44px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-size: 16px; }

/* ---------- thân trang ---------- */
.ifl-body { position: relative; min-height: 260px; margin-top: 14px; }
.ifl-notice {
  margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--ifl-soft);
  font-weight: 600; font-size: 13px;
}
.ifl-notice[data-kind="info"] { color: var(--muted); }
.ifl-notice[data-kind="warn"] { background: var(--ifl-warn-bg); border-color: var(--amber); color: var(--ifl-warn); }
.ifl-notice[data-kind="error"] { background: var(--ifl-err-bg); border-color: var(--red); color: var(--red); }
.ifl-data[data-hidden="1"] { display: none; }

.ifl-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.ifl-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 14px; margin-bottom: 12px; }
.ifl-card-head-wrap { flex-wrap: wrap; }
.ifl-card h2 { font: 700 17px 'Space Grotesk', Manrope, sans-serif; letter-spacing: -.01em; }
.ifl-card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ifl-badge { padding: 4px 10px; border-radius: 999px; background: var(--ifl-soft); border: 1px solid var(--line); font: 700 11.5px Manrope; color: var(--muted); white-space: nowrap; }
.ifl-empty { padding: 22px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.ifl-more {
  display: block; width: 100%; min-height: 44px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--ifl-soft); color: var(--green); font: 700 12.5px Manrope; cursor: pointer;
}
.ifl-more:hover { background: var(--card); }

/* ---------- KPI ---------- */
.ifl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ifl-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.ifl-kpi h3 { color: var(--muted); font: 700 11.5px Manrope; letter-spacing: .02em; }
.ifl-kpi-v { font: 700 25px/1.15 'Space Grotesk', Manrope, sans-serif; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ifl-kpi-v-sm { font-size: 17px; }
.ifl-kpi-v.pos { color: var(--ifl-buy-ink); }
.ifl-kpi-v.neg { color: var(--red); }
.ifl-kpi-s { font: 700 12.5px Manrope; }
.ifl-kpi-n { color: var(--muted); font-size: 11.5px; }
.ifl-ratio { display: flex; height: 12px; margin: 4px 0 2px; border-radius: 6px; overflow: hidden; background: var(--ifl-soft); border: 1px solid var(--line); }
.ifl-ratio i { display: block; height: 100%; }
.ifl-ratio i.buy { background: var(--green2); }
.ifl-ratio i.sell { background: var(--red); }

/* ---------- biểu đồ ---------- */
.ifl-chart-wrap { position: relative; height: 320px; touch-action: pan-y; }
.ifl-chart-wrap canvas { display: block; width: 100%; height: 100%; border-radius: 8px; cursor: crosshair; }
.ifl-chart-wrap canvas:focus-visible { outline-offset: 0; }
.ifl-tip {
  position: absolute; z-index: 3; min-width: 168px; max-width: 240px; padding: 8px 10px; pointer-events: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22); font-size: 12px; line-height: 1.5;
}
.ifl-tip b { display: block; font: 700 12.5px Manrope; margin-bottom: 2px; }
.ifl-tip div { display: flex; justify-content: space-between; gap: 12px; }
.ifl-tip .buy { color: var(--ifl-buy-ink); }
.ifl-tip .sell { color: var(--red); }
.ifl-tip .idx { color: var(--ifl-idx, #c084fc); }
.ifl-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.ifl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.ifl-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ifl-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ifl-legend .sw.buy { background: var(--green2); }
.ifl-legend .sw.sell { background: var(--red); }
.ifl-legend .sw.line { height: 3px; border-radius: 2px; background: var(--ifl-cum); }
.ifl-legend .sw.dcum { height: 3px; border-radius: 2px; background: var(--ifl-dcum, #f2b84b); }
.ifl-legend .sw.idx { height: 3px; border-radius: 2px; background: var(--ifl-idx, #c084fc); }
.ifl-legend .sw.hatch { background: repeating-linear-gradient(135deg, var(--ifl-hatch) 0 2px, transparent 2px 5px); border: 1px solid var(--ifl-hatch); }
.ifl-hint { margin-top: 4px; color: var(--muted); font-size: 11.5px; }

/* ---------- bố cục 2 cột ---------- */
.ifl-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ifl-two > .ifl-card { margin-bottom: 14px; }

/* ---------- tháp tựa lưng khối ngoại: bán ròng (trái) | mua ròng (phải) ---------- */
.ifl-pyr-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
.ifl-pyr-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ifl-pyr-head .ifl-badge { display: none; }   /* nhãn "x/y mã" không cần: người xem tự đếm được */
.ifl-pyr-head .ph-s { justify-content: flex-end; color: var(--red); }
.ifl-pyr-head .ph-b { color: var(--ifl-buy-ink); }
.ifl-pyr { list-style: none; margin: 8px 0 0; padding: 0; }
.ifl-pyr .pyr-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: stretch; border-top: 1px solid var(--line); }
.ifl-pyr .pyr-row:first-child { border-top: 0; }
.ifl-pyr .rk-i { align-self: center; text-align: center; color: var(--muted); font: 700 12px 'Space Grotesk', sans-serif; }
.ifl-pyr .pyr-half { position: relative; display: flex; align-items: center; gap: 4px 12px; min-width: 0; min-height: 38px; padding: 0 10px; overflow: hidden; }
.ifl-pyr .pyr-half.sell { flex-direction: row-reverse; }
.ifl-pyr .pyr-fill { position: absolute; top: 5px; bottom: 5px; border-radius: 4px; opacity: .2; pointer-events: none; }
.ifl-pyr .pyr-half.buy .pyr-fill { left: 0; background: var(--green2); border-radius: 0 4px 4px 0; }
.ifl-pyr .pyr-half.sell .pyr-fill { right: 0; background: var(--red); border-radius: 4px 0 0 4px; }
.ifl-pyr .pyr-half > :not(.pyr-fill) { position: relative; white-space: nowrap; }
.ifl-pyr .rk-sym { font: 700 14px 'Space Grotesk', Manrope, sans-serif; text-decoration: none; }
.ifl-pyr .rk-sym:hover { text-decoration: underline; }
.ifl-pyr .sc-name { min-width: 0; max-width: 17em; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ifl-pyr .sc-name:hover { text-decoration: none; }
/* chữ nằm đè lên thanh màu nên dùng màu sáng + đậm hơn (muted trước đây khó đọc), thanh nhạt hơn */
.ifl-pyr .rk-px { color: var(--ink, #e8f4f5); font-size: 13px; font-weight: 600; }
.ifl-pyr .rk-px .pos { color: #5ff5d8; }
.ifl-pyr .rk-px .neg { color: #ff9aa4; }
.ifl-pyr .pyr-half.sell .rk-net { color: #ff8793; }
.ifl-pyr .pyr-half.buy .rk-net { color: #5ff5d8; }
.ifl-pyr .rk-net { font: 700 13.5px Manrope; }
.ifl-pyr .rk-pct { color: var(--ink, #e8f4f5); opacity: .88; font-size: 12.5px; }
/* hai bảng tháp nằm cạnh nhau (.ifl-two): mỗi thẻ hẹp lại -> co chữ/khoảng cách theo bề rộng THẺ, không theo cửa sổ */
.ifl-pyr-card { container-type: inline-size; }
.ifl-two-top { align-items: stretch; }   /* hai thẻ cạnh nhau cao bằng nhau (mép trên và mép dưới thẳng hàng) */
@container (max-width: 760px) {
  .ifl-pyr .pyr-half { gap: 4px 7px; padding: 0 6px; }
  .ifl-pyr .rk-pct, .ifl-pyr .rk-px, .ifl-pyr .rk-net { font-size: 12px; }
  .ifl-pyr .sc-name { max-width: 12em; }
}
@container (max-width: 640px) {
  .ifl-pyr .pyr-half > .rk-pct { display: none; }
  .ifl-pyr .sc-name { max-width: 10em; }
}
@media (max-width: 720px) {
  .ifl-pyr-head { gap: 0 24px; font-size: 14px; }
  .ifl-pyr .pyr-row { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); }
  .ifl-pyr .pyr-half { padding: 0 6px; gap: 2px 6px; }
  .ifl-pyr .rk-pct { display: none; }
}

/* ---------- xếp hạng ---------- */
.ifl-rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 8px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.ifl-rank li:first-child { border-top: 0; }
.ifl-rank .rk-i { grid-row: 1 / 3; color: var(--muted); font: 700 12px 'Space Grotesk', sans-serif; text-align: center; }
.ifl-rank .rk-main { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.ifl-rank .rk-sym { font: 700 14px 'Space Grotesk', Manrope, sans-serif; text-decoration: none; min-height: 24px; }
.ifl-ev .ev-sym { font: 700 14px 'Space Grotesk', Manrope, sans-serif; }
.ifl-rank .rk-sym:hover, .ifl-ev .ev-a:hover { text-decoration: underline; }
.ifl-ev .ev-a { font: inherit; color: inherit; text-decoration: none; }
.ifl-rank .rk-px { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ifl-rank .rk-net { font: 700 13.5px Manrope; text-align: right; white-space: nowrap; }
.ifl-rank li.buy .rk-net { color: var(--ifl-buy-ink); }
.ifl-rank li.sell .rk-net { color: var(--red); }
.ifl-rank .rk-bar { display: flex; align-items: center; min-width: 0; }
.ifl-bar { flex: 1 1 auto; height: 8px; border-radius: 4px; background: var(--ifl-soft); overflow: hidden; border: 1px solid var(--line); }
.ifl-bar i { display: block; height: 100%; border-radius: 3px; }
.ifl-rank li.buy .ifl-bar i, .ifl-sectors li.buy .ifl-bar i { background: var(--green2); }
.ifl-rank li.sell .ifl-bar i, .ifl-sectors li.sell .ifl-bar i { background: var(--red); }
.ifl-rank .rk-pct { color: var(--muted); font-size: 11.5px; text-align: right; white-space: nowrap; }
.pos { color: var(--ifl-buy-ink); }
.neg { color: var(--red); }

/* ---------- ngành ---------- */
.ifl-sectors li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.ifl-sectors li:first-child { border-top: 0; }
.ifl-sectors .sc-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ifl-sectors .sc-net { font: 700 13.5px Manrope; text-align: right; white-space: nowrap; }
.ifl-sectors li.buy .sc-net { color: var(--ifl-buy-ink); }
.ifl-sectors li.sell .sc-net { color: var(--red); }
.ifl-sectors .sc-sub { color: var(--muted); font-size: 11.5px; text-align: right; white-space: nowrap; }
.ifl-sectors .sc-bar { display: flex; align-items: center; }

/* ---------- bộ lọc sự kiện ---------- */
.ifl-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; align-items: center; }
.ifl-filters input { width: 210px; }
.ifl-ev-note { margin: -2px 0 10px; color: var(--muted); font-size: 12px; }
.ifl-ev-note[hidden] { display: none; }
#ifl-ev-body { transition: opacity .15s; }
#ifl-ev-body[data-loading="1"] { opacity: .5; }
.ifl-more:disabled { opacity: .6; cursor: progress; }
.ifl-filters select { max-width: 200px; }

/* ---------- bảng sự kiện (danh sách) ---------- */
.ifl-ev-table { min-width: 0; }
.ifl-thead .ifl-row, .ifl-ev {
  display: grid; align-items: center; gap: 0 10px; padding: 0 10px;
  grid-template-columns: 70px 64px minmax(54px, 1fr) 58px 92px 62px 60px 78px;   /* bỏ cột Ngành (23/10/2026): vừa nửa bề rộng khi nằm cạnh thẻ dồn dập */
}
.ifl-thead .ifl-row { min-height: 34px; border-bottom: 1px solid var(--line); color: var(--muted); font: 800 10.5px Manrope; letter-spacing: .05em; text-transform: uppercase; }
.ifl-ev { min-height: 50px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ifl-ev:hover { background: var(--ifl-soft); }
.ifl .num { text-align: right; font-variant-numeric: tabular-nums; }
.ifl-ev .ev-time { display: flex; flex-direction: column; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ifl-ev .ev-time small { color: var(--muted); font-size: 10.5px; }
.ifl-ev .ev-sec { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ifl-ev .ev-val { font-weight: 800; }
.ifl-ev .br { display: none; }
.ifl-chip { display: inline-block; padding: 3px 9px; border-radius: 6px; font: 800 11px Manrope; letter-spacing: .03em; white-space: nowrap; justify-self: start; }
.ifl-chip.buy { background: var(--ifl-buy-bg); color: var(--ifl-buy-ink); }
.ifl-chip.sell { background: var(--ifl-sell-bg); color: var(--red); }
.ifl-chip.tier { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.ifl-chip.tier.large { border-color: var(--amber); color: var(--ifl-warn); font-weight: 800; }
.ifl-chip.st-active { background: var(--ifl-buy-bg); color: var(--ifl-buy-ink); }
.ifl-chip.st-off { background: var(--ifl-soft); color: var(--muted); font-weight: 700; }

/* ---------- tab lệnh lặp ---------- */
.ifl-kpis-r { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ifl-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* tab Khối ngoại (M20) */
.ifl-r-table .ifl-thead .ifl-row, .ifl-rr {
  display: grid; align-items: center; gap: 0 10px; padding: 0 10px;
  grid-template-columns: 74px 86px 62px 82px 84px 84px 66px 92px 100px 100px 118px;
}
.ifl-r-table .ifl-thead .ifl-row { min-height: 44px; }
/* Robot v2: cột "Bất thường (×)" chỉ hiện khi API trả anomaly (JS gắn .has-anom); máy chủ cũ -> bảng 11 cột như trước */
.ifl-r-table .rr-v2 { display: none; }
#ifl-view-robot.has-anom .ifl-r-table .rr-v2 { display: block; }
@media (min-width: 1101px) {
  #ifl-view-robot.has-anom .ifl-r-table .ifl-thead .ifl-row, #ifl-view-robot.has-anom .ifl-rr {
    gap: 0 8px; grid-template-columns: 66px 70px 52px 74px 76px 68px 76px 50px 78px 84px 92px 104px;
  }
}
.ifl-rr .rr-anom-c { font-weight: 800; }
.ifl-r-table [role="columnheader"] { min-width: 0; }
.ifl-r-table [role="columnheader"] button {
  width: 100%; min-height: 44px; padding: 4px 0; border: 0; background: transparent; cursor: pointer; text-align: left;
  font: 800 10.5px/1.25 Manrope; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.ifl-r-table [role="columnheader"].num button { text-align: right; }
.ifl-r-table [role="columnheader"] button:hover { color: var(--ink); }
.ifl-r-table [role="columnheader"][aria-sort="ascending"] button, .ifl-r-table [role="columnheader"][aria-sort="descending"] button { color: var(--green); }
.ifl-r-table [role="columnheader"][aria-sort="ascending"] button::after { content: ' ▲'; font-size: 9px; }
.ifl-r-table [role="columnheader"][aria-sort="descending"] button::after { content: ' ▼'; font-size: 9px; }
.ifl-rr { min-height: 48px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ifl-rr:hover { background: var(--ifl-soft); }
.ifl-rr [role="cell"] { min-width: 0; font-variant-numeric: tabular-nums; }
.ifl-rr .br { display: none; }
.ifl-rr .rr-sym { font: 700 14px 'Space Grotesk', Manrope, sans-serif; text-decoration: none; }
.ifl-rr .rr-sym:hover { text-decoration: underline; }
.ifl-rr .rr-liq { color: var(--green); font-weight: 700; font-size: 12px; white-space: nowrap; }
.ifl-rr .rr-peak { font-weight: 800; }
.ifl-rr [data-l]::before { content: none; }

/* ---------- Máy tính bảng / điện thoại ---------- */
@media (max-width: 1100px) {
  .ifl-kpis, .ifl-kpis-r { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ifl-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ifl-sortbox { display: inline-flex; }
  .ifl-r-table .ifl-thead { display: none; }
  .ifl-rr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 10px 12px; }
  .ifl-rr .br { display: block; flex: 0 0 100%; height: 0; order: 5; }
  .ifl-rr .rr-sym-c { order: 1; }
  .ifl-rr .rr-side-c { order: 2; }
  .ifl-rr .rr-peakn-c { order: 4; margin-left: auto; font-size: 13px; }
  .ifl-rr .rr-anom-c { order: 4; }
  #ifl-view-robot .ifl-rr .rr-anom-c { color: var(--ink); font-size: 13px; }
  .ifl-rr .rr-first-c { order: 6; } .ifl-rr .rr-vol-c { order: 7; } .ifl-rr .rr-val-c { order: 8; }
  .ifl-rr .rr-win-c { order: 9; } .ifl-rr .rr-burst-c { order: 10; } .ifl-rr .rr-peakat-c { order: 11; }
  .ifl-rr .rr-st-c { order: 3; } .ifl-rr .rr-liq-c { order: 12; margin-left: auto; }
  .ifl-rr [data-l]:not(.rr-sym-c):not(.rr-side-c):not(.rr-st-c):not(.rr-liq-c)::before { content: attr(data-l) ' '; color: var(--muted); font-weight: 600; }
  .ifl-rr .rr-peakn-c::before { content: attr(data-l) ' ' !important; color: var(--muted); font-weight: 600; font-size: 12px; }
  .ifl-rr .rr-peakn-c::after { content: ' lệnh/2 phút'; color: var(--muted); font-weight: 600; font-size: 12px; }
  .ifl-rr [data-l]:not(.rr-sym-c):not(.rr-side-c):not(.rr-st-c):not(.rr-peakn-c):not(.rr-liq-c) { color: var(--muted); font-size: 12px; }
  .ifl-rr .rr-st-c:not(:has(.ifl-chip)) { display: none; }
  .ifl-rr .rr-liq-c { min-height: 32px; display: inline-flex; align-items: center; }
}
@media (max-width: 960px) {
  .ifl-two { grid-template-columns: minmax(0, 1fr); }
  .ifl-ev-table .ifl-thead { display: none; }
  .ifl-ev { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; padding: 10px 4px; min-height: 0; }
  .ifl-ev .br { display: block; flex: 0 0 100%; height: 0; order: 5; }
  .ifl-ev .ev-sym { order: 1; font-size: 15px; } .ifl-ev .ev-side { order: 2; }
  .ifl-ev .ev-tier { order: 3; } .ifl-ev .ev-val { order: 4; margin-left: auto; font-size: 14px; }
  .ifl-ev .ev-time { order: 6; flex-direction: row; gap: 6px; align-items: baseline; }
  .ifl-ev .ev-sec { order: 7; max-width: 46%; } .ifl-ev .ev-px { order: 8; } .ifl-ev .ev-pct { order: 9; } .ifl-ev .ev-ratio { order: 10; }
  .ifl-ev .ev-time, .ifl-ev .ev-sec, .ifl-ev .ev-px, .ifl-ev .ev-pct, .ifl-ev .ev-ratio { color: var(--muted); font-size: 12px; text-align: left; }
  .ifl-ev .ev-pct.pos { color: var(--ifl-buy-ink); } .ifl-ev .ev-pct.neg { color: var(--red); }
  .ifl-ev .ev-time small { font-size: 12px; }
  .ifl-chart-wrap { height: 280px; }
}
@media (max-width: 640px) {
  .ifl-card { padding: 14px 12px; border-radius: 12px; }
  .ifl-status { flex-basis: 100%; flex-wrap: wrap; }
  .ifl-status-detail { flex-basis: 100%; }
  .ifl-info-btn { flex: 1 1 100%; justify-content: center; }
  .ifl-tab { flex: 1 1 0; padding: 8px 6px; font-size: 13px; }
  .ifl-seg { display: flex; width: 100%; }
  .ifl-seg button { flex: 1 1 0; min-height: 44px; padding: 0 6px; }
  .ifl-seg-sm button { min-height: 44px; padding: 0 6px; font-size: 12px; }
  .ifl-card-head > .ifl-seg { width: 100%; }
  .ifl-picker select, .ifl-filters select, .ifl-filters input, .ifl-custom select, .ifl-dir { min-height: 44px; }
  .ifl-custom { width: 100%; } .ifl-custom label { flex: 1 1 140px; justify-content: space-between; }
  .ifl-custom select { flex: 1 1 auto; min-width: 0; }
  .ifl-filters select, .ifl-filters input { flex: 1 1 140px; max-width: none; width: auto; }
  .ifl-lbl { width: 100%; justify-content: space-between; } .ifl-lbl select { flex: 1 1 auto; min-width: 0; }
  .ifl-sortbox { width: 100%; } .ifl-sortbox .ifl-lbl { flex: 1 1 auto; }
  .ifl-kpi { padding: 12px 12px; }
  .ifl-kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .ifl-picker .ifl-lbl select { min-width: 0; }
  .ifl-kpi-v { font-size: 20px; } .ifl-kpi-v-sm { font-size: 15px; }
  .ifl-chart-wrap { height: 250px; }
  .ifl-more, .ifl-rank li, .ifl-sectors li { min-height: 44px; }
  .ifl-rank .rk-sym, .ifl-ev .ev-a, .ifl-rr .rr-sym { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0; padding: 0 4px; }
}

/* ---------- combobox "Mã có tín hiệu" (thay ô gõ mã, 21/10/2026) ---------- */
.ifl-cb { position: relative; flex: 0 1 auto; min-width: 0; }
.ifl-filters .ifl-cb-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; max-width: 100%; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: 700 12.5px Manrope; cursor: pointer;
}
.ifl-cb-btn .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ifl-cb-btn .cv { color: var(--muted); font-size: 12px; }
.ifl-cb-btn[aria-expanded="true"] { background: var(--ifl-soft); border-color: var(--green2); }
.ifl-cb-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
.ifl-cb-pop[hidden] { display: none; }
.ifl-filters .ifl-cb-in { flex: none; width: 100%; max-width: none; min-height: 40px; box-sizing: border-box; }
.ifl-cb-sort { display: flex; width: 100%; box-sizing: border-box; }
.ifl-cb-sort button { flex: 1 1 0; min-width: 0; padding: 0 6px; white-space: normal; line-height: 1.2; text-wrap: balance; }
.ifl-cb-msg { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.ifl-cb-list { max-height: min(300px, 46vh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ifl-cb-list:empty { display: none; }
.ifl-cb-opt {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 0 8px; align-items: center; min-height: 44px; padding: 5px 10px;
  border-top: 1px solid var(--line); cursor: pointer; font-size: 12.5px;
}
.ifl-cb-opt:first-child { border-top: 0; }
.ifl-cb-opt .mk { grid-row: 1 / 3; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 5px; font-size: 12px; font-weight: 800; color: #fff; }
.ifl-cb-opt[aria-selected="true"] .mk { background: var(--green2); border-color: var(--green2); }
.ifl-cb-opt .sy { font: 700 13px 'Space Grotesk', Manrope, sans-serif; }
.ifl-cb-opt .ct { font-weight: 700; white-space: nowrap; }
.ifl-cb-opt .ct .b { color: var(--ifl-buy-ink); }
.ifl-cb-opt .ct .s { color: var(--red); }
.ifl-cb-opt .vl { color: var(--muted); font-weight: 600; white-space: nowrap; text-align: right; min-width: 56px; }
.ifl-cb-opt .sc { grid-column: 2 / 5; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifl-cb-opt[data-free] .ct { grid-column: 3 / 5; color: var(--muted); }
.ifl-cb-opt.is-active { background: var(--ifl-soft); box-shadow: inset 3px 0 0 var(--ifl-focus); }
.ifl-cb-opt:hover { background: var(--ifl-soft); }
.ifl-cb-opt[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ifl-filters .ifl-cb-done { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--ifl-soft); color: var(--green); font: 700 12.5px Manrope; cursor: pointer; }
.ifl-cb-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; align-items: center; }
.ifl-cb-chips[hidden] { display: none; }
.ifl-cb-chip, .ifl-cb-clear {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--ifl-soft); color: var(--ink); font: 700 12.5px Manrope; cursor: pointer;
}
.ifl-cb-chip .x { color: var(--muted); font-size: 11px; }
.ifl-cb-chip:hover, .ifl-cb-clear:hover { background: var(--card); border-color: var(--green2); }
.ifl-cb-clear { background: transparent; color: var(--green); }
@media (max-width: 640px) {
  .ifl-cb { flex: 1 1 100%; }
  .ifl-filters .ifl-cb-btn { width: 100%; min-height: 44px; }
  .ifl-cb-pop { width: 100%; box-sizing: border-box; }
  .ifl-filters .ifl-cb-in, .ifl-filters .ifl-cb-done { min-height: 44px; font-size: 16px; }
  .ifl-cb-sort button { min-height: 44px; }
  .ifl-cb-chip, .ifl-cb-clear { min-height: 44px; }
  .ifl-cb-list { max-height: min(280px, 42vh); }
}

/* ---------- combobox "Mã có mẫu" ở tab Dấu hiệu lệnh lặp (21/10/2026): dùng chung kiểu .ifl-cb-*, chỉ thêm khoảng cách ---------- */
.ifl-r-filters { margin: 12px 0 0; }
.ifl-r-filters .ifl-cb-opt .vl { min-width: 48px; }

.ifl-card[hidden] { display: none; }

/* ---------- Mua/Bán lớn dồn dập (23/10/2026): thẻ dưới hàng KPI tab Dòng tiền lớn ---------- */
.ifl-bst .ifl-card-head { margin-bottom: 8px; align-items: center; }
.ifl-bst-h { margin: 14px 0 4px; color: var(--muted); font: 800 11px Manrope; letter-spacing: .06em; text-transform: uppercase; }
.ifl-bst-list { margin: 0; padding: 0; }
.ifl-bst .ifl-bst-empty { padding: 14px 8px; }
.ifl-bst .bst-sym { font: 700 14px 'Space Grotesk', Manrope, sans-serif; text-decoration: none; }
.ifl-bst .bst-sym:hover { text-decoration: underline; }
.ifl-bst .bst-sec { color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifl-bst .bst-dir { font-size: 11px; line-height: 1; }
.ifl-bst .buy .bst-dir { color: var(--ifl-buy-ink); }
.ifl-bst .sell .bst-dir { color: var(--red); }
.ifl-bst .bst-px.pos { color: var(--ifl-buy-ink); }
.ifl-bst .bst-px.neg { color: var(--red); }

/* ---- bảng theo mã (phần Lịch sử và thống kê nhiều phiên) */
.bst-who { display: flex; align-items: baseline; gap: 6px; }
.bst-who > * { min-width: 0; }
.bst-pace, .bst-px { white-space: nowrap; text-align: right; }
.bst-pace { font-weight: 700; }
.bst-grp { padding: 9px 8px; border-top: 1px solid var(--line); }
.bst-grp:first-child { border-top: 0; }
.bst-gtot { margin-left: auto; font-weight: 800; white-space: nowrap; }
.bst-grp.buy .bst-gtot { color: var(--ifl-buy-ink); }
.bst-grp.sell .bst-gtot { color: var(--red); }
.bst-gn { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bst-late { cursor: help; }
.ifl-bst .bst-evlink { color: var(--muted); font-size: 11.5px; white-space: nowrap; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.ifl-bst .bst-evlink:hover, .ifl-bst .bst-evlink:focus-visible { color: var(--ink); }
/* thống kê nhiều phiên theo mã (B9b): mã+ngành | N giai đoạn · M/K phiên | thời lượng TB | ×TB | tổng giá trị */
.bst-rrow { display: grid; grid-template-columns: minmax(0, 1fr) 150px 74px 56px 84px; gap: 4px 10px; align-items: baseline; }
.bst-rrow > * { min-width: 0; }
.bst-rcnt, .bst-rdur { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bst-rdur { text-align: right; }
.bst-rrow .bst-gtot { margin-left: 0; text-align: right; }
@media (max-width: 640px) {
  .bst-rrow { grid-template-columns: minmax(0, 1fr) auto auto; }
  .bst-rrow .bst-who { grid-column: 1 / 3; grid-row: 1; }
  .bst-rrow .bst-gtot { grid-column: 3; grid-row: 1; }
  .bst-rrow .bst-rcnt { grid-column: 1; grid-row: 2; }
  .bst-rrow .bst-rdur { grid-column: 2; grid-row: 2; }
  .bst-rrow .bst-pace { grid-column: 3; grid-row: 2; }
}

/* ---- phát hiện mới: nền sáng tắt dần ~6 giây (không chuyển động khi người dùng tắt hiệu ứng) */
@keyframes bst-new { from { background-color: var(--ifl-buy-bg); } to { background-color: transparent; } }
@keyframes bst-new-sell { from { background-color: var(--ifl-sell-bg); } to { background-color: transparent; } }
@media (prefers-reduced-motion: no-preference) {
  .bst-ep.is-new { animation: bst-new 6s ease-out both; }
  .bst-g.sell .bst-ep.is-new { animation-name: bst-new-sell; }
}
@media (prefers-reduced-motion: reduce) {
  .bst-ep.is-new { background-color: var(--ifl-soft); }
}

/* ---- Phần 1 "Đang dồn dập" (thiết kế 23/10/2026): tháp tựa lưng bán | mua, dùng khung .ifl-pyr; thanh nền mọc từ trục ra theo điểm cường độ */
.ifl-bst .ifl-bst-live { margin: 2px 0 6px; }
.ifl-bst .ifl-pyr-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font: 800 14px Manrope, sans-serif; }
.ifl-bst .ifl-bst-pyr { margin-top: 6px; }
.ifl-bst-pyr .pyr-half { font-size: 13px; }
.ifl-bst-pyr .bst-sym { color: var(--ink); }
.ifl-bst-pyr .bst-badge { font: 800 12px Manrope, sans-serif; white-space: nowrap; }

.ifl-bst-pyr .bst-cn .m { display: none; }
.ifl-bst-pyr .pyr-half.buy .bst-badge.active { color: var(--ifl-buy-ink); }
.ifl-bst-pyr .pyr-half.sell .bst-badge.active { color: var(--red); }
.ifl-bst-pyr .bst-badge.cooling { color: var(--ifl-warn); }
.ifl-bst-pyr .bst-badge.lunch { color: var(--ink); opacity: .85; }
.ifl-bst-pyr .bst-dur { color: var(--ink); opacity: .88; font-size: 12.5px; font-weight: 600; }
.ifl-bst-pyr .pyr-half.buy .rk-net { color: var(--ifl-buy-ink); }
.ifl-bst-pyr .pyr-half.sell .rk-net { color: var(--red); }
.ifl-bst-pyr .rk-px .pos { color: var(--ifl-buy-ink); }
.ifl-bst-pyr .rk-px .neg { color: var(--red); }
.ifl-bst-pyr .pyr-half { will-change: auto; }
@keyframes bst-pulse-dot { 50% { opacity: .45; } }
@media (prefers-reduced-motion: no-preference) {
  .ifl-bst-pyr .pyr-half.is-new { animation: bst-new 6s ease-out both; }
  .ifl-bst-pyr .pyr-half.sell.is-new { animation-name: bst-new-sell; }
  .ifl-bst-pyr .bst-badge.active > span:first-child { animation: bst-pulse-dot 2s ease-in-out infinite; }
  .ifl-bst-pyr .pyr-half.is-leaving { opacity: 0; transition: opacity .5s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .ifl-bst-pyr .pyr-half.is-new { background-color: var(--ifl-soft); }
}
/* mỗi nửa gồm hai nhóm; rộng: cùng một hàng (display: contents), hẹp: hai dòng */
.ifl-bst-pyr .pyr-half > .bst-l1, .ifl-bst-pyr .pyr-half > .bst-l2 { display: contents; }
.ifl-bst-pyr .bst-l1 > *, .ifl-bst-pyr .bst-l2 > * { position: relative; white-space: nowrap; }
.ifl-bst-pyr .pyr-half.sell .bst-l1, .ifl-bst-pyr .pyr-half.sell .bst-l2 { flex-direction: row-reverse; }
@media (max-width: 720px) {
  .ifl-bst-pyr .bst-pace, .ifl-bst-pyr .bst-dur { display: none; }
  .ifl-bst-pyr .bst-cn .w { display: none; }
  .ifl-bst-pyr .bst-cn .m { display: inline; }
}
@media (max-width: 560px) {
  .ifl-bst-pyr .pyr-half { flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; padding: 4px 6px; min-height: 46px; }
  .ifl-bst-pyr .pyr-half.sell { flex-direction: column; align-items: flex-end; }
  .ifl-bst-pyr .pyr-half > .bst-l1, .ifl-bst-pyr .pyr-half > .bst-l2 { display: flex; align-items: baseline; gap: 6px; max-width: 100%; }
  .ifl-bst-pyr .bst-pace, .ifl-bst-pyr .bst-dur { display: inline; font-size: 12px; }
  .ifl-bst-pyr .bst-dur { margin-left: 0; }
  .ifl-bst-pyr .pyr-half { font-size: 12.5px; }
}

/* ---- Phần 2 "Lịch sử hôm nay" (thiết kế 23/10/2026): tóm tắt · dải phân bố theo giờ · bảng theo mã bấm để mở */
.ifl-bst .bst-sum { margin: 6px 0 10px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.ifl-bst .bst-sum b { font-weight: 800; }
.bst-sum-buy { color: var(--ifl-buy-ink); font-weight: 700; }
.bst-sum-sell { color: var(--red); font-weight: 700; }
.bst-sum-run { font-weight: 700; }
.bst-hours { margin: 0 0 14px; }
.bh-cap { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: var(--muted); font-size: 11.5px; }
.bh-plot, .bh-axis { display: grid; grid-template-columns: repeat(var(--bh-am, 9), minmax(0, 1fr)) 12px repeat(var(--bh-pm, 6), minmax(0, 1fr)); gap: var(--bh-gap, 3px); }
.bh-s { display: flex; flex-direction: column; min-width: 0; }
.bh-u, .bh-d { position: relative; height: 52px; }
.bh-u { border-bottom: 1px solid var(--muted); }
.bh-bar { position: absolute; left: 10%; right: 10%; display: block; min-height: 3px; }
.bh-u .bh-bar { bottom: 0; border-radius: 3px 3px 0 0; }
.bh-d .bh-bar { top: 0; border-radius: 0 0 3px 3px; }
.bh-bar.buy { background: var(--green2); }
.bh-bar.sell { background: var(--red); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .38) 0 2px, transparent 2px 5px); }
.bh-n { position: absolute; left: 0; right: 0; text-align: center; color: var(--ink); font: 700 11px Manrope, sans-serif; line-height: 14px; }
.bh-u .bh-n { margin-bottom: 1px; }
.bh-d .bh-n { margin-top: 1px; }
.bh-plot > .bh-lunch { background: var(--ifl-soft); border-radius: 3px; }
.bh-axis { margin-top: 3px; }
.bh-t { color: var(--muted); font-size: 11px; white-space: nowrap; min-width: 0; }
.bst-g { padding: 0; }
.bst-gbtn {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; width: 100%; margin: 0; padding: 10px 8px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.bst-gbtn:hover { background: var(--ifl-soft); }
.bst-gbtn:focus-visible { outline: 2px solid var(--ifl-focus); outline-offset: -2px; }
.bst-g .bst-sym { color: var(--ink); }
.bst-grun { color: var(--ink); font: 700 12px Manrope, sans-serif; white-space: nowrap; }
.bst-g .bst-gtot { margin-left: auto; }
.bst-chev { color: var(--muted); font-size: 12px; width: 12px; text-align: center; }
.bst-chev::before { content: '▸'; }
.bst-gbtn[aria-expanded="true"] .bst-chev::before { content: '▾'; }
.bst-gdet { padding: 0 8px 10px 30px; }
.bst-eps { list-style: none; margin: 0; padding: 0; }
.bst-ep { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 5px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.bst-ep:first-child { border-top: 0; }
.bst-ept { min-width: 132px; font-weight: 600; white-space: nowrap; }
.bst-epv { min-width: 64px; font-weight: 700; white-space: nowrap; }
.bst-g.buy .bst-epv { color: var(--ifl-buy-ink); }
.bst-g.sell .bst-epv { color: var(--red); }
.bst-epn { min-width: 52px; color: var(--muted); white-space: nowrap; }
.bst-ep .bst-pace, .bst-ep .bst-px { min-width: 48px; text-align: left; }
.bst-epx { color: var(--muted); }
.bst-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ifl-bst .bst-acts .bst-act {
  display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--ifl-soft);
  color: var(--ink); font: 700 12px Manrope, sans-serif; text-decoration: none;
}
.ifl-bst .bst-acts .bst-act:hover, .ifl-bst .bst-acts .bst-act:focus-visible { border-color: var(--ifl-focus); }
@media (max-width: 640px) {
  .ifl-bst .bst-acts .bst-act { min-height: 36px; display: inline-flex; align-items: center; }
  .bh-u, .bh-d { height: 40px; }
  .bh-plot, .bh-axis { gap: 1px; grid-template-columns: repeat(var(--bh-am, 9), minmax(0, 1fr)) 8px repeat(var(--bh-pm, 6), minmax(0, 1fr)); }
  .bh-n { font-size: 10px; }
  .bh-axis .bh-t-lastam { visibility: hidden; }
  .bst-gbtn { min-height: 44px; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 2px 8px; padding: 10px 6px; }
  .bst-gbtn .bst-gtot { grid-column: 4; grid-row: 1; justify-self: end; }
  .bst-gbtn .bst-chev { grid-column: 5; grid-row: 1; }
  .bst-gbtn .bst-gn { grid-column: 2 / 4; grid-row: 2; }
  .bst-gbtn .bst-grun { grid-column: 4 / 6; grid-row: 2; justify-self: end; }
  .bst-g .bst-gtot { margin-left: 0; }
  .bst-gdet { padding-left: 8px; }
  .bst-ept { min-width: 0; flex: 1 1 100%; }
  .bst-ep { gap: 2px 12px; }
}

/* hai thẻ nằm cạnh nhau (.ifl-two): co theo bề rộng THẺ. Thẻ sự kiện đổi sang dạng 2 dòng khi hẹp (như media ≤960px) */
.ifl-cq { container-type: inline-size; }
@container (max-width: 640px) {
  .ifl-ev-table .ifl-thead { display: none; }
  .ifl-ev { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; padding: 10px 4px; min-height: 0; }
  .ifl-ev .br { display: block; flex: 0 0 100%; height: 0; order: 5; }
  .ifl-ev .ev-sym { order: 1; font-size: 15px; } .ifl-ev .ev-side { order: 2; }
  .ifl-ev .ev-tier { order: 3; } .ifl-ev .ev-val { order: 4; margin-left: auto; font-size: 14px; }
  .ifl-ev .ev-time { order: 6; flex-direction: row; gap: 6px; align-items: baseline; }
  .ifl-ev .ev-px { order: 8; } .ifl-ev .ev-pct { order: 9; } .ifl-ev .ev-ratio { order: 10; }
  .ifl-ev .ev-time, .ifl-ev .ev-px, .ifl-ev .ev-pct, .ifl-ev .ev-ratio { color: var(--muted); font-size: 12px; text-align: left; }
  .ifl-ev .ev-pct.pos { color: var(--ifl-buy-ink); } .ifl-ev .ev-pct.neg { color: var(--red); }
  .ifl-ev .ev-time small { font-size: 12px; }
}
.ifl-two-top:has(> #ifl-bst-card[hidden]) { grid-template-columns: minmax(0, 1fr); }   /* thẻ dồn dập ẩn -> bảng sự kiện chiếm cả hàng */

/* hộp chú thích khi trỏ chuột (setTip trong intraday-flow.js): cùng kiểu .ifl-tip của biểu đồ */
.ifl-tt {
  position: fixed; z-index: 60; min-width: 190px; max-width: 300px; padding: 9px 12px 10px; pointer-events: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38); font-size: 12.5px; line-height: 1.55;
}
.ifl-tt[hidden] { display: none; }
.ifl-tt.buy { border-left-color: var(--green2); }
.ifl-tt.sell { border-left-color: var(--red); }
.ifl-tt b { display: block; font: 700 13px Manrope; margin-bottom: 3px; }
.ifl-tt div { display: flex; justify-content: space-between; gap: 18px; }
.ifl-tt .tt-k { color: var(--ink); opacity: .85; white-space: nowrap; }
.ifl-tt .tt-v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ifl-tt .tt-v.buy { color: var(--ifl-buy-ink); }
.ifl-tt .tt-v.sell { color: var(--red); }
.ifl-tt .tt-line { display: block; color: var(--ink); opacity: .85; }
.ifl-tt .tt-note { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
@media (prefers-reduced-motion: no-preference) { .ifl-tt:not([hidden]) { animation: ifl-tt-in .12s ease-out; } }
@keyframes ifl-tt-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* hai thẻ cạnh nhau cao bằng nhau: biểu đồ "Lịch sử hôm nay" giãn ra lấp phần còn dư của thẻ dồn dập (chỉ khi 2 cột; 1 cột giữ chiều cao cố định) */
@media (min-width: 961px) {
  .ifl-two-top > .ifl-bst { display: flex; flex-direction: column; }
  .ifl-bst .bst-hours:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; max-height: 360px; }
  .ifl-bst .bst-hours .bh-plot { flex: 1 1 auto; min-height: 0; }
  .ifl-bst .bst-hours .bh-s { min-height: 0; }
  .ifl-bst .bst-hours .bh-u, .ifl-bst .bst-hours .bh-d { flex: 1 1 0; height: auto; min-height: 52px; }
}
.ifl-two-top:has(> #ifl-f-rc[hidden]) { grid-template-columns: minmax(0, 1fr); }   /* thẻ 'đang mua/bán mạnh' ẩn -> Top mua/bán ròng chiếm cả hàng */
.ifl-chart-ctl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.ifl-chart-ctl .ifl-seg[hidden] { display: none; }

/* công cụ biểu đồ (zoom +/−, đặt lại, toàn màn hình) và chế độ mở rộng */
.ifl-ct { display: inline-flex; gap: 4px; }
.ifl-ct button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: 700 15px Manrope, sans-serif; line-height: 1; cursor: pointer; }
.ifl-ct button:hover { background: var(--ifl-soft); }
.ifl-ct button:focus-visible { outline: 2px solid var(--ifl-focus, var(--green2)); outline-offset: 1px; }
.ifl-ct button[aria-pressed="true"] { background: var(--ifl-soft); color: var(--green2); }
body.ifl-fs-lock { overflow: hidden; }
.ifl-chart-card.ifl-fs { position: fixed; inset: 0; z-index: 90; margin: 0; border-radius: 0; overflow: auto; display: flex; flex-direction: column; background: var(--card); padding: 16px 20px; }
.ifl-chart-card.ifl-fs .ifl-chart-wrap { flex: 1 1 auto; height: auto; min-height: 320px; }
/* biểu đồ chính: cộng thêm chiều cao dải luỹ kế từng phiên (JS đặt --ifl-strip) để phần cột/đường giữ nguyên cỡ; toàn màn hình thì co giãn theo khung */
#ifl-chart-wrap { height: calc(320px + var(--ifl-strip, 0px)); }
@media (max-width: 960px) { #ifl-chart-wrap { height: calc(280px + var(--ifl-strip, 0px)); } }
@media (max-width: 640px) { #ifl-chart-wrap { height: calc(250px + var(--ifl-strip, 0px)); } }
.ifl-chart-card.ifl-fs #ifl-chart-wrap { height: auto; }
/* bỏ chữ phụ theo yêu cầu (24/10/2026): tiêu đề 'Lịch sử hôm nay' và dòng phụ đề của bảng Sự kiện; phần tử vẫn còn để aria-labelledby/describedby hoạt động */
.ifl-bst-h, #ifl-ev-sub { display: none; }
/* bỏ thanh trạng thái (Đang cập nhật / Nghỉ giao dịch …) và nút Định nghĩa ở đầu trang theo yêu cầu user (24/10/2026); phần tử vẫn còn để JS không lỗi */
.ifl-head { display: none; }
/* bỏ phụ đề (ngày / khoảng ngày) của biểu đồ Mua/bán chủ động vì đã có ở nhãn khoảng thời gian phía trên (24/10/2026); phần tử vẫn còn cho aria */
#ifl-chart-sub { display: none; }
