/* limit.trade - trang Bang tin (sau dang nhap). Dung chung token / .brand / .skip-link tu styles.css */
.app-body {
  --a-bg: #F2F0EB;
  --a-panel: #FAFAF8;
  --a-line: #E8E6E1;
  --a-ink: #1A1A1A;
  --a-text: #6B6B6B;
  --a-muted: #9E9E9E;
  --a-up: #059669;
  --a-down: #DC2626;
  --a-chip: #F5F4F1;
  --a-top: 64px;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--a-bg);
  color: var(--a-ink);
  font-size: 14px;
}
/* An trang cho toi khi xac nhan da dang nhap (tranh nhay noi dung truoc khi chuyen ve trang dang nhap) */
.is-checking .app-shell { visibility: hidden; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.chg { font-size: 11px; }
.chg--up { color: var(--a-up); }
.chg--down { color: var(--a-down); }
.chg--flat, .muted { color: var(--a-muted); }
.muted-xs { font-size: 11px; color: var(--a-muted); }
.muted-sm { font-size: 12px; color: var(--a-muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pair { display: inline-flex; align-items: baseline; gap: 6px; }
button { font: inherit; }

/* ---------- Thanh tren ---------- */
.topbar {
  position: sticky; top: 0; z-index: 950;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--a-top); padding: 0 24px; background: #fff; border-bottom: 1px solid var(--a-line);
}
.topbar__brand { display: inline-flex; align-items: center; gap: 8px; color: var(--a-ink); }
.topbar__brand .brand__mark { width: 36px; height: 36px; border-radius: 10px; }
.topbar__brand .brand__name { font-size: 22px; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav__item {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 100px;
  font-size: 14px; color: var(--a-text); white-space: nowrap;
}
.topnav__item .icon { width: 18px; height: 18px; }
.topnav__item.is-active { background: #EFF6FF; color: var(--blue); font-weight: 500; }
.is-soon { cursor: default; }
.topnav__item.is-soon:hover { background: var(--a-chip); }
.topbar__tools { display: flex; align-items: center; gap: 8px; }
.tool {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--a-chip); color: var(--a-ink);
}
.tool .icon { width: 20px; height: 20px; }
.tool__badge {
  position: absolute; top: 0; right: 0; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 100px; background: var(--a-down); color: #fff; font: 600 10px/1 var(--font-mono);
}
.usermenu { position: relative; }
.usermenu__btn { padding: 0; border: 0; border-radius: 50%; background: none; }
.uavatar {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; text-transform: uppercase;
}
.usermenu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px; padding: 6px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(26, 26, 26, .12);
}
.usermenu__who { display: grid; gap: 2px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--a-line); }
.usermenu__who strong { font-size: 14px; overflow-wrap: anywhere; }
.usermenu__who span { font-size: 12px; color: var(--a-muted); overflow-wrap: anywhere; }
.usermenu__panel a, .usermenu__panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; font-size: 14px; color: var(--a-ink); text-align: left;
}
.usermenu__panel .icon { width: 16px; height: 16px; color: var(--a-text); }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--a-chip); }
.usermenu__panel [data-logout] { color: var(--a-down); }
.usermenu__panel [data-logout] .icon { color: inherit; }

/* ---------- Bo cuc 3 cot ---------- */
.app {
  display: grid; grid-template-columns: 370px minmax(0, 1fr) 370px; grid-template-areas: "left feed right";
  align-items: start; max-width: 1600px; margin: 0 auto;
}
.side {
  position: sticky; top: var(--a-top); display: flex; flex-direction: column;
  height: calc(100vh - var(--a-top)); height: calc(100dvh - var(--a-top)); overflow-y: auto; overscroll-behavior: contain;
  background: #fff;
}
.side--left { grid-area: left; gap: 12px; padding: 32px 24px; }
.side--right { grid-area: right; gap: 16px; padding: 24px 16px; }

/* ---------- Khoi o cot trai ---------- */
.box {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: 10px;
}
.box__title { font-size: 13px; font-weight: 600; }
.box .label { font-size: 12px; color: var(--a-text); }
.box .val { font-size: 12px; }
.portfolio__total { font-size: 26px; font-weight: 600; line-height: 1.2; }
.alloc { display: flex; height: 6px; border-radius: 3px; overflow: hidden; }
.alloc[hidden], .portfolio [hidden] { display: none; }
.portfolio__dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.portfolio__empty a { color: var(--a-ink); font-weight: 600; text-decoration: underline; }
.sym { font-size: 12px; font-weight: 600; }
.sym .num { font-weight: 400; }

.converter .cv-field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 6px;
}
.converter .cv-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.converter input, .converter output {
  flex: 1; min-width: 0; height: 38px; padding: 0; border: 0; outline: 0; background: none; font-size: 14px; line-height: 38px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cv-cur { position: relative; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.cv-cur select {
  appearance: none; -webkit-appearance: none; padding: 4px 16px 4px 0; margin-right: -14px; border: 0; background: none;
  font: inherit; color: var(--a-ink); cursor: pointer;
}
.cv-cur .icon { width: 13px; height: 13px; color: var(--a-muted); pointer-events: none; }
.flag { display: none; width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15); }
.cv-field[data-cur="USD"] .flag[data-flag="USD"], .cv-field[data-cur="EUR"] .flag[data-flag="EUR"],
.cv-field[data-cur="JPY"] .flag[data-flag="JPY"], .cv-field[data-cur="CNY"] .flag[data-flag="CNY"],
.cv-field[data-cur="VND"] .flag[data-flag="VND"] { display: block; }
.cv-swap { display: flex; justify-content: center; }
.cv-swap button {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--a-line); border-radius: 50%;
  background: #fff; color: var(--a-text); transition: transform .2s ease;
}
.cv-swap button:hover { color: var(--blue); transform: rotate(180deg); }
.cv-swap .icon { width: 13px; height: 13px; }

.markets { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; border-top: 1px solid var(--a-line); }
.markets__title { font-size: 12px; font-weight: 500; color: var(--a-muted); }
.markets .row { font-size: 13px; }
.market__name { font-size: 13px; }

.ad {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 12px; color: #fff;
  background: linear-gradient(115deg, #0B1E3A 15%, #1D4ED8 85%);
}
.ad__brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.ad__mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(255, 255, 255, .15); }
.ad__mark .icon { width: 14px; height: 14px; }
.ad__tag { padding: 2px 8px; border-radius: 100px; background: rgba(255, 255, 255, .15); color: #DBEAFE; font-size: 8.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.ad__headline { font: 700 17px/20px var(--font-display); }
.ad__cta { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 100px; background: #fff; color: #0B1E3A; font-size: 12.5px; font-weight: 700; }
.ad__cta .icon { width: 13px; height: 13px; }
.ad__art { display: flex; align-items: flex-end; gap: 8px; height: 24px; }
.ad__art i { width: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.ad__art i.g { background: #34D399; }
.ad__art i.w { background: #fff; }

/* ---------- Bang tin (cot giua) ---------- */
.feed { grid-area: feed; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 632px; margin: 0 auto; padding: 32px 16px 48px; }
.preview-note {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  background: #FFF7E6; border: 1px solid #F6DFB0; color: #8A5A00; font-size: 12.5px;
}
.preview-note .icon { width: 15px; height: 15px; flex: none; }
.feedbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 0 6px 0 16px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 100px;
}
.feedbar__search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--a-muted); }
.feedbar__search .icon { width: 18px; height: 18px; }
.feedbar__search input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: none; font-size: 14px; color: var(--a-ink); }
.feedbar__search input::placeholder { color: var(--a-muted); }
.feedbar__search:focus-within { color: var(--blue); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 100px; background: var(--a-chip); }
.tab { padding: 6px 12px; border: 0; border-radius: 100px; background: none; font-size: 12px; color: var(--a-muted); white-space: nowrap; }
.tab[aria-selected="true"] { background: #fff; color: var(--a-ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
/* Giu cho san do rong chu dam -> tab khong xo nhau khi chon */
.tab[data-label]::after { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 500; }

.post { display: flex; gap: 8px; padding: 16px; background: #fff; border-radius: 10px; }
.post[hidden] { display: none; }
.post__avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--a-chip); }
.post__body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.post__head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.post__head strong { font-weight: 500; }
.verified { display: inline-flex; color: var(--blue); }
.verified .icon { width: 16px; height: 16px; }
.post__meta { font-size: 13px; color: var(--a-muted); }
.post__text { margin-top: -6px; font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }
.linkcard { display: flex; min-height: 116px; border: 1px solid var(--a-line); border-radius: 6px; overflow: hidden; }
.linkcard img { flex: none; width: 150px; height: auto; object-fit: cover; }
.linkcard > div { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 12px 16px; min-width: 0; }
.linkcard__domain { font-size: 10px; letter-spacing: .4px; color: var(--a-muted); }
.linkcard__title { font-size: 14px; line-height: 19px; }
.linkcard__desc { font-size: 12px; line-height: 17px; color: var(--a-text); }
.post__photo { width: 100%; height: auto; max-height: 300px; object-fit: cover; border-radius: 6px; background: var(--a-chip); }
.tradecard { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; padding: 8px; border-radius: 6px; background: var(--a-panel); }
.tradecard dt { font-size: 9px; color: var(--a-muted); }
.tradecard dd { margin: 0; font-size: 12px; }
.post__actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--a-muted); }
.post__actions > * { display: inline-flex; align-items: center; gap: 4px; padding: 4px; margin: -4px; border: 0; border-radius: 6px; background: none; color: inherit; }
.post__actions .icon { width: 15px; height: 15px; }
.post__actions button:hover { color: var(--blue); background: #EFF6FF; }
.act-like:hover { color: #E11D48 !important; background: #FFF1F2 !important; }
.act-like[aria-pressed="true"] { color: #E11D48; }
.act-like[aria-pressed="true"] .icon, .act-save[aria-pressed="true"] .icon { fill: currentColor; }
.act-save[aria-pressed="true"] { color: var(--blue); }

/* ---------- Cot phai ---------- */
.widget { display: flex; flex-direction: column; gap: 8px; }
.widget__title { font: 600 16px/1.3 var(--font-display); }
.tz { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; background: var(--a-panel); font-size: 11px; color: var(--a-muted); }
.tz .icon { width: 12px; height: 12px; }
.chips { display: flex; gap: 6px; }
.cchip { padding: 5px 12px; border: 0; border-radius: 100px; background: var(--a-panel); font-size: 12px; color: var(--a-text); }
.cchip[aria-pressed="true"] { background: #EFF6FF; color: var(--blue); }
.cal__head { display: grid; grid-template-columns: 36px 22px 1fr; gap: 8px; padding: 6px 0; border-radius: 6px; background: var(--a-panel); font-size: 10px; color: var(--a-muted); }
.cal__head span:first-child { padding-left: 4px; }
.cal__row {
  display: grid; grid-template-columns: 36px 22px 1fr; gap: 2px 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--a-line);
}
.cal__time, .cal__cur { font-size: 11px; color: var(--a-text); }
.cal__cur { font-size: 10px; }
.cal__event { font-size: 12px; overflow-wrap: anywhere; }
.impact { display: inline-flex; gap: 3px; }
.impact i { width: 5px; height: 5px; border-radius: 50%; background: var(--a-line); }
.impact--3 i { background: var(--a-down); }
.impact--2 i:nth-child(-n+2) { background: #D97706; }
.impact--1 i:first-child { background: var(--amber); }
.cal__flag .flag { display: block; width: 16px; height: 11px; }
.cal__stats { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 9px; color: var(--a-muted); }
.cal__stats b { margin-left: 2px; font-size: 11px; font-weight: 400; color: var(--a-text); }
.cal__stats b.chg--up { color: var(--a-up); font-weight: 600; }
.cal__stats b.chg--down { color: var(--a-down); font-weight: 600; }
.cal__stats b.muted { color: var(--a-muted); }
.cal__empty { padding: 16px 0; text-align: center; }
.live { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 100px; background: #ECFDF5; color: var(--a-up); font-size: 11px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.wcard { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 10px; background: var(--a-panel); }
.wcard.row { flex-direction: row; }
.wcard__name { display: block; font-size: 13px; }
.wcard__price { font-size: 14px; }
.wcard .chg { font-size: 14px; font-weight: 600; }
.wcard__meta { display: flex; gap: 24px; font-size: 11px; color: var(--a-muted); }
.sigside { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 3px; font-size: 10px; }
.sigside--buy { background: #ECFDF5; color: var(--a-up); }
.sigside--sell { background: #FEF2F2; color: var(--a-down); }
.savings table { width: 100%; border-collapse: collapse; }
.savings th, .savings td { padding: 3px 0; text-align: right; font-weight: 400; }
.savings thead th { font-size: 9.5px; color: var(--a-muted); }
.savings th[scope="row"], .savings thead th:first-child { text-align: left; }
.savings th[scope="row"] { font-size: 12px; font-weight: 600; }
.savings td { width: 32px; font-size: 11px; }
.savings table { table-layout: fixed; }
.savings thead th:not(:first-child) { width: 36px; }
.savings th[scope="row"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savings td.savings__msg { width: auto; padding: 10px 0; text-align: center; color: var(--a-muted); }
.savings__more { align-self: flex-start; margin-top: 4px; padding: 0; border: 0; background: none; font-size: 11px; font-weight: 600; color: var(--blue); cursor: pointer; }
.savings__more:hover { text-decoration: underline; }
.savings__more[hidden] { display: none; }
.box__src { margin: 4px 0 0; font-size: 10px; text-align: right; }
.box__src:empty { display: none; }

/* ---------- Thanh duoi (mobile) + thong bao ---------- */
.tabbar { display: none; }
.toast {
  /* Thẻ theo mẫu Notifications của Tailwind UI. Người dùng 2026-11-01: góc dưới khó nhìn -> giữa phía trên (dưới thanh trên, không đè nút Lưu / Hủy),
     nền màu nhạt + viền trái đậm theo loại (info xanh dương / ok xanh lá / warn cam) */
  position: fixed; top: 76px; left: 50%; z-index: 60; width: min(440px, calc(100vw - 32px)); margin: 0;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #EFF6FF; border: 1px solid #BFDBFE; border-left: 4px solid #2563EB; border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  color: #1E3A8A; font-size: 14px; font-weight: 500; line-height: 20px;
  opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity .3s ease-out, transform .3s ease-out;
}
.toast:empty { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast__ic { flex: none; width: 24px; height: 24px; color: #2563EB; }
.toast--ok { background: #F0FDF4; border-color: #BBF7D0; border-left-color: #16A34A; color: #14532D; }
.toast--ok .toast__ic { color: #16A34A; }
.toast--warn { background: #FFFBEB; border-color: #FDE68A; border-left-color: #D97706; color: #78350F; }
.toast--warn .toast__ic { color: #D97706; }
.toast__t { flex: 1; min-width: 0; }
.toast__x { flex: none; display: inline-flex; margin: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; opacity: .55; cursor: pointer; }
.toast__x:hover { opacity: 1; }
.toast__x:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.toast__x svg { width: 20px; height: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .topnav__item { padding: 10px 12px; }
}
/* Man vua: 2 cot, cot ben gom ca khoi trai va phai */
@media (max-width: 1240px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); grid-template-areas: "left feed" "right feed"; }
  .side { position: static; height: auto; overflow: visible; }
  .side--left { padding-bottom: 12px; }
  .side--right { padding: 12px 24px 32px; }
  .topnav__item span { display: none; }
  .topnav__item.is-active span { display: inline; }
}
/* Tablet / mobile: 1 cot, bang tin truoc, menu chuyen xuong thanh duoi */
@media (max-width: 900px) {
  .app { display: flex; flex-direction: column; }
  .feed { order: -1; padding: 16px 12px 24px; }
  .side { width: 100%; background: transparent; }
  .side--left, .side--right { padding: 0 12px 16px; }
  .side--left::before, .side--right::before {
    content: attr(aria-label); padding: 8px 4px 0; font: 600 16px/1.3 var(--font-display); color: var(--a-ink);
  }
  .widget, .markets { padding: 12px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; }
  .markets { gap: 12px; }
  .box { background: #fff; }
  .topnav { display: none; }
  .topbar { padding: 0 16px; }
  .tabbar {
    position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--a-line);
  }
  .tabbar__item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 10.5px; color: var(--a-muted); }
  .tabbar__item .icon { width: 21px; height: 21px; }
  .tabbar__item.is-active { color: var(--blue); font-weight: 600; }
  .app-shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .toast { top: 68px; }
}
@media (max-width: 560px) {
  .tool--wide { display: none; }
  .topbar__brand .brand__name { font-size: 20px; }
  .feedbar { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 6px 6px; border-radius: 14px; }
  .feedbar__search { padding: 0 8px; }
  .tabs { justify-content: space-between; }
  .tab { flex: 1; }
  .post { padding: 14px 12px; }
  .post__avatar { width: 36px; height: 36px; }
  .linkcard { flex-direction: column; }
  .linkcard img { width: 100%; height: 140px; }
  .post__photo { max-height: 240px; }
}

/* ================= Trang Nhat ky giao dich ================= */
.journal { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1920px; margin: 0 auto; padding: 24px 32px 40px; }
.journal .preview-note { align-self: flex-start; }
.jhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.jhead__title { font: 700 28px/1.2 var(--font-body); letter-spacing: -0.01em; }
.jhead__sub { margin-top: 6px; font-size: 14px; color: var(--a-text); }
.jhead__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 100px; background: var(--a-chip); }
.seg__item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 100px; font-size: 12px; color: var(--a-muted); }
.seg__item .icon { width: 14px; height: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--a-line); border-radius: 100px;
  background: #fff; font-size: 14px; font-weight: 500; color: var(--a-ink); white-space: nowrap; transition: background-color .15s ease, border-color .15s ease;
}
.pill .icon { width: 16px; height: 16px; }
.pill:hover { border-color: #D6D3CC; }
.pill--export { color: #29872C; }
.pill--primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.pill--primary:hover { background: #1D4ED8; border-color: #1D4ED8; }
.pill--chart { border-color: transparent; background: #EFF6FF; color: var(--blue); font-weight: 600; }
.pill--chart:hover { background: #DBEAFE; }

.jstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.jstat { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; }
.jstat__top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--a-muted); }
.jstat__ic { display: grid; place-items: center; width: 30px; height: 30px; }
.jstat__ic .icon { width: 26px; height: 26px; }
.jstat__ic--blue { color: var(--blue); }
.jstat__ic--green { color: var(--a-up); }
.jstat__ic--amber { color: var(--amber); }
.jstat__val { font-size: 26px; font-weight: 600; line-height: 1.15; }
.jstat__delta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--a-text); }
.jstat__delta .icon { width: 14px; height: 14px; color: var(--a-up); }
.jstat__pair { display: flex; gap: 28px; }
.jstat__pair p { display: grid; gap: 2px; }
.jstat__pair span { font-size: 11px; color: var(--a-muted); }
.jstat__pair b { font-size: 22px; font-weight: 600; }

.jtable { background: #fff; border: 1px solid var(--a-line); border-radius: 14px; }
.jtoolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 14px 20px; }
.jtools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jsearch {
  display: flex; align-items: center; gap: 8px; width: 360px; max-width: 100%; height: 38px; padding: 0 14px;
  border: 1px solid var(--a-line); border-radius: 100px; color: var(--a-muted);
}
.jsearch .icon { width: 16px; height: 16px; flex: none; }
.jsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--a-ink); }
.jsearch:focus-within { border-color: var(--blue); color: var(--blue); }
.fsel {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border: 1px solid var(--a-line); border-radius: 100px; font-size: 13px; color: var(--a-muted); white-space: nowrap;
}
.fsel select {
  appearance: none; -webkit-appearance: none; padding: 0 18px 0 0; margin-right: -18px; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--a-ink); cursor: pointer;
}
.fsel select:disabled { color: var(--a-muted); cursor: default; }
.fsel > .icon { width: 14px; height: 14px; pointer-events: none; }
.fsel:focus-within { border-color: var(--blue); }
.fsel__clear { display: none; padding: 0; border: 0; background: none; color: inherit; }
.fsel__clear .icon { width: 14px; height: 14px; }
.fsel--time.is-active { border-color: transparent; background: #EFF6FF; color: var(--blue); }
.fsel--time.is-active select { color: var(--blue); }
.fsel--time.is-active > .icon { display: none; }
.fsel--time.is-active .fsel__clear { display: grid; place-items: center; }

.jscroll { position: relative; overflow-x: auto; }
.jt { width: 100%; min-width: 1280px; border-collapse: collapse; font-size: 13px; }
.jt th {
  padding: 12px 6px; background: var(--a-panel); font-size: 11px; font-weight: 500; letter-spacing: .3px; color: var(--a-muted);
  text-align: left; text-transform: uppercase; white-space: nowrap;
}
.jt td { padding: 14px 6px; border-top: 1px solid var(--a-line); vertical-align: middle; }
.jt th:first-child, .jt td:first-child { padding-left: 20px; }
.jt th:last-child, .jt td:last-child { padding-right: 20px; }
.jt tbody tr:hover { background: #FCFCFA; }
.c-sym { width: 144px; }
.c-sym b { display: block; font-size: 13px; font-weight: 600; }
.c-sym small { font-size: 11px; color: var(--a-muted); }
.c-side { width: 86px; }
.c-time { width: 118px; color: var(--a-text); white-space: nowrap; }
.jt td.c-time { font-family: var(--font-body); }
.c-num { width: 102px; text-align: right !important; white-space: nowrap; }
.c-pnl { width: 128px; text-align: right !important; }
.c-pnl b { display: block; font-weight: 600; }
.c-r { width: 52px; text-align: center !important; font-weight: 600; }
.c-strat { width: 116px; }
.c-src { width: 124px; }
.c-edit { width: 60px; text-align: center !important; }
.jt th.c-edit .icon { display: inline-block; width: 15px; height: 15px; margin-right: 4px; vertical-align: -3px; }
.sidebadge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.sidebadge--buy { background: #ECFDF5; color: var(--a-up); }
.sidebadge--sell { background: #FEF2F2; color: var(--a-down); }
.st { font-size: 11px; font-weight: 500; }
.st--closed { color: var(--a-up); }
.st--open { color: var(--blue); }
.st--stopped { color: var(--a-down); }
.stchip { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--a-chip); font-size: 12px; color: var(--a-text); white-space: nowrap; }
.srcb { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 100px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.srcb .icon { width: 12px; height: 12px; }
.srcb--auto { background: #EFF6FF; color: var(--blue); }
.srcb--manual { background: #F5F3FF; color: #7C3AED; }
.jnote { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.jnote p { font-size: 12px; line-height: 17px; color: var(--a-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Ghi chu sua ngay tren dong: o nhap trong suot cung mau dong, hover hien vien, bam vao de nhap */
.jnote__input {
  flex: 1; min-width: 0; height: 44px; margin: 0; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--a-text); font: 400 12px/17px var(--font-body); resize: none; overflow: hidden; cursor: text;
  transition: border-color .15s, background-color .15s;
}
.jnote__input::placeholder { color: transparent; }
.jnote__input:hover { border-color: var(--a-line); background: #fff; }
.jnote__input:hover::placeholder, .jnote__input:focus::placeholder { color: var(--a-muted); }
.jnote__input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); overflow: auto; }
.addimg.is-loading, .thumb.is-loading { pointer-events: none; opacity: .6; }
button.thumb { padding: 0; border: 0; cursor: zoom-in; }
button.thumb:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Xem truoc anh khi re chuot (chi may co chuot) */
.imgpeek {
  position: fixed; z-index: 60; padding: 4px; border-radius: 10px; background: #fff; pointer-events: none;
  box-shadow: 0 20px 50px rgba(26, 26, 26, .28); animation: imgpeek .12s ease-out;
}
.imgpeek[hidden] { display: none; }
.imgpeek img { display: block; max-width: min(520px, 60vw); max-height: min(380px, 60vh); border-radius: 7px; }
@keyframes imgpeek { from { opacity: 0; transform: scale(.97); } }
@media (hover: none) { .imgpeek { display: none !important; } }
/* Phong to anh */
.imgbox {
  width: auto; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 14px;
  background: #fff; overflow: hidden; box-shadow: 0 30px 80px rgba(26, 26, 26, .35);
}
.imgbox[open] { display: flex; flex-direction: column; }
.imgbox::backdrop { background: rgba(15, 15, 15, .7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.imgbox img { display: block; min-width: 240px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 90px); object-fit: contain; background: #111; }
.imgbox__close {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--a-ink); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.imgbox__close .icon { width: 16px; height: 16px; }
.imgbox__foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.imgbox__cap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.imgbox__foot .pill { height: 34px; padding: 0 12px; font-size: 12px; }
.imgbox__foot .icon { width: 14px; height: 14px; }
@media (max-width: 480px) { .imgbox__foot .pill span { display: none; } }
.addimg.is-loading .icon { animation: skel 0.8s ease-in-out infinite alternate; }
.thumb {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, #1E293B, #2563EB); color: rgba(255, 255, 255, .85);
}
.thumb[hidden] { display: none; }
.thumb .icon { width: 20px; height: 20px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.addimg {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px;
  background: var(--a-chip); color: var(--a-muted);
}
.addimg .icon { width: 18px; height: 18px; }
.addimg:hover { color: var(--blue); background: #EFF6FF; }
.editbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px;
  background: #FEF2F2; color: var(--a-down);
}
.editbtn .icon { width: 15px; height: 15px; }
.editbtn:hover, .editbtn[aria-expanded="true"] { background: #FEE2E2; }
.jfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--a-line); font-size: 12px; color: var(--a-muted); }
.pager { display: flex; gap: 6px; }
.pager__btn {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--a-line); border-radius: 6px;
  background: #fff; font-size: 12px; color: var(--a-ink);
}
.pager__btn .icon { width: 14px; height: 14px; }
.pager__btn.is-current { border-color: var(--blue); background: var(--blue); color: #fff; }
.pager__btn:disabled { color: var(--a-line); cursor: default; }

.rowmenu {
  position: fixed; z-index: 45; display: grid; min-width: 150px; padding: 6px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 10px; box-shadow: 0 16px 40px rgba(26, 26, 26, .14);
}
.rowmenu[hidden] { display: none; }
.rowmenu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 6px; background: none; font-size: 14px; color: var(--a-ink); text-align: left; }
/* Đường kẻ chỉ ngăn mục Xóa với các mục trên */
.rowmenu button + .rowmenu__danger { margin-top: 4px; border-top: 1px solid var(--a-line); border-radius: 0 0 6px 6px; }
.rowmenu { min-width: 190px; }
.rowmenu button .icon { width: 15px; height: 15px; }
.rowmenu button:hover { background: var(--a-chip); }
.rowmenu__danger { color: var(--a-down) !important; }

/* Popup them / sua giao dich */
.tmodal {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 14px;
  color: var(--a-ink); box-shadow: 0 30px 80px rgba(26, 26, 26, .3);
}
/* Popup: tiêu đề + chân cố định, chỉ phần giữa cuộn; thanh cuộn mảnh xám nhạt nằm trong khung (không cắt góc bo tròn) */
.tmodal:has(> .tform > .tform__body) { overflow: hidden; }
.tmodal[open] > .tform:has(> .tform__body) { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.tmodal > .tform:has(> .tform__body) > * { flex: none; }
.tmodal > .tform > .tform__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* Mọi thanh cuộn kiểu Tailwind (tailwind-scrollbar thin; người dùng 2026-10-28: thanh cuộn ngang của bảng khi màn nhỏ / phóng to trình duyệt
   nhìn xấu): rộng / cao 6px, thumb 4px gray-300 rounded-full, rê vào thumb gray-400, rãnh trong suốt. Chỉ hiện khi rê chuột vào vùng cuộn:
   app.js gắn lớp sb-on cho các vùng đang cuộn được quanh con trỏ (Chrome không vẽ lại thanh cuộn theo :hover); html.sb-js = JS đã chạy,
   chưa có thì thanh cuộn luôn hiện. Trang (html) luôn hiện. Chrome 121+ có scrollbar-color thì bỏ qua ::-webkit-scrollbar
   -> scrollbar-width / scrollbar-color chỉ cho trình duyệt không có ::-webkit-scrollbar (Firefox) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: #D1D5DB transparent; }
  html.sb-js body * { scrollbar-color: transparent transparent; }
  html.sb-js body .sb-on { scrollbar-color: #D1D5DB transparent; }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #D1D5DB; border-radius: 9999px; border: 1px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #9CA3AF; }
html.sb-js body *::-webkit-scrollbar-thumb { background-color: transparent; }
html.sb-js body .sb-on::-webkit-scrollbar-thumb { background-color: #D1D5DB; }
html.sb-js body .sb-on::-webkit-scrollbar-thumb:hover { background-color: #9CA3AF; }
.tmodal::backdrop { background: rgba(26, 26, 26, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.tform__head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--a-line); }
.tform__head h2 { font-size: 18px; font-weight: 700; }
.tform__head p { margin-top: 4px; font-size: 12px; color: var(--a-muted); }
.tform__close { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--a-chip); color: var(--a-ink); }
.tform__close .icon { width: 16px; height: 16px; }
.tform__body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; }
.tform__note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; background: #FFFBEB; color: #D97706; font-size: 12px; }
.tform__note .icon { width: 15px; height: 15px; flex: none; }
.tform.is-edit .tform__note { background: #EFF6FF; color: var(--blue); }
.tform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; font-size: 11px; color: var(--a-text); }
.tf > span, .tf > legend, .tf > label { padding: 0; font-size: 11px; color: var(--a-text); }
.tf > legend { margin-bottom: 6px; }
.tf input:not([type="radio"]):not([type="file"]), .tf select, .tf textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff;
  font: 400 13px/1.4 var(--font-body); color: var(--a-ink);
}
.tf--select select { appearance: none; -webkit-appearance: none; padding-right: 34px; }
.tf--select > .icon { position: absolute; right: 12px; bottom: 13px; width: 15px; height: 15px; color: var(--a-muted); pointer-events: none; }
.tf select:disabled { background: var(--a-panel); color: var(--a-text); opacity: 1; }
.tf input:focus, .tf select:focus, .tf textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tf [aria-invalid="true"] { border-color: var(--a-down) !important; }
.tseg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 42px; padding: 3px; border-radius: 6px; background: var(--a-chip); }
.tseg label { position: relative; display: block; }
.tseg input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tseg span { display: grid; place-items: center; height: 100%; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--a-text); }
.tseg input:checked + .tseg__buy { background: #fff; color: var(--a-up); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.tseg input:checked + .tseg__sell { background: #fff; color: var(--a-down); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.tseg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.tf__area { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--a-line); border-radius: 6px; }
.tf__area:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tf .tf__area textarea { height: auto; min-height: 60px; padding: 0; border: 0; box-shadow: none; resize: vertical; line-height: 20px; }
.tf__attach { display: flex; align-items: center; gap: 8px; }
.tf__attach .thumb { width: 42px; height: 42px; }
.tf__addimg {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 6px;
  font-size: 12px; color: var(--a-text); cursor: pointer;
}
.tf__addimg .icon { width: 15px; height: 15px; }
.tf__addimg:hover { border-color: var(--blue); color: var(--blue); }
.tf__rmimg { padding: 0; border: 0; background: none; font-size: 12px; color: var(--a-down); }
.tf__rmimg[hidden] { display: none; }
.tform__error { padding: 10px 12px; border-radius: 6px; background: #FEF2F2; color: var(--a-down); font-size: 12.5px; }
.tform__error[hidden] { display: none; }
.tform__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--a-line); }

/* Responsive Nhat ky */
@media (max-width: 1500px) {
  .jstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1240px) {
  .journal { padding: 20px 20px 32px; }
  .jsearch { width: 280px; }
}
@media (max-width: 900px) {
  .journal { padding: 16px 12px 24px; gap: 14px; }
  .jhead { align-items: flex-start; }
  .jhead__title { font-size: 24px; }
  .jhead__actions { width: 100%; }
  .pill--primary { margin-left: auto; }
  .jstats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .jstat:last-child { grid-column: 1 / -1; }
  .jstat__val { font-size: 22px; }
  .jtoolbar { padding: 12px; }
  .jtoolbar .tabs { width: 100%; }
  .jtoolbar .tab { flex: 1; }
  .jtools { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .jsearch { flex: 0 0 220px; }
  .fsel { flex: none; }
  /* Bang -> the cho tung lenh */
  .jscroll { overflow: visible; }
  .jt { min-width: 0; }
  .jt thead { display: none; }
  .jt, .jt tbody { display: block; }
  .jt tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 14px 12px; border-top: 1px solid var(--a-line); }
  .jt td { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: auto; padding: 0 !important; border: 0; text-align: left !important; }
  .jt td::before { content: attr(data-label); font-family: var(--font-body); font-size: 11px; font-weight: 400; color: var(--a-muted); }
  .jt td.c-sym { grid-column: 1; grid-row: 1; display: block; }
  .jt td.c-sym::before, .jt td.c-note::before, .jt td.c-edit::before, .jt td.c-side::before { content: none; }
  .jt td.c-side { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 10px; }
  .jt td.c-edit { position: absolute; }
  .jt tr { position: relative; }
  .jt td.c-edit { top: 14px; right: 12px; }
  .jt td.c-side { padding-right: 44px !important; }
  .jt td.c-pnl b { display: inline; }
  .jt td.c-pnl { justify-content: space-between; }
  .jt td.c-pnl small { margin-left: 6px; }
  .jt td.c-note { grid-column: 1 / -1; }
  .jnote { min-width: 0; width: 100%; }
  .tform__row { grid-template-columns: 1fr; }
  .tform__head, .tform__body, .tform__foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .pill { padding: 9px 14px; }
  .pill--export span, .pill--chart span { display: none; }
}

/* ---------- Nhat ky: che do Kanban ---------- */
.seg__item { border: 0; background: none; font: inherit; font-size: 12px; cursor: pointer; }
.seg__item[aria-pressed="true"] { background: #fff; color: var(--a-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.seg__item[aria-pressed="false"]:hover { color: var(--a-ink); }
.journal.is-kanban .jstats, .journal.is-kanban .fsel--table-only { display: none; }
/* Lenh tu dong: o gia / khoi luong chi doc khi sua */
.tform.is-auto input[readonly] { color: var(--a-muted); background: var(--a-chip); cursor: default; }
.tform.is-auto .tseg input:disabled + span { opacity: .4; cursor: default; }
.jt .c-num.is-approx { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.journal.is-kanban .jtable { background: none; border: 0; }
.journal.is-kanban .jtoolbar { padding: 0; }
[data-table-view][hidden], .board[hidden] { display: none; }
.board { display: grid; grid-template-columns: repeat(5, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.kcol { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: #EDEBE5; }
.kcol__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.kcol__head h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.kcol__head h2 i { width: 8px; height: 8px; border-radius: 50%; }
.kcol__count { padding: 2px 8px; border-radius: 100px; background: #fff; font-size: 11px; font-weight: 500; color: var(--a-text); }
.kcol__plus { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-muted); }
.kcol__plus:hover { background: #fff; color: var(--a-ink); }
.kcol__plus .icon { width: 16px; height: 16px; }
.kcol__cards { display: flex; flex-direction: column; gap: 10px; }
.kcol__add {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 1px dashed #D6D3CC; border-radius: 10px;
  background: none; font-size: 12px; color: var(--a-muted);
}
.kcol__add .icon { width: 14px; height: 14px; }
.kcol__add:hover { border-style: solid; background: rgba(255, 255, 255, .6); color: var(--a-ink); }
.kcard {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--a-line); border-radius: 10px; background: #fff;
  cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease;
}
.kcard:hover { border-color: #D6D3CC; box-shadow: 0 6px 16px rgba(26, 26, 26, .06); }
.kcard__top, .kcard__mid, .kcard__foot { display: flex; justify-content: space-between; gap: 10px; }
.kcard__top { align-items: center; }
.kcard__top b { display: block; font-size: 14px; font-weight: 600; }
.kcard__top small, .kcard__mid small { font-size: 11px; color: var(--a-muted); }
.kcard__top .sidebadge { padding: 3px 9px; font-size: 11px; }
.kcard__mid { align-items: flex-end; }
.kcard__val { font-size: 18px; font-weight: 600; line-height: 1.25; }
.kcard__val--wait { font-size: 14px; font-weight: 500; color: var(--a-text); }
.kcard__r { font-size: 12px; font-weight: 600; }
.kcard__r.is-empty { padding: 4px 8px; border-radius: 6px; background: var(--a-chip); color: var(--a-muted); font-weight: 400; }
.kcard__note { font-size: 12px; line-height: 17px; color: var(--a-text); }
.kcard__img {
  display: grid; place-items: center; height: 88px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, #1E293B, #2563EB); color: rgba(255, 255, 255, .85);
}
.kcard__img .icon { width: 26px; height: 26px; }
/* Anh hien du khung theo ty le goc (anh doc day the dai ra), bam de phong to */
.kcard__img:has(img) { display: block; height: auto; background: var(--a-chip); }
.kcard__img img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; cursor: zoom-in; }
.kcard__foot { align-items: center; padding-top: 9px; border-top: 1px solid var(--a-line); }
.kcard__foot .stchip { padding: 3px 9px; font-size: 11px; }
a.stchip { text-decoration: none; }
a.stchip:hover { background: #EFF6FF; color: #2563EB; }
.kcard__foot time { font-size: 11px; color: var(--a-muted); }
.kcard--cancelled { opacity: .78; }
.kcol[hidden] { display: none; }
/* Kanban khi loc 1 trang thai: mot cot rong ca bang, the xep thanh luoi nhieu cot */
.board.is-single { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
/* Xep gach (kieu Google Keep): the cao thap khac nhau xep khit theo cot */
.board.is-single .kcol__cards { display: block; columns: 260px; column-gap: 10px; }
.board.is-single .kcard { break-inside: avoid; margin-bottom: 10px; }

@media (max-width: 1500px) {
  .board { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(280px, 1fr); overflow-x: auto; padding-bottom: 6px; }
}
@media (max-width: 900px) {
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 6px; scroll-padding: 0 12px; }
  .kcol { scroll-snap-align: start; }
}

/* ---------- Trang Chien luoc ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.jstat__delta--warn .icon { color: var(--amber); }
.fsel--caps > span { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.jt--strat { min-width: 1640px; }
.jt--strat th, .jt--strat td { padding-left: 4px; padding-right: 4px; }
.jt--strat td { padding-top: 14px; padding-bottom: 14px; }
.s-c { text-align: center !important; white-space: nowrap; }
.s-r { text-align: right !important; white-space: nowrap; }
.s-name { min-width: 300px; }
.sname { display: flex; align-items: center; gap: 12px; }
/* Linh vật (ltApp.pets.el): ô màu, SVG phủ đúng ô (hình ~47% ô với viewBox 72, phóng to bằng viewBox nhỏ hơn) */
.pet { display: block; overflow: hidden; }
.pet svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.sname__pet { flex: none; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.sname__pet:hover .pet, .sname__pet:focus-visible .pet { box-shadow: 0 0 0 2px var(--blue); }
.sname__pet:focus-visible { outline: none; }
.sname__ic.pet { width: 40px; height: 40px; border-radius: 12px; }
.tmodal--pet { width: min(840px, calc(100vw - 24px)); border-radius: 20px; }
.petgrid { display: grid; grid-template-columns: repeat(auto-fill, 72px); justify-content: space-between; gap: 14px 8px; }
.petcell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 72px; cursor: pointer; }
.petcell input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.petcell__ic { width: 72px; height: 72px; border-radius: 24px; transition: transform .12s; }
.petcell small { width: 72px; font-size: 10.5px; line-height: 14px; color: #5B6472; text-align: center; }
.petcell:hover .petcell__ic { transform: translateY(-2px); }
.petcell:has(input:checked) .petcell__ic { box-shadow: 0 0 0 2px var(--blue); }
.petcell:has(input:checked) small { color: var(--blue); font-weight: 600; }
.petcell:has(input:focus-visible) .petcell__ic { outline: 2px solid var(--blue); outline-offset: 3px; }
.sname__ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--a-chip); }
.sname__ic .icon { width: 18px; height: 18px; }
.sname__ic--blue { color: var(--blue); }
.sname__ic--green { color: var(--a-up); }
.sname__ic--amber { color: #D97706; }
.sname__ic--gray { color: var(--a-text); }
.sname b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.sname__link { color: inherit; }
.sname__link:hover { color: var(--blue); text-decoration: underline; }
.sname small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--a-muted); }
.sstate { padding: 1px 7px; border-radius: 100px; font-size: 10px; font-weight: 500; }
.sstate--paused { background: #FFFBEB; color: #D97706; }
.sstate--draft { background: var(--a-chip); color: var(--a-text); }
.jt tbody tr.is-paused td:not(.c-edit), .jt tbody tr.is-draft td:not(.c-edit) { opacity: .62; }
.srun { display: inline-flex; align-items: center; gap: 6px; min-width: 88px; justify-content: center; padding: 5px 12px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.srun::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.srun--live { background: #ECFDF5; color: var(--a-up); }
.srun--demo { background: #EFF6FF; color: var(--blue); }
.srun--backtest { background: #FFFBEB; color: #D97706; }
.schip { display: inline-block; min-width: 72px; padding: 5px 10px; border-radius: 6px; background: var(--a-chip); font-size: 12px; color: var(--a-text); }
.schip--line { background: #fff; border: 1px solid var(--a-line); }
.s-sym { font-weight: 600; }
.s-rt { color: var(--blue); }
.s-muted { color: var(--a-text); }
.s-warn { color: #D97706; }
.s-strong { font-weight: 600; }
.smode { display: inline-block; min-width: 88px; padding: 5px 12px; border-radius: 100px; font-size: 11px; font-weight: 600; color: #fff; }
.smode--auto { background: #16A34A; }
.smode--manual { background: #7C3AED; }

@media (max-width: 900px) {
  .jt--strat { min-width: 0; }
  .jt--strat td.s-name { grid-column: 1 / -1; padding-right: 44px !important; }
  .jt--strat td.s-name::before { content: none; }
  .jt--strat td.s-c, .jt--strat td.s-r { text-align: left !important; }
  .srun, .schip, .smode { min-width: 0; }
}

/* ---------- Dropdown theo thiet ke (thay <select> mac dinh) ---------- */
.jsearch, .fsel { background: #fff; }
select.dd-native {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; opacity: 0 !important; pointer-events: none !important;
}
.dd-btn {
  display: inline-flex; align-items: center; min-width: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.dd-btn:disabled { cursor: default; }
.dd-btn:focus-visible { outline: none; }
.dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel, .tf--select, .cv-cur { cursor: pointer; }
.fsel .dd-btn { font-weight: 600; color: var(--a-ink); }
.fsel.is-disabled { cursor: default; }
.fsel.is-disabled .dd-btn { color: var(--a-muted); }
.fsel:has(.dd-btn:focus-visible) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.fsel.is-open { border-color: #9E9E9E; box-shadow: none; }
.fsel--time.is-active.is-open { border-color: transparent; }
.fsel--time.is-active .dd-btn { color: var(--blue); }
.fsel > .icon, .tf--select > .icon, .cv-cur > .icon { transition: transform .15s ease; }
.is-open > .icon { transform: rotate(180deg); }
.tf--select > .icon { transform-origin: 50% 50%; }
.tf--select .dd-btn {
  width: 100%; height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff;
  font: 400 13px/1.4 var(--font-body); color: var(--a-ink);
}
.tf--select.is-open .dd-btn, .tf--select .dd-btn:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tf--select .dd-btn:disabled { background: var(--a-panel); color: var(--a-text); }
.tf--select.is-disabled { cursor: default; }
.cv-cur .dd-btn { padding: 4px 16px 4px 0; margin-right: -14px; font-weight: 600; color: var(--a-ink); }

.dd-panel {
  position: fixed; z-index: 1100; display: flex; flex-direction: column; gap: 2px; max-height: min(320px, 60vh); overflow-y: auto; padding: 6px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 10px; box-shadow: 0 16px 40px rgba(26, 26, 26, .12);
  font: 400 13px/1.4 var(--font-body); color: var(--a-ink); outline: none;
}
.dd-panel[hidden] { display: none; }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 6px;
  white-space: nowrap; cursor: pointer;
}
.dd-opt:hover, .dd-opt.is-active { background: var(--a-panel); }
.dd-opt[aria-selected="true"] { background: var(--a-chip); }
.dd-opt[aria-disabled="true"] { opacity: .5; cursor: default; }
.dd-opt__left { display: inline-flex; align-items: center; gap: 10px; }
.dd-opt__left--sub { display: inline-grid; gap: 1px; }
.dd-opt__sub { font-size: 11px; font-weight: 400; color: var(--a-muted); }
.dd-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dd-pet { flex: none; width: 22px; height: 22px; border-radius: 6px; }
.dd-ic { flex: none; width: 16px; height: 16px; margin: 0 3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dd-value:has(.dd-pet), .dd-value:has(.dd-ic) { display: inline-flex; align-items: center; gap: 6px; }
.dd-check { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dd-value:has(.dd-candles), .dd-value:has(.dd-dot) { display: inline-flex; align-items: center; gap: 8px; }
.dd-candles { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.dd-candles i { position: relative; display: block; width: 5px; border-radius: 1px; }
.dd-candles i::before { content: ""; position: absolute; left: 2px; top: -3px; bottom: -3px; width: 1px; background: inherit; }
.dd-candles i:first-child { height: 7px; background: var(--a-down); }
.dd-candles i:last-child { height: 13px; background: var(--a-up); }
.dd-candles--bear i:first-child { height: 13px; background: var(--a-up); }
.dd-candles--bear i:last-child { height: 7px; background: var(--a-down); }
.dd-panel--accent .dd-opt { justify-content: flex-start; }
.dd-group { padding: 8px 10px 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); }
.dd-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--a-line); padding-top: 10px; }
.dd-sep { flex: none; height: 1px; margin: 4px 4px; background: var(--a-line); }
.dd-opt--action { color: var(--blue); font-weight: 600; }
/* Ô giá trị của điều kiện: danh sách / ô số / "trong N nến" / khoảng */
/* Tạo chiến lược: thanh 5 bước + thẻ bước + mục Nâng cao */
.ssteps { position: sticky; top: 72px; z-index: 20; display: flex; gap: 4px; padding: 6px; border: 1px solid var(--a-line); border-radius: 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(17, 24, 39, .05); }
.ssteps__item { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 8px 6px; border-radius: 8px; color: var(--a-text); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ssteps__item span { overflow: hidden; text-overflow: ellipsis; }
.ssteps__item:hover { background: var(--a-panel); }
.ssteps__item.is-current { background: #EFF6FF; color: var(--blue); font-weight: 600; }
.ssteps__n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--a-chip); font-size: 11.5px; font-weight: 700; color: var(--a-text); }
.ssteps__item.is-current .ssteps__n { background: var(--blue); color: #fff; }
.ssteps__item.is-ok .ssteps__n { background: var(--a-up); color: #fff; font-size: 0; }
.ssteps__item.is-ok .ssteps__n::before { content: "✓"; font-size: 12.5px; font-weight: 800; }
.ssteps__item.is-missing .ssteps__n { background: #FEF2F2; color: var(--a-down); }
.sstep { scroll-margin-top: 140px; }
.sstep__n { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); }
.sstep__sub { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.sinds { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--a-line); }
.sinds__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--a-text); }
.sadv { margin-top: 16px; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-panel); }
.sadv > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--a-ink); cursor: pointer; list-style: none; }
.sadv > summary::-webkit-details-marker { display: none; }
.sadv > summary .icon { width: 14px; height: 14px; color: var(--a-muted); transition: transform .15s ease; transform: rotate(-90deg); }
.sadv[open] > summary .icon { transform: none; }
.sadv__on { margin-left: auto; padding: 2px 8px; border-radius: 100px; background: #EFF6FF; color: var(--blue); font-size: 11.5px; font-style: normal; font-weight: 600; }
.sadv__on:empty { display: none; }
.sadv__body { display: grid; gap: 14px; padding: 0 14px 14px; }
.sadv__body .emode { margin-top: 0; }
@media (max-width: 900px) { .ssteps { top: 60px; overflow-x: auto; } .ssteps__item { flex: none; } .ssteps__item span { display: none; } .ssteps__item.is-current span { display: inline; } }
/* Bảng mẫu nến: mẫu ít dùng / setup ghép để ở mục mở rộng */
.pmore { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 8px; background: none; font: 600 13px var(--font-body); color: var(--blue); cursor: pointer; }
.pmore:hover { background: #EFF6FF; }
.pmore[hidden] { display: none; }
.pmore .icon { width: 15px; height: 15px; transition: transform .15s ease; }
.pmore.is-open .icon { transform: rotate(180deg); }
.psetbox { margin-top: 14px; border-top: 1px solid var(--a-line); padding-top: 10px; }
.psetbox__head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.psetbox__head h3 { font-size: 13px; font-weight: 600; color: var(--a-text); }
.psetbox__head .psetbox__add { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
.psetbox__add .icon { width: 14px; height: 14px; }
.psetbox__add:hover { text-decoration: underline; }
.psetbox__add:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
/* Trang Chi tiết: độ tin cậy kết quả backtest */
.sdq { display: grid; gap: 12px; margin-top: 14px; padding: 16px 18px; border: 1px solid var(--a-line); border-radius: 10px; background: #fff; }
.sdq[hidden] { display: none; }
.sdq__verdict { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; }
.sdq__verdict .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.sdq__verdict.is-up { color: var(--a-up); }
.sdq__verdict.is-mid { color: var(--blue); }
.sdq__verdict.is-warn { color: #B45309; }
.sdq__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; }
@media (max-width: 1100px) { .sdq__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sdq__grid > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--a-panel); }
.sdq__grid dt { font-size: 11.5px; color: var(--a-muted); }
.sdq__grid dd { margin: 0; font-size: 18px; font-weight: 600; color: var(--a-ink); }
.sdq__grid dd.is-up { color: var(--a-up); }
.sdq__grid dd.is-down { color: var(--a-down); }
.sdq__grid dd.is-warn { color: #B45309; }
.sdq__grid small { font-size: 11.5px; color: var(--a-muted); }
.sdq__note { margin: 0; font-size: 11.5px; color: var(--a-muted); }
@media (max-width: 800px) { .sdq__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Cảnh báo điều kiện trùng / mâu thuẫn */
.rwarn { display: grid; gap: 6px; margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: #FFFBEB; color: #B45309; font-size: 12.5px; line-height: 1.5; }
.rwarn[hidden] { display: none; }
.rwarn p { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.rwarn .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.rwarn__dup { color: var(--a-text); }
.rwarn__info { color: #1D4ED8; }
.rwarn__btn { margin-left: 2px; padding: 1px 8px; border: 1px solid #93C5FD; border-radius: 999px; background: #fff; color: #1D4ED8; font: inherit; font-weight: 600; cursor: pointer; }
.rwarn__btn:hover { background: #DBEAFE; }
.rwarn:has(.rwarn__info):not(:has(p:not(.rwarn__info))) { background: #EFF6FF; }
.shint--win { display: block; margin: -6px 0 14px; }
.rule.is-conflict .rule__n { background: #FEF3C7; color: #B45309; font-weight: 600; }
.rval { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rval > .rsel { min-width: 120px; }
.rval > .rsel { flex: 1; min-width: 0; }
.rule .rval > .rsel .dd-btn { padding: 0 26px 0 10px; }
.rval > .rsel > .icon { right: 9px; }
.rval__t { flex: none; font-size: 12px; color: var(--a-muted); white-space: nowrap; }
.rval__sell { color: var(--a-down); }
.rval__sell[hidden] { display: none; }
.rnum { flex: 1; min-width: 0; width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; color: var(--a-ink); }
.rnum:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.rnum[aria-invalid="true"] { border-color: var(--a-down); }
.rnum--n { flex: none; width: 58px; text-align: center; }
.rval__back { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; color: var(--a-muted); cursor: pointer; }
.rval__back:hover { color: var(--blue); border-color: #C7D2FE; }
.rval__back .icon { width: 13px; height: 13px; }
/* Điều kiện chưa chọn đủ: ô chưa chọn hiện chữ gợi ý màu nhạt */
.tf--select .dd-btn:has(+ select option[value=""][hidden]:checked), .acct .dd-btn:has(+ select option[value=""][hidden]:checked),
.rule .rsel .dd-btn:has(+ select option[value=""]:checked) { color: var(--a-muted); font-weight: 400; }
.rsel__txt.is-empty { color: var(--a-muted); font-weight: 400; }
/* Dropdown mã giao dịch (trang Tạo chiến lược): ô gõ tìm + danh sách theo nhóm thị trường */
.symcombo { position: relative; }
.symcombo > .icon { pointer-events: auto; cursor: pointer; transition: transform .15s ease; }
.symcombo.is-open > .icon { transform: rotate(180deg); }
.snew .symcombo input { padding-right: 34px; text-transform: uppercase; cursor: pointer; caret-color: transparent; }
.symcombo input::placeholder { text-transform: none; }
.snew .symcombo.is-locked input { background: var(--a-panel); cursor: not-allowed; }
.symcombo.is-locked > .icon { pointer-events: none; opacity: .45; }
.symdd { max-height: min(380px, 60vh); padding: 0; overflow: hidden; gap: 0; }
.symdd__search { display: flex; align-items: center; gap: 8px; flex: none; margin: 6px 6px 2px; padding: 0 10px; height: 36px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-panel); color: var(--a-muted); }
.symdd__search:focus-within { border-color: var(--blue); background: #fff; }
.symdd__search .icon { width: 15px; height: 15px; flex: none; }
.symdd__search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font: 400 13px var(--font-body); color: var(--a-ink); text-transform: uppercase; }
.symdd__search input::placeholder { text-transform: none; color: var(--a-muted); }
.symdd__list { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; padding: 4px 6px 6px; }
.symdd__opt--custom strong { color: var(--blue); }
.symdd__opt { justify-content: flex-start; gap: 12px; padding: 8px 10px; }
.symdd__opt strong { flex: none; min-width: 84px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; font-weight: 600; }
.symdd__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--a-muted); }
.symdd__opt[aria-selected="true"] { background: #EFF6FF; }
.symdd__opt[aria-selected="true"] strong { color: var(--blue); }
.symdd__empty { margin: 0; padding: 10px; font-size: 12px; color: var(--a-muted); }
.dd-panel--accent .dd-opt[aria-selected="true"] { background: #EFF6FF; color: var(--blue); font-weight: 600; }

/* ================= Trang Tao chien luoc ================= */
.snew .preview-note { margin-bottom: -4px; }
.snew__head { align-items: flex-end; }
.snew__back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--blue); }
.snew__back .icon { width: 14px; height: 14px; }
.snew__back:hover { text-decoration: underline; }
.pill--ghost { color: var(--a-text); background: #F5F4F1; border-color: transparent; }
.pill--sm { padding: 8px 14px; font-size: 13px; }
.pill--sm .icon { width: 15px; height: 15px; }
.pill--link { color: var(--blue); }
.snew__error { padding: 10px 14px; border-radius: 8px; background: #FEF2F2; color: var(--a-down); font-size: 13px; }
.snew__error[hidden] { display: none; }
.snew__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 600px); gap: 26px; align-items: start; }
/* Trang Tạo nhúng trong trang Biểu đồ (?embed=entry): chỉ bước 2 + hình minh hoạ */
.is-embed .topbar, .is-embed .tabbar, .is-embed .skip-link, .is-embed .snew__head, .is-embed .ssteps, .is-embed #step-1, .is-embed--entry #step-3, .is-embed--exit #step-2, .is-embed--entry #step-4, .is-embed--exit #step-4,
.is-embed--size #step-2, .is-embed--size #step-3, .is-embed--size .sillus,
.is-embed:not(.is-embed--size) .snew__side > .scard:not(.sillus), .is-embed--size .snew__side > .scard:not(:last-child), .is-embed .spin { display: none !important; }
.is-embed .snew { padding-top: 16px; padding-bottom: 80px; }
.is-embed .snew__grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; }
.snew__embedbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--a-line); background: #fff; }
.snew__main, .snew__side { display: flex; flex-direction: column; gap: 26px; min-width: 0; }

.scard { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; }
.scard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.scard__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.scard__title h2 { font-size: 16px; font-weight: 600; }
.scard__title p { margin-top: 2px; font-size: 12px; color: var(--a-muted); }
.scard__ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 6px; background: #EFF6FF; color: var(--blue); }
.scard__ic .icon { width: 18px; height: 18px; }
.scard__ic--green { background: #ECFDF5; color: var(--a-up); }
.scard__ic--amber { background: #FFFBEB; color: #D97706; }
.scard__ic--violet { background: #F5F3FF; color: #7C3AED; }

.snew .tf > span { font-size: 12px; font-weight: 600; color: var(--a-text); }
.snew .tf textarea { height: auto; min-height: 62px; padding: 10px 12px; resize: vertical; line-height: 20px; }
.snew .tf input::placeholder, .snew .tf textarea::placeholder { color: var(--a-muted); }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.sgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sgrid__full { grid-column: 1 / -1; }
.shint { font-size: 11px; color: var(--a-muted); }
/* Dòng công thức dừng lỗ (trái) + tiền dừng lỗ với 1 lot (phải, màu xanh); màn hẹp thì xuống dòng */
.shintrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; }
.shint--money { margin-left: auto; text-align: right; font-weight: 500; color: var(--blue); }
.shint--money[hidden] { display: none; }

/* Chon tai khoan (goc phai the Thong tin co ban) */
.acct {
  position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) 15px; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  width: min(340px, 100%); min-height: 46px; padding: 6px 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; cursor: pointer;
}
.acct.is-open, .acct:has(.dd-btn:focus-visible) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.acct__ic { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #EFF6FF; color: var(--blue); }
.acct__ic .icon { width: 15px; height: 15px; }
.acct .dd-btn { grid-column: 2; grid-row: 1; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.acct .dd-btn::after { content: ""; position: absolute; inset: 0; }
.acct small { grid-column: 2; grid-row: 2; font-size: 11px; color: var(--a-muted); }
.acct > .icon { grid-column: 3; grid-row: 1 / 3; width: 15px; height: 15px; color: var(--a-muted); transition: transform .15s ease; }

/* Nut chon kieu segmented */
.sseg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 3px; height: 42px; padding: 3px; border-radius: 6px; background: var(--a-chip); }
.sseg label { position: relative; display: block; min-width: 0; }
.sseg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sseg span { display: grid; place-items: center; height: 100%; padding: 0 6px; border-radius: 5px; font-size: 13px; color: var(--a-text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sseg input:checked + span { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.sseg input:disabled { cursor: not-allowed; }
.sseg input:disabled + span { color: var(--a-muted); opacity: .45; }
.sside { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--a-line); }
.sside__label { font-size: 13.5px; font-weight: 600; color: var(--a-ink); }
.sseg.sside__seg { width: min(300px, 100%); }
.sside__hint { flex: 1 1 220px; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--a-muted); }
.rmirror { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--a-panel); font-size: 12.5px; line-height: 1.5; color: var(--a-text); }
.rmirror[hidden] { display: none; }
.rmirror__t { margin: 0 0 4px; font-weight: 600; color: var(--a-down); }
.rmirror ol { margin: 0; padding-left: 4px; list-style: none; }
.sseg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.sseg--sm { width: 180px; height: 34px; }
.sseg--sm span { font-size: 12px; }
.sseg--4 input:checked + span { color: var(--a-ink); }
.sseg label[hidden] { display: none; }
.sbadge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 100px; background: #EFF6FF; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.sbadge .icon { width: 11px; height: 11px; }
.sfake {
  display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 6px;
  background: var(--a-chip); font-size: 13px; color: var(--a-text);
}
.sfake .icon { width: 16px; height: 16px; color: var(--a-up); }
.sfake[hidden], [data-period][hidden] { display: none; }

/* Chi bao */
.indlist { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ind { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 6px; }
.ind__ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 6px; background: var(--a-chip); color: var(--blue); }
.ind__ic .icon { width: 18px; height: 18px; }
.ind__ic--green { color: var(--a-up); }
.ind__ic--amber { color: #D97706; }
.ind__ic--violet { color: #7C3AED; }
.ind__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.ind__info b { font-size: 14px; font-weight: 600; }
.ind__info small { font-size: 11px; color: var(--a-muted); }
.ind__tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.itag { padding: 4px 10px; border-radius: 100px; background: var(--a-chip); font-size: 11px; color: var(--a-muted); white-space: nowrap; }
.itag--entry { background: #ECFDF5; color: var(--a-up); }
.itag--exit { background: #FFFBEB; color: #D97706; }
.ind__rm, .rule__rm { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: var(--a-chip); color: var(--a-text); }
.ind__rm .icon, .rule__rm .icon { width: 15px; height: 15px; }
.ind__rm:hover, .rule__rm:hover { background: #FEF2F2; color: var(--a-down); }
.sempty { padding: 14px; border: 1px dashed var(--a-line); border-radius: 6px; font-size: 13px; color: var(--a-muted); text-align: center; }
.sempty[hidden] { display: none; }

/* Dieu kien */
.slogic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--a-text); }
/* Tất cả / Bất kỳ: dạng viên thuốc thấp, gọn trong câu */
.slogic .sseg { width: 136px; height: 28px; padding: 2px; gap: 2px; border-radius: 999px; }
.slogic .sseg span { border-radius: 999px; font-size: 12px; }
.rules { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rule { display: grid; grid-template-columns: 26px 64px 172px 128px minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.rule .rsel--tf .dd-btn { padding: 0 22px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--a-text); }
.rsel--tf > .icon { right: 7px; }
.rval__chip { flex: none; height: 30px; padding: 0 9px; border: 1px dashed var(--a-line); border-radius: 100px; background: #fff; font: inherit; font-size: 11.5px; color: var(--a-muted); cursor: pointer; white-space: nowrap; }
.rval__chip:hover { border-color: var(--blue); color: var(--blue); }
.emode { margin-top: 14px; }
.emode [hidden] { display: none; }
.emode + .shint { display: block; margin-top: 6px; }
/* Tuần tự: mỗi bước là 1 khối, dòng đầu "Khi", các dòng sau chọn Và / Hoặc */
.slogic .sseg--3 { width: 210px; }
.rstep { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 8px; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-panel); }
.rstep__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rstep { position: relative; transition: transform .15s; }
.rstep.is-drag { z-index: 6; transition: none; box-shadow: 0 8px 24px rgba(15, 23, 42, .16); }
.rstep__hl { display: flex; align-items: center; gap: 4px; }
.rstep__grip { display: grid; place-items: center; width: 22px; height: 28px; margin-left: -6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-muted); cursor: grab; touch-action: none; }
.rstep__grip:hover { background: var(--a-line); color: var(--a-text); }
.rstep.is-drag .rstep__grip { cursor: grabbing; }
.rstep__grip .icon { width: 15px; height: 15px; }
.rstep__h { font-size: 13.5px; font-weight: 600; color: var(--a-text); }
.rstep__del { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-muted); cursor: pointer; }
.rstep__del .icon { width: 15px; height: 15px; }
.rstep__del:hover:not(:disabled) { background: #FEF2F2; color: var(--a-down); }
.rstep__del:disabled, .rule--seq .rule__rm:disabled { opacity: .35; cursor: default; background: none; }
.rule--seq .rule__rm:disabled:hover { color: var(--a-text); }
.rstep__rules { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rstep__add { align-self: flex-start; height: 30px; font-size: 12.5px; }
.rstep__then { display: flex; align-items: center; gap: 4px; margin: -6px 0; font-size: 12px; font-weight: 600; color: var(--a-muted); }
.rstep__then .icon { width: 13px; height: 13px; }
.rstep__addstep { width: 100%; }
.rule--seq { grid-template-columns: 86px 64px 172px 128px minmax(0, 1fr) 32px; }
.addrule[hidden] { display: none; }
.rstep .rstep__add { align-self: flex-start; margin-left: 86px; }
.rule .rule__khi { width: 100%; height: 38px; border-radius: 6px; padding: 0 12px; place-items: center start; font-size: 13px; color: var(--a-muted); }
.rule--empty { display: block; padding: 12px; border-radius: 6px; background: var(--a-panel); font-size: 13px; color: var(--a-muted); text-align: center; }
.rule__n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--a-chip); font-size: 12px; color: var(--a-text); }
.rsel { position: relative; display: block; min-width: 0; cursor: pointer; }
.rsel .dd-btn { width: 100%; height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; font-size: 13px; color: var(--a-ink); }
.rsel > .icon { position: absolute; right: 12px; top: 12px; width: 13px; height: 13px; color: var(--a-muted); pointer-events: none; transition: transform .15s ease; }
.rsel--op .dd-btn { border-color: #EFF6FF; background: #EFF6FF; color: var(--blue); font-weight: 600; }
.rsel--op > .icon { color: var(--blue); }
.rsel.is-open .dd-btn, .rsel .dd-btn:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.rsel .dd-btn:disabled { background: var(--a-panel); color: var(--a-muted); }
.rsel--locked .dd-btn:disabled { color: var(--a-text); }
.rsel--locked > .icon { display: none; }
.rsel--locked { cursor: default; }
.addrule {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 1px solid var(--a-line); border-radius: 6px;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--blue);
}
.addrule .icon { width: 15px; height: 15px; }
.addrule:hover { border-color: var(--blue); background: #F8FAFF; }
/* Chỉ báo: ô trống + nút thêm giống phần điều kiện ở trên */
.sinds .addrule { width: 100%; margin-top: 14px; }
.sinds .sempty { padding: 12px; border: 0; background: var(--a-panel); }

/* Dung lo / chot loi */
.slfield { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 6px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; }
.slfield:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.slfield:has([aria-invalid="true"]) { border-color: var(--a-down); }
.slbasis { position: relative; display: block; flex: none; cursor: pointer; }
.slbasis .dd-btn { height: 30px; padding: 0 28px 0 10px; border-radius: 6px; background: #EFF6FF; color: var(--blue); font-size: 13px; font-weight: 600; }
.slbasis > .icon { position: absolute; right: 10px; top: 9px; width: 13px; height: 13px; color: var(--blue); pointer-events: none; transition: transform .15s ease; }
.snew .tf .slfield input { flex: 1; min-width: 40px; height: 38px; padding: 0; border: 0; box-shadow: none; text-align: right; font-weight: 600; }
.snew .tf .slfield input:focus { box-shadow: none; }
.slfield__unit { flex: none; font-size: 13px; color: var(--a-muted); white-space: nowrap; }
.sswitch { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sswitch--val > div { flex: 1; min-width: 0; }
.sswitch[hidden] { display: none; }
/* Đóng lệnh đang mở trước tin: dòng con của Tránh tin mạnh, chữ thường, sát dòng trên */
.snews__sub { margin-top: -6px; font-size: 13px; color: var(--a-ink); }
/* Tránh tin mạnh: khoảng cấm + lệnh đang mở */
.snews { display: flex; gap: 8px; flex: none; }
.snews .rsel { width: 136px; }
.ufield--sm { height: 34px; width: 108px; flex: none; padding: 0 6px 0 10px; }
.snew .tf .ufield--sm input, .snew .ufield--sm input { width: 100%; min-width: 0; height: 30px; padding: 0; border: 0; box-shadow: none; text-align: right; }
.snew [data-sessions-box][hidden] { display: none; }
.sswitch strong { display: block; font-size: 13px; font-weight: 600; }
.sswitch small { display: block; margin-top: 2px; font-size: 11px; color: var(--a-muted); }
.switch {
  position: relative; flex: none; width: 44px; height: 24px; margin: 0; border-radius: 100px; background: #D6D3CC; cursor: pointer;
  -webkit-appearance: none; appearance: none; transition: background-color .15s ease;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Khoi luong */
.ufield { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; }
.snew .tf > .ufield { padding: 0 12px; font-size: 13px; font-weight: 400; color: var(--a-ink); }
.ufield:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.ufield:has([aria-invalid="true"]) { border-color: var(--a-down); }
.ufield i { flex: none; font-size: 13px; font-style: normal; color: var(--a-ink); }
.ufield i:empty { display: none; }
.snew .tf .ufield input, .snew .tf .ufield input:focus { flex: 1; min-width: 0; height: 38px; padding: 0; border: 0; box-shadow: none; }
.snote { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 6px; background: #FFFBEB; color: #D97706; font-size: 11.5px; line-height: 1.5; }
.snote .icon { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.snote--info { background: #EFF6FF; color: #4B5E80; }
.snote--info .icon { color: var(--blue); }
.snote--blue { background: #EFF6FF; color: var(--blue); }
.snote[hidden], .slimwarn[hidden] { display: none; }
/* Trang Biểu đồ: thẻ lệnh, Quá khứ / Từ lúc bật, hướng dẫn từng bước */
.chp-tcard { position: absolute; left: 10px; bottom: 34px; z-index: 30; width: 268px; padding: 8px 14px 12px; border: 1px solid #E4E4E7; border-top: 3px solid var(--tc, #94A3B8); border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04); font-size: 12.5px; color: #1A1A1A; }
.chp-tcard[hidden] { display: none; }
.chp-tcard__nav { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; margin: 0 -6px 0 -6px; }
.chp-tcard.is-drag { box-shadow: 0 2px 6px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06); }
.chp-tcard { cursor: grab; touch-action: none; user-select: none; }
.chp-tcard.is-drag { cursor: grabbing; }
.chp-tcard button { cursor: pointer; }
.chp-tcard__nav b { font-size: 12.5px; font-weight: 600; color: #4B4B4B; }
/* Dòng điều hướng + dòng kết quả căn giữa (người dùng 2026-10-25); nút thu nhỏ / mở rộng nằm sát phải */
.chp-tcard__x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.chp-tcard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 10px; color: #6B6B6B; }
.chp-tcard__head b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.chp-tcard__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; padding: 10px 12px; border-radius: 8px; background: #F8FAFC; }
.chp-tcard__dl dt { color: #6B6B6B; }
.chp-tcard__dl dd { margin: 0; text-align: right; font-weight: 500; }
/* Khối điều kiện cùng kiểu khối Vào / Ra (nền xám nhạt, cùng lề) cho liền mạch (người dùng 2026-10-28) */
.chp-tcard__why { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 8px 0 0; padding: 8px 12px 10px; border-radius: 8px; background: #F8FAFC; color: #4B4B4B; line-height: 1.35; }
.chp-tcard__whyh { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 1px; }
.chp-tcard__whyl { text-align: left; font-size: 12px; font-weight: 600; color: #334155; }
.chp-tcard .chp-tcard__eye { width: 26px; height: 26px; margin-right: -6px; border-radius: 6px; color: #2563EB; }
.chp-tcard .chp-tcard__eye:hover { background: #E2E8F0; }
.chp-tcard .chp-tcard__eye .icon { width: 16px; height: 16px; }
.chp-tcard .chp-tcard__eye[aria-pressed="true"] { color: #94A3B8; }
.chp-tcard__chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px 3px 4px; border-radius: 100px; background: #EFF6FF; font-size: 11.5px; color: #1E3A8A; }
.chp-tcard__chip b { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--blue, #2563EB); font-size: 10px; color: #fff; }
.chp-tcard__chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chp-tcard__why[hidden] { display: none; }
/* Thống kê ngắn cả giai đoạn, trên khối Vào / Ra (người dùng 2026-10-28) */
.chp-tcard__sum { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 2px 0 10px; font-size: 11.5px; line-height: 1.4; color: #6B6B6B; }
.chp-tcard__sum > span { white-space: nowrap; }
.chp-tcard__sum .num { font-weight: 600; }
.chp-tcard__head:has(+ .chp-tcard__cost:not([hidden])) { margin-bottom: 0; }
.chp-tcard__cost { margin: -2px 0 8px; text-align: center; font-size: 11.5px; color: #131722; font-variant-numeric: tabular-nums; }
.chp-tcard__cost[hidden] { display: none; }
.chp-tcard__rng { margin: 0; }
.chp-tcard__hid { color: #D97706; font-weight: 600; }
.chp-tcard .chp-tcard__chip.is-off { opacity: .45; }
/* Bảng lệnh: tiêu đề cột bấm để sắp xếp */
/* Người dùng 2026-10-28: tiêu đề xanh dương đậm, căn giữa cùng nội dung; cột cố định (table-layout fixed) + mũi tên nằm ngoài dòng chữ
   để bấm sắp xếp không đẩy cột qua lại */
.chp-th { position: relative; display: inline-block; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.chp-th:hover { color: #1D4ED8; }
.chp-th__ar { position: absolute; left: 100%; top: 50%; margin-left: 3px; transform: translateY(-50%); font-style: normal; font-size: 8px; line-height: 1; }
#st-trades .chp-table { table-layout: fixed; min-width: 1010px; }
#st-trades .chp-table th { color: #1E3A8A; text-align: center; }
#st-trades .chp-table td { text-align: center; overflow: hidden; text-overflow: ellipsis; }
#st-trades .chp-table th:nth-child(1) { width: 56px; }
#st-trades .chp-table th:nth-child(2) { width: 84px; }
#st-trades .chp-table th:nth-child(3), #st-trades .chp-table th:nth-child(5) { width: 120px; }
#st-trades .chp-table th:nth-child(4), #st-trades .chp-table th:nth-child(6) { width: 100px; }
#st-trades .chp-table th:nth-child(7) { width: 96px; }
#st-trades .chp-table th:nth-child(8) { width: 110px; }
#st-trades .chp-table th:nth-child(9) { width: 84px; }
/* Cuộn lại: thân co theo chiều dọc (grid-template-rows 1fr -> 0fr), giữ nguyên độ rộng thẻ */
.chp-tcard { transition: padding-bottom .25s ease; }
.chp-tcard__body { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .25s ease, opacity .2s ease; }
.chp-tcard__body > div { min-height: 0; overflow: hidden; }
.chp-tcard.is-min { padding-bottom: 6px; }
.chp-tcard.is-min .chp-tcard__body { grid-template-rows: 0fr; opacity: 0; }
.chp-tcard__x[hidden] { display: none; }
.chp-sigtip { position: absolute; z-index: 7; display: flex; flex-direction: column; gap: 2px; max-width: 250px; padding: 7px 10px; border-radius: 8px; background: #1E293B; color: #F1F5F9; font-size: 11.5px; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.chp-sigtip[hidden] { display: none; }
.chp-sigtip b { color: #CBD5E1; font-weight: 600; }
.chp-menu.chp-rngpop { position: fixed; z-index: 960; width: 540px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: 10px; }
.chp-rngpop[hidden] { display: none; }
.chp-rngpop .chp-runpop__chip { height: 28px; padding: 0 11px; }
.chp-rngpop input[type="date"] { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 12.5px; }
.chp-rngpop__err { color: var(--a-down); }
.chp-rb { display: grid; gap: 8px; }
.chp-rb .chp-rb__chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.chp-rb .chp-rb__chips .chp-runpop__chip { padding: 0 4px; white-space: nowrap; }
.chp-rb .chp-rb__chips .chp-runpop__chip[data-v="fwd"] { grid-column: 1 / -1; }
.chp-rb.is-off .chp-rb__head, .chp-rb.is-off .chp-rb__track, .chp-rb.is-off .chp-rb__ticks, .chp-rb.is-off .chp-prm__grid { opacity: .4; pointer-events: none; }
.chp-rb__head { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 0; font-size: 12.5px; color: var(--a-ink); font-variant-numeric: tabular-nums; }
.chp-rb__est { color: var(--a-muted); text-align: right; }
.chp-rb__est.is-heavy { color: #D97706; }
.chp-rb__track { position: relative; height: 12px; margin: 8px 6px 0; border-radius: 999px; background: #E5E7EB; touch-action: none; }
.chp-rb__sel { position: absolute; top: 0; bottom: 0; min-width: 12px; border-radius: 999px; background: var(--blue); overflow: hidden; pointer-events: none; }
.chp-rb__hold { position: absolute; top: 0; bottom: 0; background: #F59E0B; }
.chp-rb__hold[hidden] { display: none; }
.chp-cap__row { display: flex; gap: 8px; align-items: center; }
.chp-cap__row input, .chp-cap__row > .nwrap { flex: 1; min-width: 0; }
.chp-cap__row .chp-runpop__chip, .chp-cap__wrow .chp-runpop__chip { flex: none; white-space: nowrap; }
.chp-cap__sub { margin: 6px 0 0; font-size: 12px; color: var(--a-muted); }
.chp-cap__sub a { color: #2563EB; font-weight: 500; }
.chp-cap__wrow { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 6px; }
.chp-cap__warn { margin: 0; font-size: 12px; color: #D97706; font-weight: 500; }
.chp-cap__row [hidden], .chp-cap__wrow[hidden] { display: none; }
.chp-rb__none { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px 0 0 999px; background: repeating-linear-gradient(-45deg, #D1D5DB 0 3px, #F3F4F6 3px 6px); pointer-events: none; }
.chp-rb__note { margin: 6px 6px 0; font-size: 12px; color: #D97706; font-weight: 500; }
.chp-rb__note[hidden], .chp-rb__none[hidden] { display: none; }
.chp-rb__chips .chp-runpop__chip:disabled { opacity: .4; cursor: not-allowed; }
.chp-rb__ticks { position: relative; height: 14px; margin: 0 6px; font-size: 10.5px; color: var(--a-muted); }
.chp-rb__ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.chp-rb__ticks span.is-end { right: 0; transform: none; }
.chp-rb__ticks span.is-start { left: 0; transform: none; }
.chp-rb .chp-prm__grid input[type="date"] { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 12.5px; }
.chp-rngpop__err:empty { display: none; }
.chp-oos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #FFFBEB; font-size: 12.5px; color: #92400E; }
.chp-oos[hidden] { display: none; }
.chp-oos__head { margin: 0; }
.chp-oos__note, .chp-oos__tag { color: #A16207; }
.chp-oos__warn { font-weight: 600; color: var(--a-down); }
.chp-oos .chp-btn { margin-left: auto; height: 28px; }
.chp-oos__btns { display: flex; gap: 6px; margin-left: auto; }
.chp-oos > svg { width: 16px; height: 16px; flex: none; color: #D97706; }
.chp-oos__btns .chp-btn { margin-left: 0; }
.chp-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 0; }
.chp-sides[hidden] { display: none; }
.chp-side-st { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; color: var(--a-text); }
.chp-side-st b { padding: 1px 8px; border-radius: 4px; font-size: 11.5px; }
.chp-side-st--long b { background: #ECFDF5; color: var(--a-up); }
.chp-side-st--short b { background: #FEF2F2; color: var(--a-down); }
.chp-side-st .num:first-of-type { font-weight: 700; }
.chp-kpi__oos { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: #B45309; }
/* Nút gạt Quá khứ | Demo ở hàng đầu khối Chiến lược */
.chp-stmode { flex: none; }
.chp-stmode[hidden] { display: none; }
.chp-stmode button { height: 24px; padding: 0 10px; font-size: 12px; }
.chp-stmode button[aria-checked="true"] { background: #fff; color: var(--a-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chp-stfrom { flex: none; padding: 2px 6px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 12px; color: var(--a-muted); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.chp-stfrom:hover { background: var(--a-chip); color: var(--blue); }
.chp-stfrom[hidden] { display: none; }
/* Ô khoảng thời gian (Quá khứ) / "từ ..." (Demo) rộng cố định: đổi chế độ không đẩy các nút bên cạnh */
.chp-stslot { display: inline-flex; align-items: center; flex: none; width: 200px; }
.chp-stslot .chp-range { max-width: 100%; min-width: 0; }
.chp-stslot .chp-range span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Hàng đầu khối chật: ô chọn chiến lược co lại (cắt chữ) để cụm nút bên phải luôn bám mép phải, không xô khi đổi Quá khứ | Demo */
.chp-dock__head .chp-stsel { flex: 0 1 auto; min-width: 120px; overflow: hidden; }
.chp-dock__head .chp-stsel .dd-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chp-stmode.is-busy, .chp-range.is-busy { opacity: .6; }
.chp-range { position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none; height: 28px; padding: 0 8px 0 10px; border-radius: 100px; background: var(--a-chip, #F1F1EF); font-size: 12.5px; color: var(--a-ink); }
.chp-range[hidden] { display: none; }
.chp-range > .icon { width: 14px; height: 14px; color: var(--a-text); }
.chp-range { border: 0; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chp-range:hover { background: #E7E5E4; }
.chp-range > .icon:last-child { width: 12px; height: 12px; color: var(--a-muted); }
.chp-rngpop__sec { display: grid; gap: 6px; }
.chp-rngpop__lab { margin: 0; font-size: 11.5px; color: var(--a-text); }
.chp-rngpop__custom { display: grid; gap: 8px; padding: 10px; border-radius: 8px; background: #F8FAFC; }
.chp-rngpop__custom[hidden] { display: none; }
.chp-rngpop .chp-field input { width: 100%; }
.chp-view { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--a-chip, #F1F1EF); }
.chp-view[hidden] { display: none; }
.chp-view button { padding: 3px 10px; border: 0; border-radius: 5px; background: none; font: inherit; font-size: 12px; color: #6B6B6B; cursor: pointer; }
.chp-view button[aria-pressed=true] { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chp-runpop { position: fixed; inset: 0; z-index: 990; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.35); }
.chp-runpop[hidden] { display: none; }
.chp-runpop__card { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 580px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 20px; border-radius: 12px; background: #fff; box-shadow: 0 20px 48px rgba(0,0,0,.2); }
.chp-runpop__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--a-ink); }
.chp-runpop__sub { margin: -10px 0 0; font-size: 12.5px; color: var(--a-muted); }
.chp-runpop__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chp-runpop__chip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; color: var(--a-ink); cursor: pointer; }
.chp-runpop__chip[aria-pressed="true"] { border-color: var(--blue); background: #EFF6FF; color: var(--blue); font-weight: 600; }
.chp-runpop__foot { display: flex; justify-content: flex-end; gap: 8px; }
.chp-runpop__bar { position: relative; height: 6px; overflow: hidden; border-radius: 999px; background: #E5E7EB; }
.chp-runpop__bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--blue); transform: scaleX(0); transform-origin: left center; will-change: transform; }
.chp-runpop { transition: opacity .25s ease; }
.chp-runpop.is-out { opacity: 0; }
.chp-runpop__bal { margin: 0; font-size: 12.5px; color: var(--a-text); }
.chp-runpop__msg { margin: 0; font-size: 12.5px; color: var(--a-text); }
.chp-runpop__why { display: grid; gap: 6px; margin: -4px 0 0; padding: 10px 12px; list-style: none; border-radius: 8px; background: #F8FAFC; font-size: 12.5px; color: var(--a-text); }
.chp-runpop__why li { display: flex; gap: 8px; line-height: 1.4; }
.chp-runpop__why b { flex: none; min-width: 26px; color: var(--a-ink); }
.chp-runpop .chp-runpop__note { margin: 0; padding: 8px 10px; border-radius: 8px; background: #FFFBEB; color: #B45309; font-size: 13px; }
.chp-runpop__err { margin: 0; font-size: 13px; color: var(--a-down); }
.chp-guide { position: fixed; z-index: 1000; width: 300px; padding: 14px; border-radius: 10px; background: #1E293B; color: #F8FAFC; box-shadow: 0 12px 32px rgba(0,0,0,.25); font-size: 13px; line-height: 1.5; }
.chp-guide p { margin: 0 0 10px; }
.chp-guide__foot { display: flex; align-items: center; gap: 8px; }
.chp-guide__foot small { margin-right: auto; color: #94A3B8; }
.chp-guide .chp-btn { height: 28px; padding: 0 12px; }
.is-guide { outline: 2px solid #3B82F6 !important; outline-offset: 2px; border-radius: 6px; }
.slimwarn { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.snote--info .snote__body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.snote--warn .snote__body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.snote .linkbtn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; }
.snote .linkbtn:hover { text-decoration: underline; }

/* Cot phai */
.sbal { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 8px; background: #ECFDF5; }
.sbal span { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--a-ink); }
.sbal span .icon { width: 16px; height: 16px; color: var(--a-up); }
.sbal p { font-size: 12px; color: var(--a-muted); }
.sbal b { font-family: var(--font-body); font-size: 22px; font-weight: 700; color: var(--a-up); }
.sconn { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--a-text); }
.sconn::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--a-up); }
.sconn.is-off { align-items: flex-start; }
.sconn.is-off::before { margin-top: 4px; background: var(--a-muted, #A1A1AA); }
.sconn a { color: var(--blue); font-weight: 600; }
.ssum { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ssum div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ssum dt { font-size: 13px; color: var(--a-text); }
.ssum dd { margin: 0; font-size: 12px; font-weight: 500; color: var(--a-ink); text-align: right; }
.ssum--plain { gap: 8px; }
.ssum--plain dd { font: 600 13px/1.4 var(--font-body); }
.sout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sout__box { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 8px; }
.sout__box span { font-size: 11px; font-weight: 600; }
.sout__box b { font-family: var(--font-body); font-size: 22px; font-weight: 700; }
.sout__box small { font-size: 11px; }
.sout__box--up { background: #ECFDF5; color: var(--a-up); }
.sout__box--down { background: #FEF2F2; color: var(--a-down); }
.sout__cap { font-size: 11px; color: var(--a-text); }
.tmodal--sm { width: min(460px, calc(100vw - 24px)); }

@media (max-width: 1500px) {
  .snew__grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; }
  .snew__main, .snew__side { gap: 20px; }
  .rule { grid-template-columns: 26px 64px minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.65fr) 32px; }
  .rule--seq { grid-template-columns: 86px 64px minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.65fr) 32px; }
  .sseg--4 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; }
  .sseg--4 span { height: 36px; }
}
@media (max-width: 1100px) {
  .snew__grid { grid-template-columns: minmax(0, 1fr); }
  .snew__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .snew__side > .scard:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .snew__head .jhead__actions { justify-content: flex-end; }
  .snew__head .pill--primary { margin-left: 0; }
  .snew__side { display: flex; }
  .scard { padding: 16px 14px; }
  .acct { width: 100%; }
  .sgrid, .sgrid--3 { grid-template-columns: minmax(0, 1fr); }
  .rule { grid-template-columns: 26px 64px minmax(0, 1fr) minmax(0, 1fr) 32px; grid-template-areas: "n tf left left rm" ". op op right right"; row-gap: 8px; }
  .rsel--tf { grid-area: tf; }
  .rule > .rval { grid-area: right; }
  .rule__n, .rule > .rsel--join { grid-area: n; }
  .rule--seq { grid-template-columns: 86px 64px minmax(0, 1fr) minmax(0, 1fr) 32px; }
  .rsel--left { grid-area: left; }
  .rsel--op { grid-area: op; }
  .rsel--right { grid-area: right; }
  .rule__rm { grid-area: rm; }
  .ind { flex-wrap: wrap; }
  .ind__tags { order: 3; width: 100%; justify-content: flex-start; padding-left: 48px; }
  .ind__rm { margin-left: auto; }
  .sout__box b { font-size: 19px; }
}
@media (max-width: 520px) {
  .snew__head .jhead__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .snew__head .pill--primary { grid-column: 1 / -1; justify-content: center; }
  .snew__head .pill { justify-content: center; }
  .sswitch { align-items: flex-start; }
  .sswitch--val:has(.snews) { flex-wrap: wrap; }
  .snews { order: 3; width: 100%; }
  .snews .rsel { flex: 1; width: auto; }
}

/* ================= Trang Chi tiet chien luoc ================= */
.sdet .preview-note { margin-bottom: -4px; }
.sdet__body { display: flex; flex-direction: column; gap: 24px; }
.sdet__body[hidden], .sdet__missing[hidden] { display: none; }
.sdet__missing { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; color: var(--a-text); }
.sdet__crumbs { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sdet__crumbs ol { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.sdet__crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sdet__crumbs li:last-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-text); }
.sdet__crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 500; white-space: nowrap; }
.sdet__crumbs a:hover { text-decoration: underline; }
.sdet__crumbs .icon { width: 13px; height: 13px; flex: none; color: var(--a-muted); }
.sdet__crumbs a .icon { color: inherit; }
.sdet__close { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--a-line); border-radius: 50%; background: #FFF2F2; color: var(--a-ink) !important; }
.sdet__close:hover { background: #FEE2E2; }
.sdet__close .icon { width: 16px; height: 16px; }
.sdet__head { margin-top: -8px; }
.sdet__title { min-width: 0; }
.sdet__title h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.sdet__title h1 > span:first-child { overflow-wrap: anywhere; }
.sdstate { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font: 600 11px/1.3 var(--font-body); letter-spacing: 0; }
.sdstate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sdstate--active { background: #ECFDF5; color: var(--a-up); }
.sdstate--paused { background: #FFFBEB; color: #D97706; }
.sdstate--draft { background: var(--a-chip); color: var(--a-text); }
.sdet__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.sdet__chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--a-line); border-radius: 100px; background: #fff; font-size: 12px; font-weight: 600; color: var(--a-ink); }
.sdet__chips .icon { width: 13px; height: 13px; color: var(--blue); }
.pill--green { border-color: #16A34A; background: #16A34A; color: #fff; }
.pill--green:hover { border-color: #15803D; background: #15803D; }
.sdet__head .jhead__actions .pill { min-width: 180px; justify-content: center; font-weight: 600; }
.sdet__more { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--a-line); border-radius: 50%; background: #fff; color: var(--a-ink); }
.sdet__more:hover, .sdet__more[aria-expanded="true"] { background: var(--a-chip); }
.sdet__more .icon { width: 18px; height: 18px; }

.sdet__kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.jstat__delta.is-down .icon { color: var(--a-down); }
.jstat__delta.is-warn .icon { color: #D97706; }
.jstat__val.chg--down { color: var(--a-down); }

.sdcard { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; min-width: 0; }
.sdcard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sdcard__head h2 { font-size: 16px; font-weight: 700; }
.sdcard__head p { margin-top: 2px; font-size: 12px; color: var(--a-muted); }
.sdcard__head--line { padding-bottom: 14px; border-bottom: 1px solid var(--a-line); }

/* Bieu do cot P&L theo thang */
.pchart { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 240px auto; column-gap: 8px; row-gap: 6px; padding: 18px 0 0; }
.pchart[hidden], .pchart__stats[hidden] { display: none; }
.pchart__axis { position: relative; }
.pchart__axis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 10px; color: var(--a-muted); white-space: nowrap; }
.pchart__plot { position: relative; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; }
.pchart__zero { position: absolute; left: 0; right: 0; height: 1px; background: #9E9E9E; }
.pchart__col { position: relative; }
.pchart__col:hover { background: rgba(0, 0, 0, .025); border-radius: 4px; }
.pchart__bar { position: absolute; left: 50%; width: min(44px, 64%); transform: translateX(-50%); min-height: 2px; }
.pchart__bar.is-up { background: var(--a-up); border-radius: 3px 3px 0 0; }
.pchart__bar.is-down { background: var(--a-down); border-radius: 0 0 3px 3px; }
.pchart__val { position: absolute; left: 0; right: 0; padding: 3px 0; font-size: 10px; font-weight: 600; text-align: center; white-space: nowrap; }
.pchart__labels { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; }
.pchart__labels span { font-size: 10px; color: var(--a-muted); text-align: center; }
.pchart__empty { padding: 40px 0; text-align: center; color: var(--a-muted); }
.pchart__empty[hidden] { display: none; }
.pchart__stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 0 72px; padding-top: 14px; border-top: 1px solid var(--a-line); text-align: center; }
.pchart__stats dt { font-size: 11px; color: var(--a-muted); }
.pchart__stats dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }

/* Cau hinh + tin hieu */
.sdet__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 600px); gap: 24px; align-items: stretch; }
.sdconf__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.sdconf__col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sdconf h3 { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); }
.sdconf h3:not(:first-child) { margin-top: 6px; }
.sdlogic { font-weight: 500; letter-spacing: 0; text-transform: none; }
.sdind { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sdind__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.sdind__chip .icon { width: 13px; height: 13px; }
.sdind__chip--blue { background: #EFF6FF; color: var(--blue); }
.sdind__chip--amber { background: #FFFBEB; color: #D97706; }
.sdind__chip--orange { background: #FFF7ED; color: #EA580C; }
.sdind__chip--green { background: #ECFDF5; color: var(--a-up); }
.sdind__chip--violet { background: #F5F3FF; color: #7C3AED; }
.sdrisk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.sdrisk div { padding: 9px 12px; border-radius: 6px; background: var(--a-panel); min-width: 0; }
.sdrisk dt { font-size: 11px; color: var(--a-muted); }
.sdrisk dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; color: var(--a-ink); overflow-wrap: anywhere; }
.sdrisk dd.is-down { color: var(--a-down); }
.sdrisk dd.is-blue { color: var(--blue); }
.sdrisk dd.is-muted { color: var(--a-muted); }
.sdrules { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--a-ink); }
.sdrules li { display: flex; align-items: center; gap: 10px; }
.sdrules__ic { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px; background: #ECFDF5; color: var(--a-up); }
.sdrules__ic .icon { width: 13px; height: 13px; }
.sdrules--exit .sdrules__ic { background: #FFFBEB; color: #D97706; }
.sdempty { font-size: 12px; color: var(--a-muted); }

.sdsig { padding: 0; gap: 0; overflow: hidden; }
.sdsig .sdcard__head { padding: 14px 16px; }
.sdsig__scroll { flex: 1; overflow-x: auto; }
.sdsig__t { width: 100%; border-collapse: collapse; font-size: 13px; }
.sdsig__t th { padding: 10px 8px; background: #FAFAF8; border-bottom: 1px solid var(--a-line); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); text-align: left; white-space: nowrap; }
.sdsig__t td { padding: 11px 8px; border-bottom: 1px solid var(--a-line); }
.sdsig__t th:first-child, .sdsig__t td:first-child { padding-left: 16px; }
.sdsig__t th:last-child, .sdsig__t td:last-child { padding-right: 16px; text-align: right; }
.sg-time { width: 84px; color: var(--a-muted); font-size: 12px; white-space: nowrap; }
.sg-symbol { width: 100px; font-weight: 700; }
.sg-signal { color: var(--a-text); }
.sgbadge { display: inline-block; min-width: 100px; padding: 4px 10px; border: 1px solid #D97706; border-radius: 100px; background: #FFFBEB; color: #D97706; font-size: 11.5px; font-weight: 600; text-align: center; white-space: nowrap; }
button.sgbadge:hover { background: #FEF3C7; }
.sgbadge.is-done { border-color: var(--a-up); background: #ECFDF5; color: var(--a-up); }
.sdsig__foot { padding: 12px 16px; font-size: 12px; color: var(--a-muted); }

/* Lich su lenh */
.sdtrades__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 18px 20px 0; }
.sdtrades__head h2 { font-size: 16px; font-weight: 700; }
.sdtrades__meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--a-muted); }
.sdtrades__meta b { margin-left: 4px; font-size: 13px; color: var(--a-ink); }
.sdtrades__meta b.chg--up { color: var(--a-up); }
.fsel--accent { border-color: transparent; background: #EFF6FF; color: var(--blue); }
.fsel--accent select { color: var(--blue); font-weight: 600; }
.jt--sd { min-width: 1240px; }
.jt--sd th { white-space: nowrap; }
.d-time { width: 120px; white-space: nowrap; color: var(--a-text); }
.d-sym { width: 120px; }
.d-sym b { display: block; font-size: 13px; font-weight: 700; }
.d-sym small { font-size: 11px; color: var(--a-muted); }
.d-r { text-align: right !important; white-space: nowrap; }
.d-c { text-align: center !important; white-space: nowrap; }
.d-pnl { font-weight: 600; }
.d-rr { font-weight: 600; }
.d-sig { min-width: 180px; padding-left: 16px !important; color: var(--a-text); }
.s-muted { color: var(--a-text); }
.sdst { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--a-ink); }
.sdst::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sdst--open { color: var(--blue); }
.sdclose { display: inline-block; min-width: 80px; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; text-align: center; }
.sdclose--tp { background: #ECFDF5; color: var(--a-up); }
.sdclose--sl { background: #FEF2F2; color: var(--a-down); }
.sdclose--trailing { background: #FFFBEB; color: #D97706; }
.sdclose--manual { background: #F5F3FF; color: #7C3AED; }
.sdclose--rule { background: #EFF6FF; color: #2563EB; }
.sdclose--end { background: var(--a-chip); color: var(--a-text); }
.sdclose--be { background: #F0F9FF; color: #0369A1; }
.sdclose--time, .sdclose--weekend, .sdclose--news { background: #F5F3FF; color: #6D28D9; }
/* Backtest: nguồn dữ liệu + tiến trình */
.sdbt { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12px; color: var(--a-text); }
.sdbt .icon { flex: none; width: 14px; height: 14px; }
.sdbt.is-error { color: var(--a-down); }
.sdbt__bar { flex: 0 0 120px; height: 4px; border-radius: 4px; background: var(--a-line); overflow: hidden; }
.sdbt__bar i { display: block; height: 100%; width: 0; background: #2563EB; transition: width .2s; }
[data-run-btn].is-busy { pointer-events: none; opacity: .7; }
.pill[hidden] { display: none; }
.sfhint { display: block; margin-top: 4px; font-size: 11px; color: var(--a-muted); }
.sfhint[hidden] { display: none; }
.pager__gap { display: grid; place-items: center; width: 20px; color: var(--a-muted); }

@media (max-width: 1500px) {
  .sdet__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sdet__grid { grid-template-columns: minmax(0, 1fr) minmax(340px, 480px); }
  .sdconf__cols { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 1100px) {
  .sdet__grid { grid-template-columns: 1fr; }
  .sdconf__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .sdet__head .jhead__actions .pill { min-width: 0; }
}
@media (max-width: 900px) {
  .sdet__body { gap: 16px; }
  .sdet__head { margin-top: -4px; }
  .sdet__head .jhead__actions { width: 100%; }
  .sdet__head .jhead__actions .pill { flex: 1; margin: 0; padding-left: 12px; padding-right: 12px; }
  .sdet__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sdet__kpis .jstat:last-child { grid-column: auto; }
  .sdcard { padding: 16px 14px; }
  .sdcard__head .tabs { width: 100%; }
  .sdcard__head .tab { flex: 1; }
  .pchart { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 4px; }
  .pchart__plot, .pchart__labels { gap: 2px; }
  .pchart__val { font-size: 8.5px; }
  .pchart__labels span { font-size: 9px; }
  .pchart__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; text-align: left; }
  .sdconf__cols { grid-template-columns: 1fr; gap: 16px; }
  .sdsig .sdcard__head { padding: 14px; }
  .sdtrades__head { padding: 14px 12px 0; }
  .jt--sd { min-width: 0; }
  .jt--sd td.d-time { grid-column: 1 / -1; grid-row: 1; justify-content: flex-start; color: var(--a-muted); font-size: 12px; }
  .jt--sd td.d-time::before { content: none; }
  .jt--sd td.d-sym { grid-column: 1; grid-row: 2; display: block; }
  .jt--sd td.d-sym::before { content: none; }
  .jt--sd td.d-sym b, .jt--sd td.d-sym small { display: inline; margin-right: 6px; }
  .jt--sd td.d-sym + td { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .jt--sd td.d-sym + td::before { content: none; }
  .jt--sd td.d-sig { grid-column: 1 / -1; min-width: 0; }
  .d-c, .d-r { text-align: left !important; }
}
@media (max-width: 520px) {
  .sdet__kpis .jstat__val { font-size: 20px; }
  .pchart__val { display: none; }
  .sdsig__t .sg-signal { min-width: 140px; }
  .sdet__head .jhead__actions .pill span { white-space: nowrap; }
}
@media (max-width: 600px) {
  .sdsig__t thead { display: none; }
  .sdsig__t, .sdsig__t tbody { display: block; }
  .sdsig__t tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--a-line); }
  .sdsig__t td { padding: 0 !important; border: 0; }
  .sdsig__t .sg-time { width: auto; }
  .sdsig__t .sg-symbol { width: auto; }
  .sdsig__t .sg-status { grid-row: 1 / 3; grid-column: 3; }
  .sdsig__t .sg-signal { grid-column: 1 / 3; font-size: 12.5px; }
  .sgbadge { min-width: 0; }
}

/* ================= Tien ich (thanh tren): menu + cua so noi ================= */
button.tool { padding: 0; border: 0; cursor: pointer; }
button.tool:hover, button.tool[aria-expanded="true"] { background: #EFF6FF; color: var(--blue); }
.utilmenu { position: relative; }
.utilmenu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1000; display: grid; width: 240px; padding: 6px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(26, 26, 26, .12);
}
.utilmenu__panel[hidden] { display: none; }
.utilmenu__head { padding: 8px 10px 6px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); }
.utilmenu__panel button, .utilmenu__panel a {
  display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 8px; background: none;
  font-size: 13px; color: var(--a-ink); text-align: left; text-decoration: none;
}
.utilmenu__panel button .icon, .utilmenu__panel a .icon { width: 15px; height: 15px; color: var(--a-text); }
.utilmenu__panel button:hover, .utilmenu__panel button:focus-visible, .utilmenu__panel a:hover, .utilmenu__panel a:focus-visible { background: var(--a-chip); outline: none; }

.uwidget {
  position: fixed; z-index: 50; display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 16px; box-shadow: 0 20px 48px rgba(26, 26, 26, .16);
  cursor: grab; touch-action: none; user-select: none;
}
.uwidget[hidden] { display: none; }
.uwidget.is-dragging { cursor: grabbing; box-shadow: 0 28px 60px rgba(26, 26, 26, .22); }
.uwidget input, .uwidget textarea, .uwidget button, .uwidget select { cursor: auto; user-select: text; touch-action: auto; }
.uwidget button { cursor: pointer; }
.uwidget__close {
  position: absolute; top: -10px; right: -10px; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--a-line); border-radius: 50%; background: #fff; color: var(--a-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.uwidget__close .icon { width: 13px; height: 13px; }
.uwidget__close:hover { background: #FEF2F2; color: var(--a-down); }
.uwidget__head { display: flex; align-items: center; gap: 10px; }
.uwidget__head h2 { font-size: 14px; font-weight: 700; }
.uwidget__ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #EFF6FF; color: var(--blue); }
.uwidget__ic .icon { width: 15px; height: 15px; }

/* May tinh */
.uwidget--calc { width: 227px; }
.calc__screen {
  display: block; height: 52px; padding: 0 14px; border-radius: 8px; background: #EFF6FF; overflow: hidden;
  font-size: 24px; font-weight: 600; line-height: 52px; color: var(--blue); text-align: right; white-space: nowrap;
}
.calc__screen.is-long { font-size: 16px; }
.calc__keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.calc__key {
  height: 40px; padding: 0; border: 0; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--a-line) inset;
  font: 500 13px/1 var(--font-body); color: var(--a-ink);
}
.calc__key:hover { background: var(--a-panel); }
.calc__key:active { transform: translateY(1px); }
.calc__key--fn { color: var(--a-text); }
.calc__key[data-key="clear"] { color: #D97706; }
.calc__key--op { color: var(--blue); font-size: 15px; }
.calc__key--op.is-on { background: #EFF6FF; box-shadow: 0 0 0 1px #BFDBFE inset; }
.calc__key--zero { grid-column: span 2; }
.calc__key--eq { background: var(--blue); box-shadow: none; color: #fff; font-size: 15px; }
.calc__key--eq:hover { background: #1D4ED8; }

/* Tinh lot size */
.uwidget--lot { width: 300px; padding: 16px; }
.lotcalc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lotf { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 11px; color: var(--a-muted); }
.lotf--full { grid-column: 1 / -1; }
.lotf input, .lotf select {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: var(--a-panel);
  font: 600 13px/1 var(--font-body); color: var(--a-ink); text-align: right;
}
.lotf input:focus { outline: none; border-color: var(--blue); background: #fff; }
.lotf .dd-btn { height: 38px; border-color: transparent; background: var(--a-panel); font-size: 12px; }
.lotf.tf--select > .icon { position: absolute; right: 12px; bottom: 12px; width: 14px; height: 14px; color: var(--a-muted); pointer-events: none; }
.lotcalc__out { display: grid; gap: 2px; margin-top: 4px; padding: 12px; border-radius: 8px; background: #EFF6FF; }
.lotcalc__out span { font-size: 11px; color: var(--a-text); }
.lotcalc__out b { font: 700 20px/1.25 var(--font-body); color: var(--blue); }
.lotcalc__out b.is-muted { font-size: 12px; font-weight: 500; color: var(--a-muted); }

/* Ghi chu nhanh (giay note) */
.uwidget--note { width: 248px; gap: 6px; padding: 18px 18px 12px; border: 0; border-radius: 4px 4px 4px 14px; background: #FEF3A0; box-shadow: 0 14px 30px rgba(120, 100, 0, .22); }
.note__title, .note__body {
  width: 100%; padding: 0; border: 0; background: none; color: #3D3A2A; font-family: "Patrick Hand", "Comic Sans MS", cursive;
}
.note__title { font-size: 24px; font-weight: 400; line-height: 1.2; }
.note__body { min-height: 110px; font-size: 18px; line-height: 1.35; resize: vertical; }
.note__title:focus, .note__body:focus { outline: none; }
.note__title::placeholder, .note__body::placeholder { color: rgba(61, 58, 42, .45); }
.note__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 16px/1 "Patrick Hand", cursive; color: rgba(61, 58, 42, .6); }
.note__foot button { padding: 2px 0; border: 0; background: none; font: inherit; font-size: 14px; color: rgba(61, 58, 42, .6); text-decoration: underline; }
.note__foot button:hover { color: #B91C1C; }
.uwidget--note .uwidget__close { background: #FFFBE0; }

/* Man hep: cua so nam co dinh phia tren thanh duoi, khong keo */
.uwidget.is-docked { left: 50% !important; top: auto !important; bottom: 78px; transform: translateX(-50%); max-width: calc(100vw - 32px); cursor: default; }

/* ================= Cai dat ================= */
.setx .preview-note { margin-bottom: -4px; }
.setx__offline { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; background: #EFF6FF; color: var(--blue); font-size: 13px; }
.setx__offline[hidden] { display: none; }
.setx__offline .icon { width: 15px; height: 15px; flex: none; }
.setx__grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.setx__main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.setnav { position: sticky; top: 88px; padding: 14px 10px; background: #fff; border: 1px solid var(--a-line); border-radius: 12px; }
.setnav ul { display: grid; gap: 2px; margin: 0 0 6px; padding: 0; list-style: none; }
.setnav__group { padding: 10px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); }
.setnav__item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--a-ink); }
.setnav__item .icon { width: 17px; height: 17px; flex: none; color: var(--a-text); }
.setnav__item:hover { background: var(--a-panel); }
.setnav__item.is-active { background: #EFF6FF; color: var(--blue); font-weight: 600; }
.setnav__item.is-active .icon { color: var(--blue); }

.setcard { display: flex; flex-direction: column; gap: 18px; padding: 24px; background: #fff; border: 1px solid var(--a-line); border-radius: 12px; min-width: 0; }
.setcard__head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 16px; font-weight: 700; }
.setcard__head p { margin-top: 3px; font-size: 13px; color: var(--a-text); }
.setcard__foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--a-line); }
.setcard__foot--split { justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--a-text); }
.setcard__foot--split a:hover { color: var(--blue); text-decoration: underline; }
.setcard__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.setcard--flush { padding: 24px 0 0; gap: 14px; }
.setcard--flush .setcard__bar { padding: 0 24px; }
.setgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setgrid__full { grid-column: 1 / -1; }
.setx .tf > span { font-size: 12px; font-weight: 600; color: var(--a-text); }
.setx .tf textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 20px; }
.setx .tf input::placeholder, .setx .tf textarea::placeholder { color: var(--a-muted); }
.setx .tf input[readonly] { background: var(--a-panel); color: var(--a-text); }
.setx .tf .shint { font-size: 11px; color: var(--a-muted); }

/* Ho so */
.setavatar { display: flex; align-items: center; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--a-line); flex-wrap: wrap; }
.setavatar__pic { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--blue) center / cover no-repeat; color: #fff; font: 700 24px/1 var(--font-body); }
.setavatar__pic.has-photo span { visibility: hidden; }
.setavatar__who { flex: 1; min-width: 180px; }
.setavatar__who b { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.setavatar__who p { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--a-text); }
.setavatar__actions { display: flex; gap: 10px; }
.setavatar__actions label { cursor: pointer; }
.setavatar__actions label:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.setavatar__actions [hidden] { display: none; }
.setplan { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; background: #EFF6FF; color: var(--blue); font-size: 11px; font-weight: 600; }
.setplan .icon { width: 12px; height: 12px; }
.uavatar.has-photo { color: transparent; background-size: cover; background-position: center; }
.settiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settiles > div { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 8px; background: var(--a-panel); min-width: 0; }
.settiles span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--a-text); }
.settiles span .icon { width: 14px; height: 14px; }
.settiles b { font-size: 17px; font-weight: 700; color: var(--a-ink); }
.settiles small { font-size: 11.5px; color: var(--a-muted); }

/* Bao mat */
.setnote { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--a-panel); font-size: 12.5px; line-height: 1.5; color: var(--a-text); }
.setnote[hidden] { display: none; }
.setnote .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--blue); }
.setpw { position: relative; display: block; }
.setx .tf .setpw input { padding-right: 44px; }
.setpw__eye { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-muted); transform: translateY(-50%); }
.setpw__eye:hover, .setpw__eye.is-on { color: var(--blue); }
.setpw__eye .icon { width: 16px; height: 16px; }
.setstrength { display: grid; gap: 10px; }
.setstrength p { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--a-text); }
.setstrength p b.is-1 { color: var(--a-down); }
.setstrength p b.is-2 { color: #D97706; }
.setstrength p b.is-3, .setstrength p b.is-4 { color: var(--a-up); }
.setstrength__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.setstrength__bars i { height: 5px; border-radius: 3px; background: var(--a-chip); }
.setstrength__bars i.is-1 { background: var(--a-down); }
.setstrength__bars i.is-2 { background: #D97706; }
.setstrength__bars i.is-3, .setstrength__bars i.is-4 { background: var(--a-up); }
.setrules { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--a-muted); }
.setrules li { display: flex; align-items: center; gap: 6px; }
.setrules .icon { width: 13px; height: 13px; color: var(--a-line); }
.setrules li.is-ok { color: var(--a-text); }
.setrules li.is-ok .icon { color: var(--a-up); }
.setrows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.setrows > li, .setrows__row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--a-line); }
.setrows > li:first-child, .setrows__row { padding-top: 0; }
.setrows > li:last-child, .setrows__row:last-child { padding-bottom: 0; border-bottom: 0; }
.setrows > li > div, .setrows__row > div { flex: 1; min-width: 0; }
.setrows b { display: block; font-size: 14px; font-weight: 600; }
.setrows small { display: block; margin-top: 2px; font-size: 12px; color: var(--a-muted); overflow-wrap: anywhere; }
.setrows small.is-linked { color: var(--a-up); }
.setrows__ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--a-panel); color: var(--a-text); }
.setrows__ic .icon { width: 18px; height: 18px; }
.setrows__ic--fb { color: #1877F2; }
.setsoon { flex: none; padding: 3px 9px; border-radius: 100px; background: var(--a-chip); font-size: 11px; font-weight: 600; color: var(--a-text); white-space: nowrap; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.setbadge { display: inline-flex; align-items: center; flex: none; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.setbadge--green { background: #ECFDF5; color: var(--a-up); }
.setbadge--blue { background: #EFF6FF; color: var(--blue); }
.setbadge--red { background: #FEF2F2; color: var(--a-down); }
.setdanger { border-color: transparent; background: #FEF2F2; color: var(--a-down); }
.setdanger:hover { border-color: #FECACA; }

/* Lien ket */
.seticon { position: relative; display: block; }
.seticon > .icon { position: absolute; top: 50%; left: 12px; width: 15px; height: 15px; color: var(--a-muted); transform: translateY(-50%); pointer-events: none; }
.setx .tf .seticon input { padding-left: 36px; }

/* Thong bao */
.setmatrix__scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.setmatrix { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.setmatrix thead th { padding: 10px 16px; background: var(--a-panel); font-size: 11.5px; font-weight: 600; color: var(--a-muted); text-align: center; }
.setmatrix thead th:first-child { text-align: left; border-radius: 6px 0 0 6px; }
.setmatrix thead th:last-child { border-radius: 0 6px 6px 0; }
.setmatrix tbody th { padding: 18px 16px; font-weight: 500; text-align: left; }
.setmatrix tbody td { width: 128px; text-align: center; }
.setmatrix tbody tr + tr { border-top: 1px solid var(--a-line); }
.setmatrix .switch { vertical-align: middle; }

/* Goi dich vu */
.setplanhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--a-line); }
.setplanhead__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.setplans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.setplan-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--a-line); border-radius: 12px; background: var(--a-panel); }
.setplan-card.is-current { border-color: var(--blue); background: #EFF6FF; }
.setplan-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setplan-card h3 { font-size: 15px; font-weight: 700; }
.setplan-card__pop { font-size: 11px; font-weight: 700; color: var(--blue); }
.setplan-card__price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.setplan-card__price b { font-size: 24px; font-weight: 700; }
.setplan-card__price span { font-size: 12px; color: var(--a-muted); }
.setplan-card ul { display: grid; gap: 8px; flex: 1; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--a-text); }
.setplan-card li { display: flex; gap: 8px; }
.setplan-card li .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--a-up); }
.setplan-card .pill { justify-content: center; width: 100%; background: #fff; }
.setplan-card .pill--primary { background: var(--blue); cursor: default; }
.setcode { display: grid; place-items: center; flex: none; min-width: 44px; height: 32px; padding: 0 8px; border-radius: 6px; background: var(--a-chip); font-size: 11px; font-weight: 700; color: var(--a-text); }
.sethist__scroll { overflow-x: auto; }
.sethist { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13.5px; }
.sethist th { padding: 12px 24px; background: #FAFAF8; border-top: 1px solid var(--a-line); border-bottom: 1px solid var(--a-line); font-size: 12px; font-weight: 600; color: var(--a-muted); text-align: left; white-space: nowrap; }
.sethist td { padding: 18px 24px; border-bottom: 1px solid var(--a-line); }
.sethist tr:last-child td { border-bottom: 0; }
.sethist .h-date { color: var(--a-text); white-space: nowrap; }
.sethist .h-amount { text-align: right; font-weight: 600; white-space: nowrap; }
.sethist .h-status, .sethist .h-invoice { text-align: center; }
.sethist__dl { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-text); }
.sethist__dl:hover { background: var(--a-chip); color: var(--blue); }
.sethist__dl .icon { width: 16px; height: 16px; }

/* Ngon ngu */
.setlangs { display: flex; flex-direction: column; }
.setlang { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--a-line); cursor: pointer; }
.setlang:last-child { border-bottom: 0; padding-bottom: 0; }
.setlang:first-child { padding-top: 0; }
.setlang input { position: absolute; opacity: 0; pointer-events: none; }
.setlang__code { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--a-panel); font-size: 12px; font-weight: 700; color: var(--a-text); }
.setlang__name { flex: 1; min-width: 0; }
.setlang__name b { display: block; font-size: 14px; font-weight: 600; }
.setlang__name small { font-size: 12px; color: var(--a-muted); }
.setlang__radio { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--a-line); border-radius: 50%; color: transparent; }
.setlang__radio .icon { width: 13px; height: 13px; stroke-width: 3; }
.setlang input:checked ~ .setlang__radio { border-color: var(--blue); background: var(--blue); color: #fff; }
.setlang input:checked ~ .setlang__code { background: #EFF6FF; color: var(--blue); }
.setlang input:focus-visible ~ .setlang__radio { outline: 2px solid var(--blue); outline-offset: 2px; }
.setlang.is-soon { cursor: default; }
.setlang.is-soon .setlang__name, .setlang.is-soon .setlang__code { opacity: .55; }
.setlang:not(.is-soon):hover .setlang__radio { border-color: var(--blue); }
.setpreview { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 8px; background: var(--a-panel); font-size: 13px; color: var(--a-text); }
.setpreview .icon { width: 15px; height: 15px; flex: none; }

/* Ket noi nen tang (thiet ke UI_Pendev/cai-dat-ket-noi-nen-tang.html); moi tai khoan mot card */
.setconn { gap: 12px; }
.setconn > li, .setconn > li:first-child, .setconn > li:last-child { flex-wrap: wrap; padding: 16px 18px; border: 1px solid var(--a-line); border-radius: 10px; background: #fff; }
.setconn > li:hover { border-color: #D4D4D8; }
.setconn .setcode { width: 44px; height: 44px; background: #F5F4F1; color: #6B6B6B; }
.setconn__bal { flex: none !important; width: 150px; text-align: right; }
/* EA cũ: nhắc cập nhật ngay dưới tên kết nối */
.setconn .setconn__upd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 12px; color: #B45309; }
.setconn__upd .icon { width: 13px; height: 13px; }
.setconn__cm { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #6B6B6B; white-space: nowrap; }
.setconn__cm input { width: 76px; padding: 4px 8px; border: 1px solid var(--a-line); border-radius: 6px; font: inherit; font-family: var(--font-mono); text-align: right; color: #1A1A1A; background: #fff; }
.setconn__cm input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.setconn__cm input[aria-invalid=true] { border-color: var(--a-down); }
.setconn__cm select { padding: 4px 6px; border: 1px solid var(--a-line); border-radius: 6px; font: inherit; color: #1A1A1A; background: #fff; }
.setconn__upd button { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: underline; }
.eaupd__steps { margin: 0 0 16px; padding-left: 20px; list-style: decimal; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--a-ink); }
.eaupd__dl { margin-bottom: 14px; }
.setconn__bal b { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.setconn__bal small { font-size: 11px; color: #9E9E9E; }
.setconn .setbadge { justify-content: center; width: 104px; margin: 0 23px; padding: 4px 10px; font-weight: 700; }
.setconn .setbadge--amber { background: #FFFBEB; color: #D97706; }
.setconn .pill { gap: 8px; padding: 10px 18px; border: 0; background: #F5F4F1; font-size: 14px; font-weight: 600; color: #1A1A1A; }
.setconn .pill .icon { width: 16px; height: 16px; }
.setconn .setconn__off { background: #FEF2F2; box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .2); }
.setconn .setconn__off:hover { background: #FEE2E2; }
.setconn__off .icon { color: var(--a-down); }
.setconn .is-spinning .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.setplatforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
/* Nen tang da co luong ket noi: nen vang, logo mau thuong hieu; chua co: xam, nut disabled */
.setplatform { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 10px; background: #FFF8B9; min-width: 0; }
.setplatform > div { flex: 1; min-width: 0; }
.setplatform b { display: block; font-size: 14px; font-weight: 600; color: #202124; }
.setplatform small { font-size: 11px; color: rgba(32, 33, 36, .7); }
.setplatform .setcode { width: 40px; min-width: 40px; height: 40px; padding: 0; border-radius: 6px; background: var(--pf-bg, #fff); color: var(--pf-ink, #202124); font-size: 13px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.setplatform .pill { flex: none; gap: 8px; padding: 10px 16px; border: 0; background: #fff; font-size: 14px; font-weight: 600; color: #202124; }
.setplatform.is-soon { background: #F0F0F2; box-shadow: inset 0 0 0 1px #E4E4E7; }
.setplatform.is-soon b, .setplatform.is-soon .setcode { color: #71717A; }
.setplatform.is-soon small { color: #A1A1AA; }
.setplatform.is-soon .setcode { background: #E4E4E7; }
.setplatform.is-soon .pill { background: #E4E4E7; color: #71717A; cursor: not-allowed; }
.setalert--safety p { white-space: pre-line; font-size: 12px; }
.setalert--safety b { font-size: 13px; font-weight: 700; }
.setalert { display: flex; gap: 12px; padding: 16px 18px; border-radius: 10px; background: #EFF6FF; color: var(--blue); }
.setalert > .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.setalert b { font-size: 13.5px; font-weight: 600; }
.setalert p { margin-top: 4px; font-size: 12.5px; line-height: 1.5; }
.tmodal [data-mt5-only][hidden] { display: none; }

@media (max-width: 1240px) {
  .setx__grid { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .setplans, .setplatforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .setx__grid { grid-template-columns: 1fr; gap: 14px; }
  .setnav { position: static; display: flex; gap: 6px; padding: 6px; overflow-x: auto; scrollbar-width: none; }
  .setnav ul { display: flex; margin: 0; }
  .setnav__group { display: none; }
  .setnav__item { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .setcard { padding: 18px 16px; }
  .setcard--flush { padding: 18px 0 0; }
  .setcard--flush .setcard__bar { padding: 0 16px; }
  .settiles { grid-template-columns: 1fr; }
  .setplans, .setplatforms { grid-template-columns: 1fr; }
  .sethist th, .sethist td { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 600px) {
  .setgrid { grid-template-columns: 1fr; }
  .setavatar { gap: 14px; }
  .setavatar__actions { width: 100%; }
  .setconn__bal { order: 5; flex-basis: 100% !important; display: flex; align-items: baseline; gap: 8px; padding-left: 58px; text-align: left; }
  .setconn > li, .setconn > li:first-child, .setconn > li:last-child { row-gap: 10px; padding: 14px; }
  .setconn .pill { order: 6; }
  .setconn .setbadge { order: 4; width: auto; margin: 0; }
  .setconn__bal { width: auto; }
  .setrules { flex-direction: column; }
}

/* ================= Popup trang Tao chien luoc: icon, thong so chi bao, mau nen, ghep mau ================= */
.tmodal--md { width: min(560px, calc(100vw - 24px)); }
.tmodal--lg { width: min(640px, calc(100vw - 24px)); }
.tmodal--xl { width: min(1000px, calc(100vw - 24px)); }
.tform__foot--split { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.tform__foot--split > div { display: flex; gap: 10px; margin-left: auto; }
.pill--danger { border-color: #FCA5A5; color: var(--a-down); }
.pill--danger:hover { background: #FEF2F2; border-color: var(--a-down); }
.pill--violet { border-color: #A78BFA; color: #7C3AED; }
.pill--violet:hover { background: #F5F3FF; }
.pill--violet-solid { border-color: #7C3AED; background: #7C3AED; color: #fff; }
.pill--violet-solid:hover { background: #6D28D9; border-color: #6D28D9; }

/* Nut doi icon o the Thong tin co ban */

/* Tim kiem + chip loc trong popup */
.pfind { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 8px; color: var(--a-muted); }
.pfind .icon { width: 15px; height: 15px; flex: none; }
.pfind input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--a-ink); }
.pfind:focus-within { border-color: var(--blue); color: var(--blue); }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchips label { position: relative; }
.pchips input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pchips span { display: block; padding: 6px 12px; border-radius: 100px; background: var(--a-chip); font-size: 12px; font-weight: 500; color: var(--a-text); white-space: nowrap; }
.pchips input:checked + span { background: #EFF6FF; color: var(--blue); font-weight: 600; }
.pchips input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.pselw { position: relative; min-width: 0; }
.pdef__link { padding: 0 0 0 4px; border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pdef__link:hover { color: #1D4ED8; }
.pdef { position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 5; display: flex; flex-direction: column; gap: 10px; width: min(440px, calc(100vw - 48px)); max-height: min(440px, 60vh); overflow-y: auto; padding: 14px 16px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 8px 24px rgba(0,0,0,.12); border: 1px solid var(--a-line); font-size: 13px; line-height: 1.5; color: #1F2937; }
.pdef[hidden] { display: none; }
.pdef__name { font-size: 15px; color: #111827; }
.pdef__sec h4 { margin: 0 0 3px; font-size: 12px; font-weight: 600; color: #1E3A8A; }
.pdef__sec p { margin: 0; }
.pdef__sec ul { margin: 0; padding-left: 18px; list-style: disc; }
.pdef__sec li + li { margin-top: 2px; }
.pdef small { font-size: 12px; color: var(--a-muted); }
.psel { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--a-muted); }
.psel__chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 100px; background: #EFF6FF; color: var(--blue); font-size: 12px; font-weight: 600; min-width: 0; }
.psel__chip .icon { width: 13px; height: 13px; flex: none; }
.psel__chip .cnd { height: 18px; }

/* Chon icon */

/* Danh sach chi bao: nut sua */
.ind__edit { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: var(--a-chip); color: var(--a-text); }
.ind__edit .icon { width: 14px; height: 14px; }
.ind__edit:hover { background: #EFF6FF; color: var(--blue); }

/* Chinh thong so chi bao */
.tform__head--tabs { flex-wrap: wrap; padding-bottom: 0; }
.tform__head--tabs > div:first-child { flex: 1; }
.itabs { display: flex; gap: 22px; width: 100%; margin-top: 4px; }
.itabs[hidden] { display: none; }
.tform__head--tabs:has(.itabs[hidden]) { padding-bottom: 20px; }
.itabs button { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 13px; color: var(--a-text); }
.itabs button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--blue); font-weight: 600; }
.ipanel { display: flex; flex-direction: column; gap: 16px; }
.ipanel[hidden] { display: none; }
.ipanel [hidden] { display: none !important; }
.itype { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--a-line); border-radius: 6px; }
.itype .ind__ic { width: 28px; height: 28px; }
.itype .ind__ic .icon { width: 15px; height: 15px; }
.itype b { display: block; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.itype small { font-size: 11px; color: var(--a-muted); }
.cstep__box { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 4px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; }
.cstep__box button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: var(--a-chip); color: var(--a-text); }
.cstep__box button:hover { background: #EFF6FF; color: var(--blue); }
.cstep__box button .icon { width: 13px; height: 13px; }
.cstep__box input { width: 40px; height: 28px; padding: 0; border: 0; background: none; font: 600 14px/1 var(--font-mono); text-align: center; color: var(--a-ink); }
.cstep__box input:focus { outline: none; }
.cstep__box:focus-within { border-color: var(--blue); }
.cstep__box--wide { display: flex; width: 100%; height: 42px; }
.cstep__box--wide input { flex: 1; width: auto; }
.tf .cstep__box input { height: 28px; border: 0; box-shadow: none; }
.icheck { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--a-ink); cursor: pointer; }
.icheck input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.iuse { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--a-line); }
.iuse__label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); }
.iuse__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.iuse__chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--a-line); border-radius: 100px; background: #fff; font-size: 13px; font-weight: 500; color: var(--a-text); }
.iuse__chip .icon { width: 14px; height: 14px; }
.iuse__chip:disabled { opacity: .5; cursor: not-allowed; }
.iuse__chip--entry[aria-pressed="true"] { border-color: transparent; background: #ECFDF5; color: var(--a-up); }
.iuse__chip--exit[aria-pressed="true"] { border-color: transparent; background: #FFFBEB; color: #D97706; }
.iuse__chip--none[aria-pressed="true"] { border-color: var(--a-text); color: var(--a-ink); }
.iswatch { display: flex; gap: 10px; }
.iswatch label { position: relative; }
.iswatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.iswatch i { display: block; width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--a-line); }
.iswatch input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.iswatch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 5px; }
.sseg--sm label { min-width: 0; }

/* Nen mini */
.cnd { display: block; flex: none; width: auto; height: 28px; max-width: 100%; }

/* O dieu kien "Mau hinh nen": nut mo bang chon */
.rsel--pat { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 32px 0 10px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; font-size: 13px; color: var(--a-ink); text-align: left; }
.rsel--pat:hover { border-color: #C7D2FE; }
.rsel--pat:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.rsel__cnd { height: 22px; flex: none; }
.cflip.rsel__cnd .cnd { height: 22px; }
.rsel__txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chon mau hinh nen */
.pfilters { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.pcount { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--a-text); }
.pcount .sseg { width: auto; }
.pcount .sseg span { padding: 0 12px; }
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pitem { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--a-line); border-radius: 8px; background: #fff; cursor: pointer; min-width: 0; }
.pitem input, .psetup input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pitem:hover, .psetup:hover { border-color: #C7D2FE; }
.pitem:has(input:checked) { border-color: var(--blue); background: #EFF6FF; }
.pitem:has(input:focus-visible), .psetup:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.pitem__cnd { display: grid; place-items: center; flex: none; width: 60px; height: 40px; padding: 5px; border-radius: 6px; background: #F7F6EE; }
.pitem__cnd .cnd { height: 28px; }
.pitem__cnd--wide { width: auto; min-width: 60px; padding: 5px 10px; }
/* Mẫu 2 chiều (hướng Cả hai): 2 ảnh chồng nhau, đổi qua lại */
.cflip { display: inline-grid; place-items: center; }
.cflip > * { grid-area: 1 / 1; }
.cflip > * + *, .is-flip-b .cflip > :first-child { visibility: hidden; }
.is-flip-b .cflip > * + * { visibility: visible; }
.cflip--txt { place-items: center start; min-width: 0; }
.cflip--img { display: inline-grid; place-items: center; }
.rsel__cnd.cflip--img .cnd { height: 22px; }
.pdir i { font-style: normal; }
.pitem__pair .pdir { color: var(--a-text); }
.pitem__pair .pdir--bull i { color: var(--a-up); }
.pitem__pair .pdir--bear i { color: var(--a-down); }
.pitem__txt { display: grid; gap: 2px; min-width: 0; }
.pitem__txt b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem__pair { font-size: 11px; line-height: 1.35; color: var(--a-muted); }
.pitem__txt b:has(+ .pitem__pair) { white-space: normal; line-height: 1.3; }
.ppair { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--a-panel); font-size: 12.5px; line-height: 1.45; color: var(--a-text); }
.ppair[hidden] { display: none; }
/* Mô hình giá */
.chs { display: block; width: 100%; height: 100%; overflow: visible; }
.cpcard__img .chs { width: 130px; height: 60px; }
.rsel__chs .chs, .chs.rsel__chs { width: 34px; height: 22px; }
.chs__path { fill: none; stroke: #64748B; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chs__brk { fill: none; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chs__brk--bull { stroke: #16A34A; }
.chs__brk--bear { stroke: #DC2626; }
.chs__lab { font: 600 11px/1 var(--font, sans-serif); fill: #7C3AED; text-anchor: middle; }
.rsel__chs .chs__lab, .chs.rsel__chs .chs__lab { display: none; }
.chs__line { fill: none; stroke: #94A3B8; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.cpgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cpcard { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
.cpcard__img { display: grid; place-items: center; height: 72px; padding: 8px 10px; border-radius: 6px; background: #F7F6EE; }
.cpcard__img .cflip { display: grid; place-items: center; }
.cpcard__alias { font-size: 11px; color: var(--a-muted); }
.cpsize { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; font-size: 13px; font-weight: 500; }
.cpsize .shint { flex-basis: 100%; }
.rsel__chs { width: 34px; height: 22px; flex: none; }
.rsel__chs.cflip { display: grid; place-items: stretch; }
.rsel__sz { flex: none; font-size: 11px; color: var(--a-muted); }
.spatexit { display: grid; gap: 14px; }
.spatexit[hidden] { display: none; }
.pitem__n { margin-left: auto; align-self: flex-end; font-size: 11px; color: var(--a-muted); white-space: nowrap; }
.pdir { font-size: 11px; font-weight: 500; }
.pdir--bull { color: var(--a-up); }
.pdir--bear { color: var(--a-down); }
.pdir--neutral { color: var(--a-muted); }
.psetups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.psetup { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--a-line); border-radius: 10px; background: #fff; cursor: pointer; min-width: 0; }
.psetup:has(input:checked) { border-color: #7C3AED; background: #F5F3FF; }
.psetup__pics { display: flex; align-items: center; justify-content: center; gap: 8px; }
.psetup__pics i { font-style: normal; color: var(--a-muted); }
.psetup > b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psetup__meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.psetup__meta small { font-size: 11px; color: var(--a-muted); }
.psetup__rm { position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--a-chip); color: var(--a-text); }
.psetup__rm .icon { width: 12px; height: 12px; }
.psetup__rm:hover { background: #FEF2F2; color: var(--a-down); }

/* Ghep mau nen */
.cpair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.cpair__card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--a-line); border-radius: 8px; min-width: 0; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.cpair__card:hover, .cpair__card:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.cpair__card:hover .cpair__preview { background: #EFF6FF; }
.cpair__top { display: flex; justify-content: space-between; font-size: 11px; color: var(--a-muted); }
.cpair__top b { color: var(--blue); font-weight: 600; }
.cpair__preview { display: grid; place-items: center; height: 52px; padding: 8px; border-radius: 6px; background: #F7F6EE; }
.cpair__preview .cnd { height: 34px; }
.cpair__select { position: relative; display: block; }
.cpair__select .dd-btn { width: 100%; height: 30px; padding: 0 22px 0 0; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--a-ink); text-align: left; }
.cpair__select > .icon { position: absolute; right: 0; top: 9px; width: 13px; height: 13px; color: var(--a-muted); pointer-events: none; }
.cpair__link { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--a-muted); }
.cpair__link .icon { width: 15px; height: 15px; }
.cpair__link b { padding: 3px 9px; border-radius: 100px; background: var(--a-chip); font-size: 11px; font-weight: 500; color: var(--a-text); white-space: nowrap; }
.sseg--auto { width: fit-content; max-width: 100%; }
.sseg--auto span { padding: 0 14px; font-size: 12.5px; }
.cstep { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--a-text); }
.cstep.is-off { visibility: hidden; }
.cmode { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.cmode .sseg { flex: 1 1 auto; min-width: 0; }
.cmode .cstep { flex: none; }
.tf .cmode .cstep__box input { width: 36px; flex: none; height: 28px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.cillus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cillus[hidden] { display: none; }
.cillus__card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 8px; border: 0; border-radius: 8px; background: #FAFAF4; opacity: .5; }
.cillus__card.is-on { background: #F7F6EE; opacity: 1; }
.cillus__row { display: flex; align-items: flex-end; gap: 10px; height: 28px; }
.cillus__row i { display: block; width: 6px; border-radius: 1px; background: #9E9E9E; }
.cillus__row i.is-a, .cillus__row i.is-b { background: var(--blue); }
.cillus__card:not(.is-on) .cillus__row i.is-a, .cillus__card:not(.is-on) .cillus__row i.is-b { background: #93C5FD; }
.cillus__zone { display: flex; align-items: flex-end; gap: 10px; height: 100%; padding: 0 6px; border-radius: 3px; background: #FDE7C8; }
.cillus__lab { display: flex; gap: 36px; font-size: 9px; color: var(--a-text); }
.ctol { display: grid; gap: 8px; font-size: 12px; color: var(--a-text); }
.ctol[hidden] { display: none; }
.ctol > span { font-weight: 600; }
.ctol__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctol__row input { width: 120px; height: 38px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 6px; font: 600 13px/1 var(--font-mono); color: var(--a-ink); }
.ctol__row input:focus { outline: none; border-color: var(--blue); }
.ctol__row input[aria-invalid="true"] { border-color: var(--a-down); }
.ctol__unit { padding: 9px 12px; border: 1px solid var(--a-line); border-radius: 6px; font-weight: 600; color: var(--a-ink); }
.ctol__row code { font: 11px/1.4 var(--font-mono); color: var(--a-muted); }
.ctol__draw { position: relative; height: 62px; border-radius: 8px; background: #F7F6EE; }
.ctol__band { position: absolute; left: 22%; width: 46%; height: 7px; background: #F6D9A8; }
.ctol__c { position: absolute; bottom: 4px; width: 10px; font-size: 9px; text-align: center; color: var(--a-text); }
.ctol__c::before { content: ""; position: absolute; left: 0; width: 10px; background: var(--a-down); border-radius: 1px; }
.ctol__c--a { left: 28%; }
.ctol__c--b { left: 52%; }
.ctol__draw--same_low .ctol__band { bottom: 22px; }
.ctol__draw--same_low .ctol__c::before { bottom: 24px; height: 28px; }
.ctol__draw--same_low .ctol__c--b::before { height: 22px; }
.ctol__draw--same_high .ctol__band { top: 10px; }
.ctol__draw--same_high .ctol__c::before { bottom: 18px; height: 34px; }
.ctol__draw--same_high .ctol__c--b::before { height: 32px; bottom: 20px; }
.ctol__draw--breakout .ctol__band { top: 20px; height: 2px; background: #F59E0B; width: 60%; }
.ctol__draw--breakout .ctol__c--a::before { bottom: 16px; height: 22px; }
.ctol__draw--breakout .ctol__c--b::before { bottom: 16px; height: 36px; background: var(--a-up); }
.ctol__draw em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 10px; font-style: normal; font-weight: 600; color: #D97706; }
.cchain { display: grid; gap: 8px; }
.cchain[hidden] { display: none; }
.cchain p { display: flex; justify-content: space-between; font-size: 12px; color: var(--a-muted); }
.cchain p b { color: var(--a-ink); }
.cchain__box { display: grid; place-items: center; height: 72px; padding: 14px; border-radius: 8px; background: #F7F6EE; }
.cchain__box .cnd { height: 42px; }
.cmatch { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #F5F3FF; color: #7C3AED; }
.cmatch__ic { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #7C3AED; color: #fff; }
.cmatch__ic .icon { width: 12px; height: 12px; }
.cmatch p { flex: 1; min-width: 0; margin: 0; font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmatch b { font-size: 12.5px; font-weight: 600; }
.cmatch small { font-size: 11.5px; opacity: .85; }
.cmatch em { flex: none; padding: 2px 8px; border-radius: 100px; background: #7C3AED; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 600; }
.cmatch em[hidden] { display: none; }
.cmatch.is-new { background: #EFF6FF; color: var(--blue); }
.cmatch.is-new .cmatch__ic { background: var(--blue); }
.cname__title { font-size: 13px; font-weight: 700; color: var(--a-ink); }
.seticon--end > .icon { left: auto; right: 12px; }
.snew .tf .seticon--end input, .tmodal .tf .seticon--end input { padding-left: 12px; padding-right: 36px; }
.tmodal .seticon { position: relative; display: block; }
.tmodal .seticon > .icon { position: absolute; top: 50%; width: 14px; height: 14px; color: var(--a-muted); transform: translateY(-50%); pointer-events: none; }

@media (max-width: 1000px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psetups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .pgrid, .psetups { grid-template-columns: 1fr; }
  .pfilters { align-items: flex-start; flex-direction: column; }
  .pcount { flex-wrap: wrap; }
  .pcount .sseg { max-width: 100%; overflow-x: auto; }
  .cpair { grid-template-columns: 1fr; }
  .cpair__link { flex-direction: row; justify-content: center; }
  .cpair__link .icon { transform: rotate(90deg); }
  .sseg--auto { width: 100%; }
  .sseg--auto span { padding: 0 6px; font-size: 12px; }
  .tform__foot--split > div { width: 100%; justify-content: flex-end; }
}

/* Menu nguoi dung (dau menu co avatar) + popover Thong bao */
.usermenu__who { display: flex !important; align-items: center; gap: 10px; }
.usermenu__who > span:last-child { display: grid; gap: 2px; min-width: 0; }
.uavatar--lg { flex: none; width: 40px; height: 40px; font-size: 14px; }
.usermenu__sep { margin-top: 4px; border-top: 1px solid var(--a-line) !important; border-radius: 0 0 8px 8px !important; }
.notifmenu { position: relative; }
.notifmenu__panel {
  position: absolute; top: calc(100% + 8px); right: -48px; z-index: 1000; width: min(340px, calc(100vw - 24px)); overflow: hidden;
  background: #fff; border: 1px solid var(--a-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(26, 26, 26, .12);
}
.notifmenu__panel[hidden] { display: none; }
.notifmenu__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--a-line); }
.notifmenu__head b { font-size: 14px; }
.notifmenu__head button { padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--blue); }
.notifmenu__head button:disabled { color: var(--a-muted); cursor: default; }
.notifmenu__list { margin: 0; padding: 4px 0; list-style: none; }
.notif { display: flex; gap: 12px; padding: 12px 16px; }
.notif + .notif { border-top: 1px solid #F3F2EE; }
.notif > div { flex: 1; min-width: 0; }
.notif b { font-size: 13px; font-weight: 600; }
.notif p { margin-top: 2px; font-size: 12px; color: var(--a-text); }
.notif time { flex: none; font-size: 11px; color: var(--a-muted); }
.notif.is-unread b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--blue); vertical-align: 2px; }
.notif__ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; }
.notif__ic .icon { width: 14px; height: 14px; }
.notif__ic--fill { background: #ECFDF5; color: var(--a-up); }
.notif__ic--strategy { background: #EFF6FF; color: var(--blue); }
.notif__ic--due { background: #FFFBEB; color: #D97706; }
.notifmenu__all { display: block; padding: 12px; border-top: 1px solid var(--a-line); font-size: 13px; font-weight: 600; color: var(--blue); text-align: center; }
.notifmenu__all:hover { background: #F8FAFF; }
.tool__badge[hidden] { display: none; }

/* Luon giu cho thanh cuon cua trang: loc bai (it bai -> het cuon) khong lam ca bo cuc lech ngang */
html { scrollbar-gutter: stable; }

/* Man rong (3 cot): khoi menu module tren thanh top thang mep trai / phai cua bai trong Bang tin
   (bai = cot giua toi da 632px tru 16px dem moi ben, nam giua man hinh) */
@media (min-width: 1241px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) min(100% - 724px, 600px) minmax(0, 1fr); }
  .topbar__brand { justify-self: start; }
  .topbar__tools { justify-self: end; }
  .topnav { justify-content: space-between; gap: 0; }
}
/* Khong du cho cho ca 5 nhan -> chi giu nhan cua muc dang mo */
@media (max-width: 1340px) {
  .topnav__item span { display: none; }
  .topnav__item.is-active span { display: inline; }
}

/* Bo loc cung co (Chien luoc / Danh sach): o rong bang nhau, tieu de nho can giua doc voi gia tri */
.fsel--eq { width: 184px; flex: none; }
.fsel--eq > span { flex: none; font-size: 10px; line-height: 1; }
.fsel--eq .dd-btn { flex: 1; min-width: 0; display: flex; align-items: center; line-height: 1.2; }
.fsel--eq .dd-value { overflow: hidden; text-overflow: ellipsis; }
.fsel--eq { gap: 5px; padding: 0 12px; }
/* Bo loc cung co (Nhat ky / Chien luoc), man >= 901px: hang 1 = tab + o tim kiem (ben phai), hang 2 = cac o loc chia deu ca hang. */
@media (min-width: 901px) {
  .jtoolbar:has(.fsel--eq) > .jsearch { flex: 0 1 320px; width: auto; min-width: 0; margin-left: auto; }
  .jtoolbar:has(.fsel--eq) > .jsearch input { width: 0; }
  .jtools:has(.fsel--eq) { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; gap: 8px; }
  .fsel--eq { flex: 1 1 0; width: auto; min-width: 0; padding: 0 10px; gap: 4px; }
  .fsel--eq > span { flex: 0 20 auto; min-width: 18px; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
  .fsel--eq .dd-btn { flex: 0 0 auto; max-width: calc(100% - 40px); }
  .fsel--eq > .icon { margin-left: auto; flex: none; }
}
/* O tim kiem rong ~ 3 lan mot o loc (+ 2 khoang cach), co gian khi thieu cho; man nho -> 2 hang (tim kiem cung hang tab) */
@media (min-width: 901px) {
  #journal .jtoolbar > .jsearch { flex: 0 1 520px; min-width: 200px; }    /* 3 x 168 + 16 */
  #strategies .jtoolbar > .jsearch { flex: 0 1 484px; min-width: 200px; } /* 3 x 156 + 16 */
}
/* Man du rong: tab + tim kiem + o loc (rong co dinh, bang nhau) cung mot hang */
@media (min-width: 1700px) {
  #journal .jtoolbar { flex-wrap: nowrap; }
  #journal .jtools { flex: none; }
  #journal .fsel--eq { flex: none; width: 168px; }
}
@media (min-width: 1500px) {
  #strategies .jtoolbar { flex-wrap: nowrap; }
  #strategies .jtools { flex: none; }
  #strategies .fsel--eq { flex: none; width: 156px; }
}
/* O loc cung co: chu nho hon (tieu de 9px, gia tri 12px) */
.fsel--eq { font-size: 12px; }
.fsel--eq > span { font-size: 9px; }
.fsel--eq > .icon { width: 13px; height: 13px; }
.fsel--eq.fsel--time .fsel__clear { margin-left: auto; }
.jtoolbar .tabs { flex: none; }
@media (max-width: 900px) {
  .jtoolbar > .jsearch { flex: 1 1 100%; width: 100%; }
}

/* Popup Tao / Sua nhat ky: o Loi lo tu tinh (chi doc) */
.tf__pnl { display: flex; align-items: center; height: 42px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 6px; background: var(--a-panel); font-size: 14px; font-weight: 600; color: var(--a-ink); }
.tf__pnl.is-empty { font: 400 13px/1.4 var(--font-body); color: var(--a-muted); }
.tf__pnl.chg--up { color: var(--a-up); }
.tf__pnl.chg--down { color: var(--a-down); }

/* Tao / Sua chien luoc: khung noi dung gon, de trong 2 ben nhu Bang tin */
.journal.snew { max-width: 1344px; }
.snew__grid { grid-template-columns: minmax(0, 1fr) 420px; }
@media (max-width: 1500px) { .snew__grid { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (max-width: 1100px) { .snew__grid { grid-template-columns: minmax(0, 1fr); } }

/* Chi tiet chien luoc: ban thu hep (de trong 2 ben) + nut chuyen o mep trai */
@media (min-width: 1441px) {
  .journal.sdet { padding-left: 112px; padding-right: 112px; } /* ban rong: chua le 2 ben, nut thu hep nam gon trong le trai */
  .journal.sdet.is-narrow { max-width: 1344px; padding-left: 32px; padding-right: 32px; }
  .sdet.is-narrow .sdet__grid { grid-template-columns: minmax(0, 1fr) 420px; }
}
.sdet__width { position: fixed; left: 20px; top: 88px; z-index: 20; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--a-line); border-radius: 50%; background: #fff; color: var(--a-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); cursor: pointer; }
.sdet__width:hover { background: var(--a-chip); color: var(--blue); }
.sdet__width .icon { width: 16px; height: 16px; }
.sdet__width-wide, .sdet.is-narrow .sdet__width-narrow { display: none; }
.sdet.is-narrow .sdet__width-wide { display: contents; }
.sdet__width-narrow { display: contents; }
@media (max-width: 1440px) { .sdet__width { display: none; } }

/* Chi tiet chien luoc: nut Chay Demo / Live dang chay, trang thai tin hieu che do Auto, popup Xac nhan vao lenh */
.sdet__head .pill--green.is-running { background: #ECFDF5; border-color: #A7F3D0; color: var(--a-up); cursor: default; box-shadow: none; }
.sgbadge.is-matched { border-color: transparent; background: #EFF6FF; color: var(--blue); }
.sgbadge.is-skip { border-color: transparent; background: #F5F4F1; color: #6B7280; cursor: help; }
.sdc__info { margin: 0; padding: 10px 12px; border-radius: 6px; background: #F5F4F1; font-size: 12px; line-height: 1.5; color: var(--a-text); }
.sdc__sum { min-height: 18px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--blue); }
.sdc__sum.is-up { color: var(--a-up); }
.sdc__sum.is-down { color: var(--a-down); }
.sdc__sum.is-open { font-weight: 500; color: var(--a-muted); }
.sdet__head .pill[hidden] { display: none; }
/* Nut Dong o breadcrumb: .sdet__crumbs a (inline-flex) de mat can giua -> can lai icon */
.sdet__crumbs .sdet__close { display: grid; place-items: center; gap: 0; padding: 0; }
.sdet__crumbs .sdet__close:hover { text-decoration: none; }

/* Popup Chon mau hinh nen: o tim kiem nam cung hang tieu de */
.tform__head--find { align-items: center; }
.tform__head--find > div:first-child { flex: none; }
.tform__head--find .pfind { flex: 0 1 420px; min-width: 0; margin-left: auto; }
.tform__head--find .tform__close { flex: none; }
@media (max-width: 700px) {
  .tform__head--find { flex-wrap: wrap; }
  .tform__head--find > div:first-child { flex: 1; }
  .tform__head--find .pfind { order: 3; flex: 1 1 100%; margin-left: 0; }
}

/* ---------- Menu tinh nang (nut luoi tren thanh tren) ---------- */
.fmenu { position: relative; }
.fmenu__panel {
  position: fixed; top: calc(var(--a-top) + 6px); right: 16px; z-index: 1000; display: flex; flex-direction: column;
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - var(--a-top) - 20px); max-height: calc(100dvh - var(--a-top) - 20px);
  background: #fff; border: 1px solid var(--a-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); overflow: hidden;
}
.fmenu__panel[hidden] { display: none; }
.fmenu__head { display: flex; align-items: center; gap: 12px; flex: none; padding: 18px 20px; border-bottom: 1px solid var(--a-line); }
.fmenu__ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: #EFF6FF; color: var(--blue); }
.fmenu__ic .icon { width: 22px; height: 22px; }
.fmenu__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fmenu__title b { font-size: 18px; font-weight: 700; color: var(--a-ink); }
.fmenu__title span { font-size: 13px; color: var(--a-text); }
.fmenu__find { display: flex; align-items: center; gap: 8px; flex: 0 1 310px; min-width: 0; height: 38px; margin-left: auto; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: var(--a-chip); color: var(--a-muted); }
.fmenu__find .icon { width: 15px; height: 15px; flex: none; }
.fmenu__find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--a-ink); }
.fmenu__find:focus-within { border-color: var(--blue); background: #fff; color: var(--blue); }
.fmenu__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; padding: 6px 20px 10px; overflow-y: auto; }
.fmenu__group { padding: 16px 0 10px; }
.fmenu__group:nth-child(n + 4) { border-top: 1px solid var(--a-line); }
.fmenu__group[hidden] { display: none; }
.fmenu__group h3 { margin: 0 0 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-ink); }
.fmenu__group ul { margin: 0; padding: 0; list-style: none; }
.fmenu__group li[hidden] { display: none; }
.fmenu__item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; color: var(--a-ink); text-decoration: none; }
.fmenu__item:hover, .fmenu__item:focus-visible { background: var(--a-chip); outline: none; }
.fmenu__iic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; }
.fmenu__iic .icon { width: 16px; height: 16px; }
.fmenu__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fmenu__txt b { font-size: 14px; font-weight: 500; }
.fmenu__txt small { font-size: 12px; color: var(--a-muted); }
.fmenu__group--green .fmenu__iic { background: #ECFDF5; color: #059669; }
.fmenu__group--violet .fmenu__iic { background: #F5F3FF; color: #7C3AED; }
.fmenu__group--red .fmenu__iic { background: #FEF2F2; color: #DC2626; }
.fmenu__group--blue .fmenu__iic { background: #EFF6FF; color: #2563EB; }
.fmenu__group--amber .fmenu__iic { background: #FFFBEB; color: #D97706; }
.fmenu__group--cyan .fmenu__iic { background: #ECFEFF; color: #0891B2; }
.fmenu__empty { margin: 0; padding: 28px 20px; font-size: 13px; color: var(--a-text); text-align: center; }
.fmenu__empty[hidden] { display: none; }
.fmenu__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 22px; flex: none; padding: 14px 20px; border-top: 1px solid var(--a-line); }
.fmenu__foot a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--blue); text-decoration: none; }
.fmenu__foot a:hover { text-decoration: underline; }
.fmenu__foot .icon { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .fmenu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fmenu__group:nth-child(n + 3) { border-top: 1px solid var(--a-line); }
}
@media (max-width: 600px) {
  .fmenu__panel { right: 8px; width: calc(100vw - 16px); }
  .fmenu__head { flex-wrap: wrap; padding: 14px 16px; }
  .fmenu__find { flex: 1 1 100%; margin-left: 0; }
  .fmenu__grid { grid-template-columns: minmax(0, 1fr); padding: 0 12px 6px; }
  .fmenu__group:nth-child(n + 2) { border-top: 1px solid var(--a-line); }
  .fmenu__foot { justify-content: flex-start; padding: 12px 16px; }
}

/* =================== Trang Khoa hoc =================== */
.capp { display: grid; grid-template-columns: 320px minmax(0, 1fr) 420px; grid-template-areas: "left main right"; align-items: start; max-width: 1920px; margin: 0 auto; }
.cside { grid-area: left; gap: 2px; padding: 24px 16px; border-right: 1px solid var(--a-line); }
.cright { grid-area: right; gap: 16px; padding: 20px; border-left: 1px solid var(--a-line); }
.cmain { grid-area: main; display: flex; flex-direction: column; gap: 28px; min-width: 0; padding: 28px 28px 48px; }
.cside__title { margin: 4px 0 10px; font-size: 18px; font-weight: 700; color: var(--a-ink); }
.cnav { display: flex; flex-direction: column; gap: 2px; }
.cnav__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; color: var(--a-ink); text-align: left; cursor: pointer; }
.cnav__item .icon { width: 18px; height: 18px; flex: none; color: var(--a-text); }
.cnav__item > span:not(.cnav__n) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnav__n { font-size: 12px; color: var(--a-muted); }
.cnav__item:hover { background: var(--a-chip); }
.cnav__item[aria-current="true"] { background: #EFF6FF; color: var(--blue); font-weight: 600; }
.cnav__item[aria-current="true"] .icon, .cnav__item[aria-current="true"] .cnav__n { color: var(--blue); }
.cnav__sec { margin: 10px 0 4px; padding: 10px 0 0; border-top: 1px solid var(--a-line); font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-muted); }
.cbox { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 16px; border-radius: 10px; background: var(--a-chip); }
.cbox--bottom { margin-top: auto; }
.cbox__head { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--a-ink); }
.cbox__head--split { justify-content: space-between; }
.cbox__head--split > span { display: inline-flex; align-items: center; gap: 8px; }
.cbox__head--split > span .icon { width: 16px; height: 16px; color: #D97706; }
.cbox__text { margin: 0; font-size: 12px; line-height: 1.5; color: var(--a-text); }
.cbox__streak { font-size: 13px; color: #D97706; }
.cbox__pct { font-size: 13px; color: var(--blue); }
.cbox__ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; }
.cbox__ic .icon { width: 16px; height: 16px; }
.cbox__ic--violet { background: #F5F3FF; color: #7C3AED; }
.cbox__ic--amber { background: #FFFBEB; color: #D97706; }
.cbox__ic--blue { background: #EFF6FF; color: var(--blue); }
.cstreak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cstreak i { height: 5px; border-radius: 3px; background: #E5E3DE; }
.cstreak i.is-on { background: #D97706; }
.cbar { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: #E5E3DE; }
.cbar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.cbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border: 0; border-radius: 100px; background: var(--blue); font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; cursor: pointer; }
.cbtn:hover { background: #1D4ED8; }
.cbtn:disabled { background: #ECFDF5; color: var(--a-up); cursor: default; }
.cbtn--block { width: 100%; }
.cbtn--sm { height: 32px; padding: 0 14px; font-size: 12px; }
.cbtn--ghost { border: 1px solid var(--a-line); background: #fff; color: var(--a-ink); }
.cbtn--ghost:hover { background: var(--a-chip); }
.cbtn--ghost .icon { width: 16px; height: 16px; color: #7C3AED; }
.clink { padding: 0; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--blue); white-space: nowrap; cursor: pointer; }
.clink:hover { text-decoration: underline; }

.chead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.chead__title { font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--a-ink); }
.chead__sub { margin-top: 6px; font-size: 14px; color: var(--a-text); }
.chead__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfind { display: flex; align-items: center; gap: 8px; width: 280px; height: 40px; padding: 0 14px; border: 1px solid var(--a-line); border-radius: 100px; background: #fff; color: var(--a-muted); }
.cfind .icon { width: 15px; height: 15px; flex: none; }
.cfind input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--a-ink); }
.cfind:focus-within { border-color: var(--blue); color: var(--blue); }
.cbar2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -10px; }
.cbar2 .tab { padding: 7px 14px; font-size: 13px; }
.csort { background: #fff; }
.csec { display: flex; flex-direction: column; gap: 14px; }
.csec[hidden] { display: none; }
.csec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.csec__head h2 { font-size: 19px; font-weight: 700; color: var(--a-ink); }
.csec__head p { margin-top: 2px; font-size: 13px; color: var(--a-text); }
.csec__more { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
.csec__more[hidden] { display: none; }
.csec__more .icon { width: 14px; height: 14px; }
.csec__more:hover { text-decoration: underline; }
.cgrid { display: grid; gap: 16px; }
.cgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ctag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; background: #EFF6FF; color: var(--blue); }
.ctag--cert { margin-left: auto; background: #FFFBEB; color: #D97706; }
.ctag .icon { width: 12px; height: 12px; }
.cpill { display: inline-flex; align-items: center; flex: none; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.cpill--amber { background: #FFFBEB; color: #D97706; }
.cpill--green { background: #ECFDF5; color: #059669; }

/* Tiep tuc hoc */
.cprog { display: flex; gap: 16px; padding: 14px; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; }
.cprog__pic { flex: none; width: 104px; overflow: hidden; border-radius: 10px; }
.cprog__pic .ccover { display: block; width: 100%; height: 100%; }
.cprog__body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; padding: 4px 0; }
.cprog__top { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 13px; color: var(--blue); }
.cprog h3 { font-size: 16px; font-weight: 600; }
.cprog h3 a, .ccard__title a, .cskill h3 a { color: var(--a-ink); text-decoration: none; }
.cprog h3 a:hover, .ccard__title a:hover, .cskill h3 a:hover { color: var(--blue); }
.cprog__meta { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 12.5px; color: var(--a-text); }
.cprog__meta .num { color: var(--a-muted); }

/* Thu thach & trac nghiem */
.ccard2 { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; }
.ccard2__head { display: flex; align-items: flex-start; gap: 12px; }
.ccard2__head > div { flex: 1; min-width: 0; }
.ccard2 h3 { font-size: 15px; font-weight: 600; color: var(--a-ink); }
.ccard2__head p { margin-top: 2px; font-size: 12px; color: var(--a-muted); }
.cdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cdays li { display: grid; place-items: center; height: 32px; border-radius: 100px; background: var(--a-chip); font-size: 12px; color: var(--a-muted); }
.cdays li .icon { width: 14px; height: 14px; }
.cdays li.is-done { background: #059669; color: #fff; }
.cdays li.is-today { background: #D97706; color: #fff; }
.ccard2__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; font-size: 12.5px; color: var(--a-text); }
.ccard2__foot p { display: flex; align-items: center; gap: 10px; margin: 0; }
.ccard2__foot p b { color: var(--a-ink); }
.ccard2__foot--line { padding-top: 12px; border-top: 1px solid var(--a-line); }
.ccard2__foot--line b { color: var(--a-ink); }
.cxp { font-weight: 600; color: #7C3AED; }
.cquiz { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--a-chip); }
.cquiz > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cquiz b { font-size: 13.5px; font-weight: 600; color: var(--a-ink); }
.cquiz small { font-size: 11.5px; color: var(--a-muted); }

/* The khoa hoc */
.ccard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; transition: box-shadow .15s; }
.ccard[hidden] { display: none; }
.ccard:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.ccard__pic { position: relative; aspect-ratio: 2 / 1; overflow: hidden; }
.ccover { display: block; width: 100%; height: 100%; }
.ccard__level { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 100px; background: rgba(255, 255, 255, .92); font-size: 11.5px; font-weight: 600; color: var(--a-ink); }
.ccard__rate { position: absolute; bottom: 10px; left: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; background: rgba(255, 255, 255, .92); font-size: 12px; font-weight: 600; color: var(--a-ink); }
.ccard__rate .icon { width: 13px; height: 13px; color: #F59E0B; }
.ccard__rate small { font-weight: 400; color: var(--a-muted); }
.ccard__save { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--a-text); cursor: pointer; }
.ccard__save .icon { width: 15px; height: 15px; }
.ccard__save:hover { color: var(--blue); }
.ccard__save[aria-pressed="true"] { color: var(--blue); }
.ccard__save[aria-pressed="true"] .icon { fill: currentColor; }
.ccard__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.ccard__topic { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--blue); }
.ccard__title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.ccard__meta { display: flex; gap: 16px; margin: 0; font-size: 12.5px; color: var(--a-text); }
.ccard__meta span { display: inline-flex; align-items: center; gap: 6px; }
.ccard__meta .icon { width: 14px; height: 14px; color: var(--a-muted); }
.ccard__state { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--blue); }
.ccard__state .cbar { flex: 1; max-width: 140px; }
.ccard__state.is-done { color: var(--a-up); }
.ccard__state .icon { width: 14px; height: 14px; }
.ccard__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--a-line); font-size: 12.5px; color: var(--a-text); }
.ccard__teacher { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard__price { font-size: 14px; color: var(--blue); }
.cavatar { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #EFF6FF; font-size: 10px; font-weight: 700; color: var(--blue); }
.cavatar--violet { width: 32px; height: 32px; background: #F5F3FF; color: #7C3AED; font-size: 11px; }
.cavatar--blue { width: 28px; height: 28px; background: var(--blue); color: #fff; }

/* Chu de ky nang */
.cskill { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; }
.cskill.is-flash { animation: cflash 1.6s ease; }
@keyframes cflash { 0%, 60% { box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); } 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); } }
.cskill__top { display: flex; align-items: flex-start; justify-content: space-between; margin: 0; }
.cskill__ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; }
.cskill__ic .icon { width: 20px; height: 20px; }
.cskill h3 { margin-top: 4px; font-size: 17px; font-weight: 600; }
.cskill__desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--a-text); }
.cskill__meta { display: flex; justify-content: space-between; margin: auto 0 0; font-size: 11.5px; color: var(--a-muted); }
.cskill__meta b { color: var(--a-ink); }
.cskill--red .cskill__ic { background: #FEF2F2; color: #DC2626; }
.cskill--red .cbar i { background: #DC2626; }
.cskill--blue .cskill__ic { background: #EFF6FF; color: #2563EB; }
.cskill--amber .cskill__ic { background: #FFFBEB; color: #D97706; }
.cskill--amber .cbar i { background: #D97706; }
.cskill--violet .cskill__ic { background: #F5F3FF; color: #7C3AED; }
.cskill--violet .cbar i { background: #7C3AED; }
.cskill--green .cskill__ic { background: #ECFDF5; color: #059669; }
.cskill--green .cbar i { background: #059669; }

/* Banner */
.cbanner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; padding: 32px 36px; border-radius: 16px; background: linear-gradient(100deg, #2563EB, #4F46E5); color: #fff; }
.cbanner[hidden] { display: none; }
.cbanner::before { content: ""; position: absolute; left: -60px; top: -40px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.cbanner > * { position: relative; }
.cbanner__kicker { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; opacity: .75; }
.cbanner h2 { font-size: 24px; font-weight: 700; }
.cbanner p:last-child { margin: 6px 0 0; font-size: 13.5px; opacity: .85; }
.cbanner__btn { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 42px; padding: 0 20px; border: 0; border-radius: 100px; background: #fff; font-size: 14px; font-weight: 600; color: var(--blue); cursor: pointer; }
.cbanner__btn .icon { width: 16px; height: 16px; }

/* Cot phai */
.rcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; }
.rcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rcard__head h2 { font-size: 15px; font-weight: 700; color: var(--a-ink); }
.rcard__head p { margin-top: 2px; font-size: 12px; color: var(--a-muted); }
.rcard__up { font-size: 12.5px; color: var(--a-up); }
.rcard__blue { font-size: 12.5px; color: var(--blue); }
.rboard { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rboard li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.rboard li > b { margin-left: auto; color: var(--a-ink); }
.rboard__rank { width: 16px; text-align: center; font-size: 12px; color: var(--a-muted); }
.rboard__rank--1 { color: #D97706; font-weight: 700; }
.rboard__rank--3 { color: #B45309; font-weight: 700; }
.rboard__who { display: flex; flex-direction: column; min-width: 0; }
.rboard__who b { font-weight: 600; color: var(--a-ink); }
.rboard__who small { font-size: 11px; color: var(--a-muted); }
.rcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--a-line); font-size: 12.5px; color: var(--a-text); }
.rcard__foot > span { display: inline-flex; align-items: center; gap: 8px; }
.rstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rstat { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: var(--a-chip); }
.rstat p { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 11.5px; color: var(--a-text); }
.rstat b { font-size: 21px; color: var(--a-ink); }
.rstat small { font-size: 11px; color: var(--a-muted); }
.rstat__ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.rstat__ic .icon { width: 13px; height: 13px; }
.rstat__ic--blue { color: var(--blue); }
.rstat__ic--green { color: #059669; }
.rstat__ic--violet { color: #7C3AED; }
.rstat__ic--amber { color: #D97706; }
.rbars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 130px; }
.rbars__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.rbars__col i { display: block; width: 100%; max-width: 44px; min-height: 6px; border-radius: 6px 6px 3px 3px; background: var(--blue); }
.rbars__col i.is-max { background: #7C3AED; }
.rbars__col span { font-size: 11px; color: var(--a-muted); }
.rmeter p { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 12.5px; color: var(--a-text); }
.rmeter b { color: var(--a-ink); }
.rlist { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rlist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--a-chip); }
.rlist__txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rlist__txt b { font-size: 13px; font-weight: 600; color: var(--a-ink); }
.rlist__txt small { font-size: 11.5px; color: var(--a-muted); }
.rdate { display: flex; flex-direction: column; align-items: center; flex: none; width: 42px; padding: 4px 0; border-radius: 8px; background: #EFF6FF; color: var(--blue); }
.rdate b { font-size: 16px; line-height: 1.1; }
.rdate small { font-size: 10px; }

@media (max-width: 1600px) {
  .capp { grid-template-columns: 280px minmax(0, 1fr) 360px; }
}
@media (max-width: 1380px) {
  .cgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1440px) {
  .capp { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "left main" "left right"; }
  .cright { position: static; height: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; padding: 0 28px 40px; border-left: 0; background: none; }
}
@media (max-width: 900px) {
  .capp { display: flex; flex-direction: column; }
  .capp > * { min-width: 0; max-width: 100%; }
  .cside::before { content: none; }
  .cbar2 .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .cside { position: static; height: auto; overflow: visible; padding: 16px 16px 0; border-right: 0; background: none; }
  .cside__title, .cside .cbox, .cnav__sec { display: none; }
  .cnav { flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .cnav__item { flex: none; width: auto; padding: 7px 12px; border: 1px solid var(--a-line); border-radius: 100px; background: #fff; font-size: 13px; }
  .cnav__item > span:not(.cnav__n) { flex: none; overflow: visible; }
  .cmain { padding: 20px 16px 32px; }
  .cright { display: flex; padding: 0 16px 32px; }
  .chead__tools { width: 100%; }
  .chead__tools .cfind { flex: 1; width: auto; }
}
@media (max-width: 640px) {
  .cgrid--2, .cgrid--3 { grid-template-columns: minmax(0, 1fr); }
  .cbanner { flex-direction: column; align-items: flex-start; padding: 24px; }
  .chead__title { font-size: 24px; }
}

/* Popup Canh bao chua luu (Tao / Sua chien luoc) */
.tmodal--leave { width: min(520px, calc(100vw - 24px)); }
.tform__close--sq { border-radius: 6px; }
.leavewarn { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 6px; background: #FFFBEB; }
.leavewarn > .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: #D97706; }
.leavewarn b { display: block; font-size: 13px; font-weight: 700; color: #D97706; }
.leavewarn p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--a-text); }
.leavehint { margin: 0; font-size: 11.5px; color: var(--a-muted); }
.pill--danger-ghost { border: 1px solid #DC2626; background: transparent; color: #DC2626; }
.pill--danger-ghost:hover { background: #FEF2F2; }

/* Cai dat (Ho so ca nhan...): khung noi dung gon, de trong 2 ben nhu trang Tao chien luoc */
.journal.setx { max-width: 1344px; }
/* Menu tinh nang: khoang cach dong sat thiet ke */
.fmenu__item { padding: 9px 8px; }
.fmenu__iic { width: 30px; height: 30px; }
.fmenu__txt { gap: 0; line-height: 1.3; }
.fmenu__txt small { font-size: 11.5px; }
.fmenu__group { padding: 18px 0 10px; }

img.ccover { object-fit: cover; }

/* =================== Trang Bai hoc =================== */
.lapp { display: grid; grid-template-columns: 380px minmax(0, 1fr) 420px; grid-template-areas: "left main right"; align-items: start; max-width: 1920px; margin: 0 auto; }
.ltoc { grid-area: left; gap: 0; padding: 24px 16px; border-right: 1px solid var(--a-line); }
.lright { grid-area: right; gap: 16px; padding: 20px; border-left: 1px solid var(--a-line); }
.lmain { grid-area: main; display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 22px 28px 40px; }
.ltoc__title { font-size: 16px; font-weight: 700; color: var(--a-ink); }
.ltoc__sub { margin: 2px 0 14px; font-size: 12px; color: var(--a-muted); }
.ltoc__plabel { margin: 0 0 8px; font-size: 12px; color: var(--a-text); }
.ltoc__bar { margin-bottom: 16px; }
.ltoc__list { display: flex; flex-direction: column; gap: 4px; }
.lch__head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; font-weight: 600; color: var(--a-ink); text-align: left; cursor: pointer; }
.lch__head:hover { background: var(--a-chip); }
.lch__head .icon { width: 14px; height: 14px; flex: none; color: var(--a-muted); transition: transform .15s; }
.lch__head[aria-expanded="true"] .icon { transform: rotate(90deg); }
.lch__name { flex: 1; min-width: 0; }
.lch__n { font-size: 11px; font-weight: 500; color: var(--a-muted); }
.lch.is-current .lch__head { background: #EFF6FF; color: var(--blue); }
.lch.is-current .lch__head .icon, .lch.is-current .lch__n { color: var(--blue); }
.lch__list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; padding: 0; list-style: none; }
.lch__list[hidden] { display: none; }
.lles { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 30px; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 13px; color: var(--a-ink); text-align: left; cursor: pointer; }
.lles:hover { background: var(--a-chip); }
.lles .icon { width: 16px; height: 16px; flex: none; color: var(--a-muted); }
.lles.is-done .icon { color: var(--a-up); }
.lles__name { flex: 1; min-width: 0; }
.lles__dur { font-size: 11px; color: var(--a-muted); }
.lles.is-current { border-color: var(--blue); background: #fff; color: var(--blue); font-weight: 600; }
.lles.is-current .icon, .lles.is-current .lles__dur { color: var(--blue); }
.lpractice { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding: 16px; border-radius: 12px; background: #EFF6FF; }
.lpractice__head, .lcert__head { display: flex; align-items: center; gap: 12px; margin: 0; }
.lpractice__head > span:last-child, .lcert__head > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lpractice__head b { font-size: 15px; color: var(--a-ink); }
.lpractice__head small, .lcert__head small { font-size: 12px; color: var(--a-text); }
.lpractice__ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--blue); color: #fff; }
.lpractice__ic .icon { width: 18px; height: 18px; }
.lpractice__btn { background: #7C3AED; }
.lpractice__btn:hover { background: #6D28D9; }
.lpractice__btn .icon { width: 15px; height: 15px; }
.lcert { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 16px; border-radius: 12px; background: var(--a-chip); }
.lcert__head b { font-size: 13.5px; color: var(--a-ink); }
.lcert__left { margin: 0; font-size: 11.5px; color: var(--a-muted); }

.lcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--a-muted); }
.lcrumbs a { color: var(--a-muted); text-decoration: none; }
.lcrumbs a:hover { color: var(--blue); }
.lcrumbs .icon { width: 13px; height: 13px; }
.lcrumbs span { color: var(--a-ink); font-weight: 500; }
.lvideo { position: relative; overflow: hidden; aspect-ratio: 16 / 7.2; border-radius: 14px; background: #0B1220; }
.lvideo__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.lvideo__badge { position: absolute; top: 20px; left: 20px; padding: 5px 12px; border-radius: 100px; background: rgba(15, 23, 42, .65); font-size: 12px; font-weight: 600; color: #fff; }
.lvideo__hd { position: absolute; top: 20px; right: 20px; padding: 4px 9px; border-radius: 6px; background: rgba(15, 23, 42, .65); font-size: 11px; font-weight: 600; color: #fff; }
.lvideo__play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--a-ink); transform: translate(-50%, -50%); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); cursor: pointer; }
.lvideo__play .icon { width: 30px; height: 30px; margin-left: 4px; }
.lvideo__play:hover { transform: translate(-50%, -50%) scale(1.05); }
.lvideo__bar { position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 14px; padding: 18px 20px 16px; background: linear-gradient(transparent, rgba(2, 6, 23, .85)); color: #fff; }
.lvideo__bar button { display: grid; place-items: center; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.lvideo__bar .icon { width: 18px; height: 18px; }
.lvideo__track { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.lvideo__track i { display: block; height: 100%; background: var(--blue); }
.lvideo__time { font-size: 12.5px; font-weight: 600; }
.lhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lhead__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lhead__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.lhead__tags .ctag { text-transform: uppercase; letter-spacing: .3px; }
.lpill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; background: var(--a-chip); font-size: 11.5px; font-weight: 600; color: var(--a-text); }
.lpill[hidden] { display: none; }
.lpill .icon { width: 13px; height: 13px; }
.lpill--green { background: #ECFDF5; color: var(--a-up); }
.lhead__title { font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--a-ink); }
.lhead__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: 13px; color: var(--a-text); }
.lhead__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.lhead__meta .icon { width: 14px; height: 14px; color: var(--a-muted); }
.lhead__actions { display: flex; gap: 10px; }
.lhead__actions .icon { width: 16px; height: 16px; }
.lhead__docs .icon { color: var(--a-ink); }
.cbtn.is-done { background: #ECFDF5; color: var(--a-up); }
.ltabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; scroll-margin-top: calc(var(--a-top) + 12px); }
.ltabs .tab { padding: 7px 14px; font-size: 13px; }
.ltabs__save { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--a-muted); }
.ltabs__save .icon { width: 14px; height: 14px; }
.lpanel { display: flex; flex-direction: column; gap: 14px; }
.lpanel[hidden], .lpanel [hidden] { display: none; }
.lpanel__intro { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--a-text); }
.lpanel__h { margin: 18px 0 10px; font-size: 15px; font-weight: 700; color: var(--a-ink); }
.llearn { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.llearn li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--a-ink); }
.llearn .icon { width: 16px; height: 16px; flex: none; color: var(--a-up); }
.ltip { display: flex; gap: 12px; margin-top: 18px; padding: 16px 18px; border-radius: 10px; background: #FFFBEB; }
.ltip > .icon { flex: none; width: 18px; height: 18px; color: #D97706; }
.ltip b { font-size: 13.5px; color: #D97706; }
.ltip p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--a-text); }
.lfiles { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lfiles li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--a-chip); }
.lpanel .lfiles li { background: #fff; border: 1px solid var(--a-line); }
.lfile__ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; }
.lfile__ic .icon { width: 16px; height: 16px; }
.lfile__ic--pdf { background: #FEF2F2; color: #DC2626; }
.lfile__ic--sheet { background: #ECFDF5; color: #059669; }
.lfile__ic--slide { background: #EFF6FF; color: var(--blue); }
.lfile__txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lfile__txt b { overflow: hidden; font-size: 12.5px; font-weight: 600; color: var(--a-ink); text-overflow: ellipsis; white-space: nowrap; }
.lfile__txt small { font-size: 11px; color: var(--a-muted); }
.lfile__dl { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--a-muted); cursor: pointer; }
.lfile__dl:hover { background: #fff; color: var(--blue); }
.lfile__dl .icon { width: 15px; height: 15px; }
.ldiscuss { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ldiscuss li { display: flex; gap: 12px; }
.ldiscuss__who { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; color: var(--a-ink); }
.ldiscuss__who small { font-size: 11.5px; color: var(--a-muted); }
.ldiscuss li > div > p:last-child { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--a-text); }
.lcompose { display: flex; gap: 10px; }
.lcompose input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--a-line); border-radius: 100px; font-size: 13px; }
.lnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--a-line); }
.lnav__mid { margin: 0; font-size: 12.5px; color: var(--a-muted); text-align: center; }
.lnav .icon { width: 15px; height: 15px; }
.lnav .cbtn:disabled { opacity: .45; background: var(--a-chip); color: var(--a-muted); cursor: default; }

.lcourse { gap: 10px; }
.lcourse__pic { position: relative; overflow: hidden; aspect-ratio: 3 / 1; border-radius: 10px; }
.lcourse__pic img { width: 100%; height: 100%; object-fit: cover; }
.lcourse__tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 100px; background: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--blue); text-transform: uppercase; }
.lcourse__title { font-size: 17px; font-weight: 700; color: var(--a-ink); }
.lteacher { display: flex; align-items: center; gap: 10px; margin: 0; }
.lteacher > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.lteacher b { font-size: 13px; font-weight: 600; color: var(--a-ink); }
.lteacher small { font-size: 11px; color: var(--a-muted); }
.lteacher--lg .cavatar { width: 44px; height: 44px; font-size: 14px; }
.lteacher--lg b { font-size: 14.5px; }
.lteacher--lg small { font-size: 12px; }
.lcourse__stats { display: flex; justify-content: space-between; margin: 0; font-size: 12.5px; color: var(--a-text); }
.lcourse__stats > span { display: inline-flex; align-items: center; gap: 5px; }
.lcourse__stats .icon { width: 13px; height: 13px; color: var(--a-muted); }
.lstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lstats p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.lstats p:nth-child(2) { align-items: center; }
.lstats p:last-child { align-items: flex-end; }
.lstats b { font-size: 14px; color: var(--a-ink); }
.lstats small { font-size: 11px; color: var(--a-muted); }
.lright__h { font-size: 15px; font-weight: 700; color: var(--a-ink); }
.lright__bio { margin: 0; font-size: 13px; line-height: 1.6; color: var(--a-text); }
.lcount { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 100px; background: var(--a-chip); font-size: 11px; color: var(--a-text); }
.lnotes { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.lnote { display: flex; align-items: flex-start; gap: 10px; }
.lnote > .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: #D97706; }
.lnote > div { flex: 1; min-width: 0; }
.lnote p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--a-ink); }
.lnote small { font-size: 11px; color: var(--a-muted); }
.lnote--empty { font-size: 13px; color: var(--a-muted); }
.lnote__rm { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--a-muted); cursor: pointer; }
.lnote__rm:hover { background: #FEF2F2; color: var(--a-down); }
.lnote__rm .icon { width: 14px; height: 14px; }
.lpanel .lnotes { padding: 16px; border: 1px solid var(--a-line); border-radius: 12px; background: #fff; }
.lnote-add label { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 8px; background: var(--a-chip); color: var(--blue); }
.lnote-add .icon { width: 14px; height: 14px; flex: none; }
.lnote-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--a-ink); }
.lnote-add label:focus-within { box-shadow: 0 0 0 2px var(--blue) inset; background: #fff; }

@media (max-width: 1600px) {
  .lapp { grid-template-columns: 320px minmax(0, 1fr) 360px; }
}
@media (max-width: 1440px) {
  .lapp { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "left main" "left right"; }
  .lright { position: static; height: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; padding: 0 28px 40px; border-left: 0; background: none; }
}
@media (max-width: 900px) {
  .lapp { display: flex; flex-direction: column; }
  .lapp > * { min-width: 0; max-width: 100%; }
  .lmain { order: -1; padding: 16px 16px 24px; }
  .ltoc { position: static; height: auto; overflow: visible; padding: 0 16px 16px; border-right: 0; background: none; }
  .ltoc::before { content: none; }
  .ltoc__list { padding: 8px; border: 1px solid var(--a-line); border-radius: 12px; background: #fff; }
  .lpractice { margin-top: 16px; }
  .lright { display: flex; align-items: stretch; padding: 0 16px 32px; }
  .lvideo { aspect-ratio: 16 / 9; }
  .lvideo__play { width: 64px; height: 64px; }
  .ltabs .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .lhead__title { font-size: 21px; }
}
@media (max-width: 560px) {
  .lhead__actions { width: 100%; }
  .lhead__actions .cbtn { flex: 1; }
  .lnav__mid { display: none; }
}


/* ---------- Ảnh đại diện: bấm để đổi, kéo thả ảnh, popup căn chỉnh ---------- */
.setavatar { position: relative; }
button.setavatar__pic { position: relative; padding: 0; border: 0; overflow: hidden; cursor: pointer; }
button.setavatar__pic:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.setavatar__cam { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 23, 42, .5); color: #fff; opacity: 0; transition: opacity .15s; }
.setavatar__cam .icon { width: 22px; height: 22px; }
button.setavatar__pic:hover .setavatar__cam, button.setavatar__pic:focus-visible .setavatar__cam { opacity: 1; }
.setavatar__pic.has-photo .setavatar__cam { visibility: visible; }
.setavatar__drop { position: absolute; inset: -8px -8px 12px; z-index: 1; display: none; place-items: center; margin: 0; border: 2px dashed var(--blue); border-radius: 14px; background: rgba(239, 246, 255, .94); font-size: 14px; font-weight: 600; color: var(--blue); pointer-events: none; }
.setavatar.is-drop .setavatar__drop { display: grid; }

.acrop { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 14px; background: #0F172A; cursor: grab; touch-action: none; user-select: none; }
.acrop:active { cursor: grabbing; }
.acrop:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.acrop canvas { display: block; width: 100%; height: 100%; }
.acrop__ring { position: absolute; inset: 0; border: 2px solid rgba(255, 255, 255, .9); border-radius: 50%; box-shadow: 0 0 0 999px rgba(15, 23, 42, .55); pointer-events: none; }
.acrop__zoom { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); margin: 16px auto 0; }
.acrop__zoom input { flex: 1; accent-color: var(--blue); }
.acrop__btn { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--a-muted); cursor: pointer; }
.acrop__btn:hover { background: var(--a-chip); color: var(--a-ink); }
.acrop__btn .icon { width: 18px; height: 18px; }
.acrop__tools { display: flex; justify-content: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.acrop__tools label { cursor: pointer; }
.acrop__tools label:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
[data-crop-save]:disabled { opacity: .7; cursor: progress; }

/* ---------- Lịch kinh tế: dữ liệu thật (/api/calendar) ---------- */
.cal { max-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
.cal__day { position: sticky; top: 0; z-index: 1; padding: 8px 4px 6px; border-bottom: 1px solid var(--a-line); background: #fff; font-size: 11px; font-weight: 600; color: var(--a-muted); text-transform: capitalize; }
.cal__day.is-today { color: var(--blue); }
.impact--0 i { background: var(--a-line); }
/* Hang tieu de: cong tac "Tin nong" (chi su kien anh huong vua & cao, mac dinh tat); hang duoi: tab thoi gian + GMT */
.cal__bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal__bar .chips { flex-wrap: nowrap; }
.cal__bar .cchip, .cal__bar .tz { white-space: nowrap; }
.cal__wrap { container-type: inline-size; }
@container (max-width: 330px) {
  .cal__bar { gap: 4px; }
  .cal__bar .chips { gap: 4px; }
  .cal__bar .cchip { padding: 5px 8px; }
  .cal__bar .tz { padding: 3px 7px; }
  .cal__bar .tz .icon { display: none; }
}
.cal__filter { display: flex; flex: none; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--a-text); white-space: nowrap; cursor: pointer; }
.switch--sm { width: 32px; height: 18px; }
.switch--sm::after { top: 2px; left: 2px; width: 14px; height: 14px; }
.switch--sm:checked::after { transform: translateX(14px); }
.cal__src { margin: 8px 0 0; font-size: 10px; text-align: right; }

/* ---------- Bot tin tức trên Bảng tin ---------- */
.botfeed { display: contents; }
.botav { display: grid; place-items: center; color: #fff; }
.botav .icon { width: 20px; height: 20px; }
.botav--vnstock { background: #059669; }
.botav--macro { background: #7C3AED; }
.botav--global { background: var(--blue); }
.botav--crypto { background: #D97706; }
.botbadge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 999px; background: var(--a-chip); font-size: 10px; font-weight: 600; color: var(--a-muted); }
.botbadge .icon { width: 11px; height: 11px; }
.linkcard--news { min-height: 0; color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.linkcard--news:hover { border-color: var(--blue); background: #F8FAFF; }
.linkcard--news:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.linkcard--news img { width: 150px; height: 100px; background: var(--a-chip); }
.linkcard--news .linkcard__title { font-weight: 600; }
.trnote { align-self: flex-start; padding: 0; border: 0; background: none; font-size: 11px; color: var(--a-muted); cursor: pointer; }
.trnote:hover { color: var(--blue); text-decoration: underline; }
/* Tai dan khi cuon: khung cho nhap nhay + dong "da xem het" */
.feedload { display: flex; flex-direction: column; gap: 8px; }
.feedload[hidden], .feedend[hidden] { display: none; }
.post--skel .post__body { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.post--skel i { display: block; height: 10px; border-radius: 5px; background: var(--a-chip); }
.post--skel i:nth-child(1) { width: 35%; }
.post--skel i:nth-child(2) { width: 95%; }
.post--skel i:nth-child(3) { width: 70%; height: 72px; border-radius: 8px; }
.post--skel .post__avatar, .post--skel i { animation: skel 1.2s ease-in-out infinite alternate; }
@keyframes skel { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .post--skel .post__avatar, .post--skel i { animation: none; } }
.feedend { margin: 8px 0 0; text-align: center; }
@media (max-width: 640px) {
  .linkcard--news img { width: 100%; height: 160px; }
}
.post--bot { position: relative; }
.act-remove { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: #fff; color: var(--a-muted); opacity: 0; transition: opacity .15s; cursor: pointer; }
.act-remove .icon { width: 16px; height: 16px; }
.post:hover .act-remove, .act-remove:focus-visible { opacity: 1; }
.act-remove:hover { color: var(--a-down); background: #FEF2F2; }
@media (hover: none) { .act-remove { opacity: 1; } }
.topbadge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: #FEF3C7; font-size: 10px; font-weight: 700; color: #B45309; }
.topbadge .icon { width: 11px; height: 11px; }
.botav--reddit { background: #FF4500; }

/* ---------- Giá thời gian thực (cột trái) ---------- */
[data-q] { border-radius: 4px; transition: background-color .6s; }
[data-q].tick-up { animation: tickUp .9s ease-out; }
[data-q].tick-down { animation: tickDown .9s ease-out; }
@keyframes tickUp { from { background-color: rgba(5, 150, 105, .18); } to { background-color: transparent; } }
@keyframes tickDown { from { background-color: rgba(220, 38, 38, .16); } to { background-color: transparent; } }
@media (prefers-reduced-motion: reduce) { [data-q].tick-up, [data-q].tick-down { animation: none; } }
.live--sm { font-size: 10px; }
.live--sm[hidden] { display: none; }
.markets__src { margin: 6px 0 0; font-size: 10px; line-height: 1.4; }

/* ---------- Bài của Bot Giá cả ---------- */
.botav--prices { background: #0891B2; }
.pricecard { display: flex; flex-direction: column; border: 1px solid var(--a-line); border-radius: 8px; overflow: hidden; }
.pricecard__row { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; }
.pricecard__row + .pricecard__row { border-top: 1px solid var(--a-line); }
.pricecard__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-text); }
.pricecard__v { font-weight: 600; color: var(--a-ink); text-align: right; }
.pricecard__row .chg { text-align: right; }
.pricecard__h { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--a-muted); }
.pricecard__src { margin: 0; font-size: 11px; color: var(--a-muted); }
.pricealert { font-weight: 600; }
.coinchips { display: flex; flex-wrap: wrap; gap: 6px; }
.coinchip { padding: 3px 10px; border-radius: 999px; background: var(--a-chip); font-size: 12px; font-weight: 600; color: var(--a-ink); }
@media (max-width: 640px) {
  .pricecard__row { grid-template-columns: minmax(0, 1fr) auto 58px; gap: 8px; padding: 8px 10px; }
}

/* ---------- Kết nối MT5 (Cài đặt > Kết nối nền tảng) ---------- */
.setbadge--amber { background: #FEF3C7; color: #B45309; }
.setalert--sm { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.setalert--sm .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--a-up); }
.setalert--sm[hidden] { display: none; }
.exhelp b { display: block; font-weight: 600; }
.exhelp ol { margin: 4px 0 0; padding-left: 18px; list-style: decimal; }
.exhelp li { margin-top: 2px; }
.exhelp p { margin: 6px 0 0; }
.setalert--warn { background: #FFFBEB; color: #B45309; }
.setalert--sm.setalert--warn .icon { color: #D97706; }
.tform [data-api-only][hidden] { display: none; }
.mt5key { display: flex; gap: 8px; }
.mt5key input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-chip);
  font: 600 13px/1 var(--font-mono); color: var(--a-ink); }
.mt5steps { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.55; color: var(--a-text); }
.mt5steps li::marker { font-weight: 700; color: var(--blue); }
.mt5steps .pill { margin-left: 4px; vertical-align: middle; }
.mt5status { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; padding: 12px 14px; border-radius: 10px; background: #FFFBEB; font-size: 13px; font-weight: 600; color: #B45309; }
.mt5status i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.mt5status.is-ok { background: #ECFDF5; color: var(--a-up); }
.mt5status.is-ok i { animation: none; }
[data-mt5-modal] .pill[hidden] { display: none; }
.mt5key .pill { flex: none; }

/* ---------- Trình hướng dẫn kết nối MT5 (Cài đặt) ---------- */
.mgwiz .tform__body { min-height: 300px; }
.mgbar { height: 4px; background: var(--a-chip); }
.mgbar i { display: block; width: 20%; height: 100%; background: var(--blue); transition: width .3s ease; }
.mgstep h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 700; color: var(--a-ink); }
.mgstep__n { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); font-size: 13px; font-weight: 700; color: #fff; }
.mgstep[hidden] { display: none; }
.mg__text { margin: 12px 0 0; font-size: 14px; line-height: 1.65; color: var(--a-text); }
.mg__path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; }
.mg__crumb { padding: 5px 10px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-chip); font-size: 13px; font-weight: 600; color: var(--a-ink); }
.mg__path .icon { width: 14px; height: 14px; color: var(--a-muted); }
.mg__dl { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 14px 0 0; }
.mg__src { font-size: 12.5px; color: var(--a-muted); text-decoration: underline; }
.mg__copy { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.mg__copy code { padding: 8px 12px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-chip); font: 600 13px/1.2 var(--font-mono); color: var(--a-ink); }
.mg__copy input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-chip); font: 600 13px/1 var(--font-mono); color: var(--a-ink); }
.mg__copy .pill { flex: none; }
.mg__tip, .mg__note { display: flex; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #FFFBEB; font-size: 13px; line-height: 1.55; color: #92400E; }
.mg__note { background: #EFF6FF; color: var(--blue); }
.mg__tip .icon, .mg__note .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
/* Chu thich: icon can giua theo chieu doc khoi chu, xuong dong theo noi dung */
.mg__tip { align-items: center; white-space: pre-line; }
.mg__tip .icon { margin-top: 0; }
.mgtrouble { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 10px; font-size: 13px; }
.mgtrouble summary { cursor: pointer; font-weight: 600; color: var(--a-ink); }
.mgtrouble p { margin: 10px 0 0; line-height: 1.55; color: var(--a-text); }
.mgtrouble b { display: block; color: var(--a-ink); }
.mgtrouble[hidden] { display: none; }
.mgwiz__foot { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mgwiz__guide { font-size: 12.5px; color: var(--a-muted); text-decoration: underline; }
.mgwiz__nav { display: flex; gap: 8px; margin-left: auto; }
.mgwiz__nav .pill[hidden] { display: none; }

/* ---------- Hộp xác nhận (ltApp.confirm, thay hộp thoại mặc định của trình duyệt) ---------- */
.lconfirm { width: min(420px, calc(100vw - 24px)); }
.lconfirm__body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 28px 8px; text-align: center; }
.lconfirm__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%; background: #FEF2F2; color: #DC2626; }
.lconfirm__icon .icon { width: 24px; height: 24px; }
.lconfirm--warning .lconfirm__icon { background: #FFFBEB; color: #D97706; }
.lconfirm h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--a-ink); overflow-wrap: anywhere; }
.lconfirm p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--a-text); }
.lconfirm__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 28px 24px; }
.lconfirm__foot .pill { justify-content: center; min-height: 40px; }
.pill--danger-solid { border-color: #DC2626; background: #DC2626; color: #fff; }
.pill--danger-solid:hover { border-color: #B91C1C; background: #B91C1C; }
.pill--danger-solid:focus-visible { outline: 2px solid #DC2626; outline-offset: 2px; }

/* Minh hoạ tab Inputs của MT5 (hướng dẫn kết nối, bước 4) */
/* Danh sach con: so thu tu nam giua cot rong bang icon so buoc ben tren, chu thang hang voi tieu de buoc */
.mg__sub { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: mgsub; font-size: 14px; line-height: 1.7; }
.mg__sub li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; counter-increment: mgsub; }
.mg__sub li::before { content: counter(mgsub) "."; text-align: center; padding-left: .3em; /* bu dau cham: chu so nam dung giua */ font-weight: 700; color: var(--blue); }
.mg__sub li + li { margin-top: 2px; }
.mtmock { margin: 14px 0 0; }
.mtmock__win { overflow: hidden; border: 1px solid #C9CED6; border-radius: 6px; background: #F0F0F0; font: 12px/1.3 "Segoe UI", Tahoma, sans-serif; color: #1F2328; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.mtmock__title { padding: 7px 10px; background: #fff; border-bottom: 1px solid #E1E4E8; }
.mtmock__tabs { display: flex; gap: 14px; padding: 6px 10px 0; }
.mtmock__tabs span { padding-bottom: 4px; }
.mtmock__tabs .is-on { border-bottom: 2px solid #0A64D6; font-weight: 600; }
.mtmock__table { margin: 6px 10px; border: 1px solid #C9CED6; background: #fff; }
.mtmock__row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.mtmock__row > span { min-width: 0; overflow: hidden; padding: 5px 8px; border-bottom: 1px solid #ECEEF1; text-overflow: ellipsis; white-space: nowrap; }
.mtmock__row > span + span { border-left: 1px solid #ECEEF1; }
.mtmock__row i { margin-right: 6px; font-style: normal; font-weight: 700; color: #B8860B; }
.mtmock__row--head > span { background: #F6F7F9; font-weight: 600; }
.mtmock__row--group > span { background: #F6F7F9; color: #57606A; }
.mtmock__row.is-dim { color: #8C959F; }
.mtmock__row.is-hl > span { background: #FFF8DB; font-weight: 600; }
.mtmock__cell { position: relative; outline: 2px solid #DC2626; outline-offset: -2px; color: #DC2626; animation: mtpulse 1.6s ease-in-out infinite; }
@keyframes mtpulse { 50% { outline-color: rgba(220, 38, 38, .35); } }
@media (prefers-reduced-motion: reduce) { .mtmock__cell { animation: none; } }
.mtmock__foot { display: flex; justify-content: flex-end; gap: 6px; padding: 0 10px 8px; }
.mtmock__foot span { padding: 3px 18px; border: 1px solid #C9CED6; border-radius: 3px; background: #fff; }
.mtmock__foot .mtmock__ok { border-color: #0A64D6; }
.mtmock figcaption { margin-top: 6px; font-size: 12.5px; color: #6B7280; }

/* Nút tải EA: bấm xong -> xanh lá nhạt, hơi mờ, biểu tượng ✓ */
.mg__dlbtn { transition: background .25s ease, color .25s ease, border-color .25s ease, opacity .25s ease, box-shadow .25s ease; }
.mg__dlic { display: inline-flex; }
.mg__dlic--done { display: none; }
.mg__dlbtn.is-done { border-color: #A7F3D0; background: #ECFDF5; color: #047857; box-shadow: none; opacity: .75; }
.mg__dlbtn.is-done:hover { opacity: 1; transform: none; }
.mg__dlbtn.is-done .mg__dlic { display: none; }
.mg__dlbtn.is-done .mg__dlic--done { display: inline-flex; }
.mg__crumb--act { border-color: #BFDBFE; background: #EFF6FF; color: #1D4ED8; }

/* Nút sao chép (hướng dẫn MT5): đã chép -> giữ cố định "Đã sao chép", nền xanh lá, biểu tượng ✓ */
.mg__cpbtn { transition: background .2s ease, color .2s ease, border-color .2s ease; }
.mg__cpic { display: inline-flex; }
.mg__cpic--done { display: none; }
.mg__cpbtn.is-copied { border-color: #A7F3D0; background: #ECFDF5; color: #047857; box-shadow: none; }
.mg__cpbtn.is-copied:hover { transform: none; }
.mg__cpbtn.is-copied .mg__cpic { display: none; }
.mg__cpbtn.is-copied .mg__cpic--done { display: inline-flex; }
.mg__after { margin-top: 12px; }

/* ---------- Trạng thái trống (component _empty.html, theo thiết kế "3. Empty state") ---------- */
.estate { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 36px 24px; border-radius: 6px; background: #fff; text-align: center; }
.estate[hidden] { display: none; }
.estate__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 100px; background: #F5F4F1; color: #9E9E9E; }
.estate__icon .icon { width: 24px; height: 24px; }
.estate__title { margin: 0; font-size: 15px; font-weight: 700; color: #1A1A1A; }
.estate__desc { max-width: 420px; margin: 0; font-size: 12px; line-height: 1.55; color: #9E9E9E; }
.estate__m { display: none; }
.estate[data-mode="none"] .estate__m--none, .estate[data-mode="filter"] .estate__m--filter { display: inline; }
.estate__icon .estate__m { line-height: 0; }
.estate__cta { margin-top: 6px; text-decoration: none; }
.estate[data-feed-signal-empty] { margin-top: 12px; }
.feed.is-signal-empty [data-news-more], .feed.is-signal-empty [data-news-end] { display: none; }
.mg__caption { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: #6B7280; }
.mg__caption .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: #059669; }
.mg__text { white-space: pre-line; }

/* Sơ đồ thao tác (thay chip đường dẫn): chữ ở trên, đường kẻ nối các chấm 1 2 3 ở dưới */
.mg__flow { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); margin: 16px 0 4px; padding: 0; list-style: none; }
.mg__flowstep { position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 8px; padding: 0 4px; text-align: center; }
.mg__flowtxt { align-self: end; font-size: 13px; font-weight: 600; line-height: 1.35; color: #1F2937; overflow-wrap: anywhere; }
.mg__flowdot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2563EB; box-shadow: 0 0 0 4px #fff; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; }
.mg__flowstep:not(:last-child)::after { content: ""; position: absolute; bottom: 10px; left: 50%; width: 100%; height: 2px; background: #BFDBFE; }
.mg__flowstep.is-act .mg__flowtxt { color: #1D4ED8; }
.mg__flowstep.is-act .mg__flowdot { background: #059669; }
.mg__hl { font-weight: 600; color: #7C3AED; }
.mg__copy:not(.mg__copy--key) { justify-content: center; }
.mg__copy--key + .shint { display: block; margin-top: 6px; }
/* Bước 5: chưa có tín hiệu từ EA -> nền đỏ; đã kết nối (.is-ok) -> nền xanh lá */
.mt5status:not(.is-ok) { background: #FEF2F2; color: #DC2626; }

/* ---------- Trang Bieu do (chart.js): thanh cong cu ve | bieu do + Strategy Tester | bang ben ---------- */
.chp-body { overflow: hidden; }
.chp {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 310px; height: calc(100dvh - var(--a-top));
  background: #fff; --up: #089981; --down: #F23645; --line: #E8E6E1;
}
.chp.is-full { height: 100dvh; }
.chp-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-right: 1px solid var(--line); overflow-y: auto; }
.chp-tg { position: relative; flex: none; }
.chp-tg__more { position: absolute; right: -3px; bottom: 1px; width: 10px; height: 10px; padding: 0; border: 0; background: none; cursor: pointer; opacity: 0; }
.chp-tg__more::before { content: ""; position: absolute; right: 2px; bottom: 2px; border: 3px solid transparent; border-right-color: #9AA4B2; border-bottom-color: #9AA4B2; }
.chp-tg:hover .chp-tg__more, .chp-tg [aria-expanded="true"] + .chp-tg__more { opacity: 1; }
.chp-fly { position: fixed; z-index: 60; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(17, 24, 39, .14); }
.chp-fly[hidden] { display: none; }
.chp-fly__head { margin: 2px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); }
.chp-fly__sub { margin: 8px 10px 2px; font-size: 11px; color: var(--a-muted); }
.chp-fly__head + .chp-fly__sub { margin-top: 0; }
.chp-fly__row { position: relative; }
.chp-fly__row .chp-fly__item { padding-right: 34px; }
.chp-fly__kbd { margin-left: auto; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; font: 500 10.5px/1.4 var(--font-body, Inter, sans-serif); color: var(--a-muted); white-space: nowrap; }
.chp-fly__fav {
  position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: #9AA4B2; cursor: pointer; opacity: 0; transform: translateY(-50%);
}
.chp-fly__fav .icon { width: 15px; height: 15px; }
.chp-fly__row:hover .chp-fly__fav, .chp-fly__fav:focus-visible, .chp-fly__fav.is-on { opacity: 1; }
.chp-fly__fav:hover { background: var(--a-chip); color: #F5A400; }
.chp-fly__fav.is-on { color: #F5A400; }
.chp-fly__fav.is-on svg { fill: #FFC107; }
.chp-favbar {
  position: absolute; z-index: 8; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; box-shadow: 0 6px 20px rgba(17, 24, 39, .12);
}
.chp-favbar[hidden] { display: none; }
.chp-favbar__grip { align-self: stretch; width: 10px; margin-right: 2px; border-radius: 5px; cursor: grab; touch-action: none;
  background: radial-gradient(circle, #B8BEC8 1px, transparent 1.5px) 0 0 / 5px 5px; }
.chp-favbar__grip:active { cursor: grabbing; }
.chp-favbar__list { display: flex; gap: 2px; min-width: 158px; }
/* Nút thanh yêu thích ở đáy thanh công cụ trái */
.chp-rail__sec { display: flex; flex-direction: inherit; align-items: center; gap: 4px; }
/* 3 phần công cụ gom sát nhau ở giữa chiều cao thanh; nút yêu thích ở đáy */
.chp-rail__top + .chp-rail__sec { margin-top: auto; }
.chp-rail__top { flex: none; }
.chp-rail__sec--end { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chp-rail__end { margin-top: auto; }
.chp-rail__end.is-on { background: #FFF7E0; color: #F5A400; }
.chp-rail__end.is-on svg { fill: #FFC107; }
@media (max-width: 1100px) {
  .chp-rail__sec--end { margin-top: 0; margin-left: auto; padding-top: 0; padding-left: 8px; border-top: 0; border-left: 1px solid var(--line); }
  .chp-rail__end, .chp-rail__top + .chp-rail__sec { margin-top: 0; }
}
.chp-fly--emo { width: auto; }
/* Bảng biểu tượng: 7 cột, mép trái thẳng với chữ tiêu đề mục */
.chp-fly--emo .chp-fly__emo--lg { grid-template-columns: repeat(7, 32px); justify-content: start; gap: 2px; padding: 0 6px 6px 3px; }
.chp-fly--emo .chp-fly__emo--lg button { width: 32px; height: 32px; font-size: 19px; }
.chp-fly--del { min-width: 250px; }
.chp-fly--del .chp-fly__item { justify-content: space-between; }
.chp-fly--del .chp-fly__item b { font-weight: 500; color: var(--a-muted); }
.chp-fly--del .chp-fly__item.is-danger, .chp-fly--del .chp-fly__item.is-danger b { color: var(--down, #F23645); }
.chp-fly--del hr { margin: 4px 2px; border: 0; border-top: 1px solid var(--line); }
.chp-fly__note { margin: 4px 10px 8px; font-size: 12.5px; color: var(--a-muted); }
.chp-favbar__empty { display: inline-flex; align-items: center; height: 30px; padding: 0 8px; font-size: 12px; color: var(--a-muted); white-space: nowrap; }
.chp-ctx {
  position: fixed; z-index: 130; min-width: 210px; padding: 5px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; box-shadow: 0 10px 30px rgba(17, 24, 39, .16);
}
.chp-ctx[hidden] { display: none; }
.chp-ctx button {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--a-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.chp-ctx button:hover, .chp-ctx button:focus-visible { background: var(--a-chip); }
.chp-ctx button.is-danger { color: var(--down, #F23645); }
.chp-ctx .icon { width: 15px; height: 15px; color: var(--a-text); }
.chp-ctx button.is-danger .icon { color: inherit; }
.chp-ctx hr { margin: 4px 2px; border: 0; border-top: 1px solid var(--line); }
.chp-favbar .chp-ic { width: 30px; height: 30px; }
.chp-favbar .chp-ic .icon { width: 16px; height: 16px; }
.chp-keys__all {
  display: inline-flex; align-items: center; gap: 6px; margin-left: -4px; padding: 0 6px; height: 24px; border: 0; border-radius: 5px;
  background: none; color: var(--blue); font: inherit; font-size: inherit; cursor: pointer;
}
.chp-keys__all:hover { background: #EFF6FF; }
.chp-keys__all .icon { width: 13px; height: 13px; }
.chp-dlg__box--keys { width: min(560px, 100%); }
.chp-kl { display: grid; gap: 14px; }
.chp-kl h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); }
.chp-kl dl { margin: 0; }
.chp-kl__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid #F3F2EF; }
.chp-kl dt { display: flex; align-items: center; gap: 3px; }
.chp-kl dt i { font-style: normal; font-size: 11px; color: var(--a-muted); }
.chp-kl kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #FAFAF9; font: 600 11px/1.5 Inter, sans-serif; color: var(--a-ink); }
.chp-kl dd { margin: 0; font-size: 13px; color: var(--a-ink); }
.chp-fly__item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px;
  background: none; color: var(--a-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.chp-fly__item .icon { flex: none; width: 17px; height: 17px; color: var(--a-text); }
.chp-fly__item:hover { background: var(--a-chip); }
.chp-fly__item.is-on { background: #EFF6FF; color: var(--blue); }
.chp-fly__item.is-on .icon { color: var(--blue); }
.chp-fly__emo { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 2px 6px 6px 36px; }
.chp-fly__emo button { height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; font-size: 17px; cursor: pointer; }
.chp-fly__emo button:hover, .chp-fly__emo button.is-on { background: var(--a-chip); }
/* Kiểu con trỏ: chấm / mũi tên chuột (chữ thập: mặc định của biểu đồ); đang vẽ luôn là chữ thập */
.chp-chart.cur-dot canvas { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Ccircle cx='6' cy='6' r='3' fill='%23131722' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 6 6, crosshair !important; }
.chp-chart.cur-arrow canvas, .chp-chart.cur-demo canvas, .chp-chart.cur-cross canvas { cursor: default !important; }
.chp-chart.cur-crossonly canvas { cursor: none !important; }
/* Con trỏ Minh hoạ: vòng tròn nền đi theo chuột, bấm thì gợn sóng (dùng khi trình bày / quay video) */
.chp-demo { position: absolute; z-index: 7; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: rgba(255, 152, 0, .28); pointer-events: none; }
.chp-demo[hidden] { display: none; }
.chp-demo.is-click { animation: chp-demo-click .45s ease-out; }
@keyframes chp-demo-click { 0% { transform: scale(.6); background: rgba(255, 152, 0, .5); } 100% { transform: scale(1.5); background: rgba(255, 152, 0, .12); } }
.chp-chart.is-drawing canvas { cursor: crosshair !important; }
.chp-chart.is-grab canvas { cursor: move !important; }
.chp-chart.is-handle canvas { cursor: pointer !important; }
.chp-rail__sep { flex: none; width: 24px; height: 1px; margin: 14px 0; background: var(--line); }
.chp-ic {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--a-text); cursor: pointer;
}
.chp-ic .icon { width: 17px; height: 17px; }
.chp-ic:hover { background: var(--a-chip); color: var(--a-ink); }
.chp-ic.is-on, .chp-ic[aria-pressed="true"] { background: #EFF6FF; color: var(--blue); }
.chp-ic:disabled { opacity: .4; cursor: default; }
.chp-ic--sm { width: 24px; height: 24px; border-radius: 6px; }
.chp-ic--sm .icon { width: 13px; height: 13px; }

.chp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.chp-bar { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.chp-bar::-webkit-scrollbar { display: none; }
.chp-bar__gap { width: 1px; height: 22px; margin: 0 4px; background: var(--line); flex: none; }
.chp-pop { position: relative; flex: none; }
.chp-sym {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--a-chip); color: var(--a-ink); font-size: 14px; cursor: pointer;
}
.chp-sym b { font-weight: 700; }
.chp-sym small { font-size: 11px; color: var(--a-muted); }
.chp-sym > .icon { width: 14px; height: 14px; color: var(--a-muted); }
.chp-coin { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #F7931A; color: #fff; }
.chp-coin .icon { width: 12px; height: 12px; }
.chp-coin[hidden] { display: none; }
.chp-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 9px; background: var(--a-chip); }
.chp-seg button {
  min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: none;
  font-size: 12.5px; color: var(--a-text); cursor: pointer;
}
.chp-seg button .icon { width: 16px; height: 16px; vertical-align: middle; }
.chp-seg button[aria-checked="true"] { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 2px rgba(26, 26, 26, .08); }
.chp-seg--sm button { min-width: 30px; height: 24px; font-size: 11.5px; }
.chp-txt, .chp-cta {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; font-size: 13px; color: var(--a-ink); cursor: pointer; white-space: nowrap;
}
.chp-txt .icon, .chp-cta .icon { width: 15px; height: 15px; }
.chp-txt:hover, .chp-txt[aria-expanded="true"] { background: var(--a-chip); }
.chp-txt[aria-pressed="true"] { background: #EFF6FF; color: var(--blue); }
.chp-cta { padding: 0 12px; border-radius: 100px; background: #EFF6FF; color: var(--blue); font-weight: 600; }
.chp-cta:hover { background: #DBEAFE; }
.chp-cta--primary { background: var(--blue); color: #fff; }
.chp-cta--primary:hover { background: #1D4ED8; }
.chp-cta kbd { padding: 1px 5px; border-radius: 4px; background: rgba(37, 99, 235, .14); font: 600 10px/1.4 var(--font-mono); }
.chp-cta--primary kbd { background: rgba(255, 255, 255, .25); }

.chp-menu {
  position: fixed; z-index: 960; max-height: calc(100dvh - 90px); overflow-y: auto; display: grid; gap: 8px; width: 300px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(26, 26, 26, .14);
}
.chp-menu[hidden] { display: none; }
.chp-menu--sym { width: 360px; }
.chp-menu--set { width: 220px; }
.chp-menu__head { margin: 0; font-size: 13px; font-weight: 600; }
.chp-menu__sub, .chp-menu__note { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--a-muted); }
.chp-menu__note[hidden] { display: none; }
.chp-find { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; background: var(--a-chip); }
.chp-find .icon { width: 15px; height: 15px; color: var(--a-muted); flex: none; }
.chp-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13px; }
.chp-symchips { display: flex; flex-wrap: wrap; gap: 4px; }
.chp-symchip { height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 100px; background: #fff; font: inherit; font-size: 11.5px; color: var(--a-text); cursor: pointer; }
.chp-symchip[aria-pressed="true"] { border-color: var(--blue); background: #EFF6FF; color: var(--blue); font-weight: 600; }
.chp-symgrp { padding: 8px 4px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); list-style: none; }
.chp-symlist { display: grid; max-height: 340px; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.chp-indlist { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.chp-indlist li { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.chp-indlist li:hover { background: var(--a-chip); }
.chp-indlist li span { flex: 1; }
.chp-indlist li small { font-size: 11px; color: var(--a-muted); }
.chp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chp-indadd { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chp-menu--alert .chp-indadd { padding-top: 0; border-top: 0; }
.chp-indadd .pill { height: 34px; padding: 0 12px; }
.chp-field { display: grid; gap: 4px; flex: 1; min-width: 0; font-size: 11.5px; color: var(--a-text); }
.chp-field--n { flex: 0 0 72px; }
.chp-field select, .chp-field input {
  width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 13px; color: var(--a-ink);
}
.chp-field input[aria-invalid="true"] { border-color: var(--a-down); }
.chp-field .dd-btn { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; color: var(--a-ink); }
.chp-field .dd-btn::after { content: ""; width: 7px; height: 7px; margin: -3px 2px 0 auto; border: solid var(--a-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); flex: none; }
.chp-field .dd-btn:disabled { background: var(--a-panel); color: var(--a-muted); }
.chp-replay .chp-field .dd-btn { height: 26px; min-width: 52px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; }
.chp-replay .chp-field .dd-btn::after { border-color: #fff; }
.chp-field--inline select { height: 28px; padding: 0 4px; }
.chp-check { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; cursor: pointer; }
.chp-check input { width: 16px; height: 16px; accent-color: var(--blue); }

/* Dòng mã + OHLC: 1 dòng nhỏ trên nền biểu đồ, góc trên trái (như TradingView) */
.chp-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; }
.chp-back { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 10px; border-radius: 100px; background: var(--a-chip); font-size: 12.5px; color: var(--a-text); }
.chp-back .icon { width: 14px; height: 14px; }
.chp-back:hover { color: var(--a-ink); }
.chp-head__sym { font-size: 13px; font-weight: 500; color: var(--a-ink); }
.chp-head__tf { color: var(--a-text); }
.chp-head__tf::before { content: "·"; margin-right: 8px; }
.chp-ohlc { display: inline-flex; align-items: baseline; gap: 8px; margin-left: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chp-ohlc i { font-style: normal; color: var(--a-ink); }
.chp-ohlc b { font-weight: 400; }
.chp-ohlc .chg--up { color: var(--up); }
.chp-ohlc .chg--down { color: var(--down); }
.chp-legend { display: inline-flex; gap: 6px; }
.chp-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 26px; padding: 0 10px; border: 0; border-radius: 100px;
  background: var(--a-chip); font-size: 12px; color: var(--a-ink); cursor: pointer;
}
.chp-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, #9E9E9E); }
.chp-chip.is-off { color: var(--a-muted); }
.chp-chip.is-off .chp-chip__name { text-decoration: line-through; }
span.chp-chip { padding: 0 4px 0 10px; cursor: default; }
.chp-chip__name { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.chp-chip__x { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--a-muted); cursor: pointer; }
.chp-chip__x .icon { width: 11px; height: 11px; }
.chp-chip__x:hover { background: #FEE2E2; color: var(--a-down); }
.chp-indlist li span.is-off { color: var(--a-muted); text-decoration: line-through; }
.chp-chip--vol { --dot: #9E9E9E; }
.chp-chip--sig { background: #ECFDF5; color: var(--a-up); font-weight: 600; --dot: var(--a-up); }
.chp-chip--sig:not(.is-on) { background: var(--a-chip); color: var(--a-muted); --dot: #9E9E9E; }

.chp-plot { position: relative; flex: 1; min-height: 240px; }
.chp-chart { position: absolute; inset: 0; }
.chp-stk { display: contents; }
.chp-dock__title:not([data-st-kind="test"]) .chp-stk--test, .chp-dock__title:not([data-st-kind="live"]) .chp-stk--live, .chp-dock__title:not([data-st-kind="none"]) .chp-stk--none { display: none; }
/* Nút A: tự co giãn thang giá (góc giữa thang giá và thang thời gian) */
.chp-auto { position: absolute; right: 0; bottom: 0; z-index: 4; display: grid; place-items: center; width: 56px; height: 28px; padding: 0; border: 0; background: transparent; font: 600 11px/1 var(--font-mono); color: var(--a-muted); cursor: pointer; }
.chp-auto::before { content: ""; position: absolute; inset: 50% auto auto 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 5px; z-index: -1; }
.chp-auto:hover::before { background: var(--a-chip, #F1F1EF); }
.chp-auto[aria-pressed="true"] { color: var(--blue); }
.chp-chart.is-drawing, .chp-chart.is-picking { cursor: crosshair; }
.chp-tl { position: absolute; top: 8px; left: 10px; z-index: 5; display: grid; gap: 6px; max-width: calc(100% - 110px); pointer-events: none; }
/* Ngăn Thông số: cùng cột với bảng bên phải */
.chp-prm { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: #fff; }
.chp-prm[hidden] { display: none; }
.chp.is-prm aside.chp-side { display: none; }
.chp-prm__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); }
.chp-prm__head h2 { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; font-size: 13.5px; font-weight: 700; color: var(--a-ink); }
.chp-prm__peti { width: 26px; height: 26px; border-radius: 7px; }
.chp-prm__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chp-prm__head h2 .icon { width: 15px; height: 15px; }
.chp-prm__head small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--a-muted); }
.chp-prm__body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 14px; }
.chp-prm__sec { padding: 12px 0; border-bottom: 1px solid #F0F0F0; }
.chp-prm__sec:last-of-type { border-bottom: 0; }
.chp-prm__sec h3 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); }
.chp-prm__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chp-prm__full { grid-column: 1 / -1; }
.chp-prm__grid > [hidden] { display: none; }
.chp-prm__sym { display: flex; align-items: center; gap: 6px; width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; color: var(--a-ink); cursor: pointer; text-align: left; }
.chp-prm__symn { padding: 0 6px; border-radius: 100px; background: var(--blue); font: 700 10.5px/16px var(--font-mono); font-style: normal; color: #fff; }
.chp-prm__symn[hidden] { display: none; }
.chp-symedit { margin: 6px 0 2px; padding-top: 6px; border-top: 1px solid var(--line); list-style: none; }
.chp-symedit a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--blue); }
.chp-symedit a:hover { background: #EFF6FF; }
.chp-prm__sym small { color: var(--a-muted); font-size: 11px; }
.chp-prm__sym .icon { width: 13px; height: 13px; margin-left: auto; color: var(--a-muted); }
.chp-prm__sym:hover { border-color: #CBD5E1; }
.chp-field.is-flash .dd-btn, .chp-field.is-flash .chp-prm__sym { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.chp-seg [data-tf].is-locked { opacity: .4; cursor: not-allowed; }
.chp-sym.is-locked > .icon:last-child { opacity: .3; }
.chp-prm__row { display: flex; align-items: center; gap: 6px; min-height: 32px; font-size: 12.5px; color: var(--a-ink); }
.chp-prm__lab { flex: 1; min-width: 0; color: var(--a-text); }
.chp-prm__row input[type="checkbox"], .chp-prm__rlab input { width: 15px; height: 15px; flex: none; accent-color: var(--blue); }
.chp-prm__num { width: 64px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: 500 12.5px var(--font-mono); text-align: right; color: var(--a-ink); }
.chp-prm__num[aria-invalid="true"] { border-color: var(--a-down); }
.chp-prm .nwrap { flex: none; }
.chp-prm .nwrap > .chp-prm__num { width: 84px; }
.chp-prm__grid .nwrap > input, .chp-rngpop .nwrap > input, .chp-runpop .nwrap > input { height: 34px; }
.chp-prm__unit { flex: none; width: 30px; font-size: 11.5px; color: var(--a-muted); }
.chp-prm__val { font-size: 12px; color: var(--a-ink); }
.chp-prm__sel { flex: 0 0 120px; }
/* Ô số + đơn vị và ô chọn cùng mép phải: ô số 84 + khoảng 6 + đơn vị 30 = 120 */
.chp-prm__sel .dd-btn, .chp-prm__sel select { height: 28px; font-size: 12.5px; }
.chp-prm__seg button { padding: 0 8px; font-size: 12px; }
.chp-prm__sub { margin: 8px 0 2px; font-size: 11.5px; color: var(--a-muted); }
.chp-prm__rules { display: grid; gap: 4px; margin: 6px 0 4px; padding: 0; list-style: none; }
.chp-prm__rule { display: grid; gap: 4px; padding: 6px 8px; border: 1px solid #F0F0F0; border-radius: 8px; }
.chp-prm__rule.is-off .chp-prm__rtxt, .chp-prm__rule.is-off .chp-prm__tag { color: var(--a-muted); text-decoration: line-through; }
.chp-prm__rlab { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; cursor: pointer; }
.chp-prm__tag { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: #EFF6FF; font-size: 10.5px; color: var(--blue); }
.chp-prm__rtxt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-ink); }
.chp-prm__rtop { display: flex; align-items: center; gap: 4px; min-width: 0; }
.chp-prm__rtop .chp-prm__rlab { flex: 1; }
.chp-prm__gear { flex: none; }
.chp-prm__add { margin: 2px 0 6px; }
.chp-prm__addbtn { width: 100%; height: 30px; margin: 10px 0 4px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--blue); cursor: pointer; }
.chp-prm__addbtn:hover { border-color: var(--blue); background: #EFF6FF; }
.chp-embed { width: min(1180px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.chp-embed::backdrop { background: rgba(15,23,42,.4); }
.chp-embed__head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.chp-embed__head h2 { flex: 1; margin: 0; font-size: 15px; }
.chp-embed iframe { display: block; width: 100%; height: calc(100% - 48px); border: 0; }
.chp-embed iframe[hidden] { display: none; }
.chp-embed__load { position: absolute; inset: 48px 0 0; display: grid; place-items: center; background: #fff; font-size: 13px; color: var(--a-muted); }
.chp-embed__load[hidden] { display: none; }
.chp-prm__add .dd-btn { height: 30px; border-style: dashed; color: var(--blue); font-weight: 600; font-size: 12.5px; }
.chp-prm__rctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 45px; }
/* Ô chọn của từng điều kiện: 2 ô 1 hàng, chia đều chiều ngang */
.chp-prm__rctl:has(.chp-prm__sel) { padding-left: 26px; }
.chp-prm__rctl .chp-prm__sel { flex: 1 1 100px; min-width: 0; }
.chp-prm__foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); background: #FAFAF9; }
.chp-prm__dirty { margin: 0 0 8px; font-size: 12px; color: var(--a-muted); }
.chp-prm__dirty.is-dirty { color: #B45309; font-weight: 600; }
.chp-prm__btns { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.chp-prm__btns [data-prm-save] { flex: 1; justify-content: center; }
.chp-btn--ic { flex: none; width: 30px; padding: 0; justify-content: center; }
.chp-prm__dot { width: 7px; height: 7px; margin-left: 2px; border-radius: 50%; background: #FBBF24; }
/* Luôn giữ chỗ cho chấm (chỉ ẩn bằng visibility) để nút Thông số không đổi độ rộng khi có / hết thay đổi chưa lưu */
.chp-prm__dot[hidden] { display: inline-block; visibility: hidden; }
.chp-kpi__d { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--a-muted); }
@media (max-width: 1100px) { .chp-prm { order: 6; } .chp.is-prm aside.chp-side { display: none; } }
.chp-ilg { display: grid; justify-items: start; gap: 1px; }
.chp-ilg.is-min > .chp-il { display: none; }
.chp-ilg__fold { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; margin-top: 2px; border: 1px solid #E4E4E7; border-radius: 4px; background: rgba(255,255,255,.92); color: #52525B; font-size: 11px; cursor: pointer; pointer-events: auto; }
.chp-ilg__fold:hover { background: #F4F4F5; color: #18181B; }
.chp-ilg__fold svg { width: 14px; height: 14px; }
.chp-ilg--sub { position: absolute; left: 10px; z-index: 5; }
.chp-ilg--sub[hidden] { display: none; }
.chp-il {
  display: inline-flex; align-items: center; gap: 8px; min-height: 24px; padding: 1px 4px 1px 6px; border: 1px solid transparent; border-radius: 6px;
  font-size: 12px; color: var(--a-ink); pointer-events: auto; background: rgba(255, 255, 255, .7);
}
.chp-il:hover, .chp-il:focus-within { border-color: var(--line); background: #fff; }
.chp-il.is-off .chp-il__name { color: var(--a-muted); }
/* Tắt: giữ chỗ của giá trị để nút không dịch dưới con trỏ (người dùng 2026-10-26) */
.chp-il.is-off .chp-il__val { opacity: .4; }
.chp-il__v + .chp-il__v { margin-left: 8px; }
.chp-il__sw { display: inline-block; width: 10px; height: 10px; margin-right: 3px; border-radius: 2px; vertical-align: -1px; }
.chp-il__val { font-size: 11.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chp-il__act { display: inline-flex; gap: 1px; opacity: 0; }
.chp-il:hover .chp-il__act, .chp-il:focus-within .chp-il__act, .chp-il__act--on { opacity: 1; }
@media (hover: none) { .chp-il__act { opacity: 1; } }
.chp-il__btn { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--a-text); cursor: pointer; }
.chp-il__btn .icon { width: 14px; height: 14px; }
.chp-il__btn:hover { background: var(--a-chip); color: var(--a-ink); }
.chp-il__btn[data-il="remove"]:hover { background: #FEE2E2; color: var(--a-down); }
.chp-indlist .chp-il__act { margin-left: auto; }
.chp-menu--iedit { width: 260px; }
.chp-pedit { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.chp-pedit[hidden] { display: none; }
.chp-pedit__chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--a-ink); cursor: pointer; }
.chp-pedit__chk input { width: 15px; height: 15px; accent-color: var(--blue); }
.chp-iedit__n { display: flex; gap: 8px; }
.chp-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.chp-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.chp-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--a-ink); }
.chp-iedit__foot { display: flex; justify-content: flex-end; gap: 8px; }
.rule.is-focus { border-radius: 8px; box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); background: #EFF6FF; transition: box-shadow .3s, background .3s; }
/* Nút Đặt lại khung nhìn: khung nhìn đang lệch -> tô xanh để dễ thấy */
.chp-ic.chp-reset.is-off { color: var(--blue); }
.chp-load {
  position: absolute; top: 50%; left: 50%; z-index: 6; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(26, 26, 26, .08);
  font-size: 13px; color: var(--a-text); transform: translate(-50%, -50%);
}
.chp-load[hidden] { display: none; }
.chp-load.is-bg .chp-load__bar i { transition: width .35s ease-out; }
.chp-load.is-bg { top: auto; bottom: 14px; width: min(320px, calc(100% - 32px)); padding: 8px 12px; gap: 6px; font-size: 12px; transform: translateX(-50%); box-shadow: 0 4px 14px rgba(26, 26, 26, .08); }
.chp-load.is-error { color: var(--a-down); border-color: #FECACA; background: #FEF2F2; }
.chp-load__bar { display: block; height: 4px; border-radius: 4px; background: var(--a-chip); overflow: hidden; }
.chp-load__bar[hidden] { display: none; }
.chp-load__bar i { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.chp-replay {
  position: absolute; top: 10px; left: 50%; z-index: 7; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px;
  background: #1A1A1A; border-radius: 100px; color: #fff; font-size: 12.5px; transform: translateX(-50%); white-space: nowrap;
}
.chp-replay[hidden] { display: none; }
.chp-replay .chp-ic { width: 28px; height: 28px; color: #fff; }
.chp-replay .chp-ic:hover { background: rgba(255, 255, 255, .14); }
.chp-replay__ctl { display: flex; align-items: center; gap: 2px; }
.chp-replay__ctl[hidden] { display: none; }
.chp-replay select { height: 26px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 12px; }
.chp-replay option { color: var(--a-ink); }
.chp-dtb {
  position: absolute; z-index: 9; top: 10px; left: 50%; display: flex; align-items: center; gap: 2px; padding: 4px; transform: translateX(-50%);
  border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 6px 20px rgba(17, 24, 39, .12);
}
.chp-dtb[hidden] { display: none; }
.chp-dtb button {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; min-width: 30px; padding: 0 7px; border: 0; border-radius: 6px;
  background: none; color: var(--a-text); font: inherit; font-size: 12px; cursor: pointer;
}
.chp-dtb button[hidden] { display: none; }
.chp-dtb button:hover { background: var(--a-chip); color: var(--a-ink); }
.chp-dtb .icon { width: 16px; height: 16px; }
.chp-dtb__sw { width: 16px; height: 16px; border: 1px solid rgba(0, 0, 0, .12); border-radius: 4px; }
.chp-dtb__ln { width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
.chp-dtb__ls { width: 22px; height: 0; border-top: 2px solid currentColor; }
[data-ls="dash"] .chp-dtb__ls { border-top-style: dashed; }
[data-ls="dot"] .chp-dtb__ls { border-top-style: dotted; }
.chp-dtb__sep { width: 1px; height: 20px; margin: 0 3px; background: var(--line); }
.chp-dtb__pop { position: relative; }
.chp-dtb__pal {
  position: absolute; top: calc(100% + 8px); left: -4px; display: grid; grid-template-columns: repeat(5, 22px); gap: 6px; padding: 8px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 6px 20px rgba(17, 24, 39, .12);
}
.chp-dtb__pal[hidden] { display: none; }
.chp-dtb__pal button { width: 22px; min-width: 0; height: 22px; padding: 0; border: 1px solid rgba(0, 0, 0, .1); border-radius: 5px; }
.chp-dtb__pal button:hover { outline: 2px solid var(--blue); outline-offset: 1px; }
.chp-dlg { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(17, 24, 39, .28); }
.chp-dlg[hidden] { display: none; }
.chp-dlg__box {
  display: flex; flex-direction: column; width: min(460px, 100%); max-height: min(640px, calc(100dvh - 32px));
  border-radius: 14px; background: #fff; box-shadow: 0 24px 60px rgba(17, 24, 39, .25); overflow: hidden;
}
.chp-dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 4px 18px; }
.chp-dlg__head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--a-ink); }
.chp-dlg__tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.chp-dlg__tabs button {
  height: 38px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--a-muted);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chp-dlg__tabs button[hidden] { display: none; }
.chp-dlg__tabs button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--a-ink); }
.chp-dlg__body { flex: 1; min-height: 120px; padding: 12px 18px; overflow-y: auto; }
.chp-dlg__row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 0; }
.chp-dlg__lbl { font-size: 12.5px; color: var(--a-text); }
.chp-dlg__ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.chp-dlg__cols { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.chp-dlg__sw { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(0, 0, 0, .12); border-radius: 5px; cursor: pointer; }
.chp-dlg__sw:hover { outline: 2px solid var(--blue); outline-offset: 1px; }
.chp-dlg__color { width: 28px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.chp-dlg__seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--a-chip); }
.chp-dlg__seg button { height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--a-text); font: inherit; font-size: 12px; cursor: pointer; }
.chp-dlg__seg button[aria-checked="true"] { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.chp-dlg__chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--a-ink); cursor: pointer; }
.chp-dlg__chk input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.chp-dlg__num, .chp-dlg__dt {
  height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--a-ink); font: inherit; font-size: 12.5px;
}
.chp-dlg__num { width: 110px; }
.chp-dlg__num:focus, .chp-dlg__dt:focus, .chp-dlg__ta:focus { outline: 2px solid rgba(37, 99, 235, .25); border-color: var(--blue); }
.chp-dlg__range { width: 150px; accent-color: var(--blue); }
.chp-dlg__unit { font-size: 12px; color: var(--a-muted); }
.chp-dlg__ta {
  width: 100%; min-height: 70px; margin-bottom: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; color: var(--a-ink); resize: vertical; box-sizing: border-box;
}
.chp-dlg__lv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.chp-dlg__lvrow { display: flex; align-items: center; gap: 6px; }
.chp-dlg__lvrow input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.chp-dlg__lvrow .chp-dlg__num { width: 72px; height: 28px; }
.chp-dlg__emo { display: grid; grid-template-columns: repeat(6, 32px); gap: 4px; }
.chp-dlg__emo button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: none; font-size: 18px; cursor: pointer; }
.chp-dlg__emo button:hover, .chp-dlg__emo button[aria-checked="true"] { background: var(--a-chip); }
.chp-dlg__note { margin: 0 0 8px; font-size: 12.5px; color: var(--a-muted); }
.chp-dlg__tfs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.chp-dlg__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@media (max-width: 520px) { .chp-dlg__row { grid-template-columns: 1fr; gap: 6px; } .chp-dlg__lv { grid-template-columns: 1fr; } }
.chp-textin {
  position: absolute; z-index: 8; width: 220px; height: 30px; padding: 0 8px; border: 1px solid var(--blue); border-radius: 6px;
  background: #fff; font: inherit; font-size: 13px; box-shadow: 0 4px 12px rgba(37, 99, 235, .15);
}
.chp-textin[hidden] { display: none; }

.chp-dock { display: flex; flex-direction: column; flex: none; height: 330px; border-top: 1px solid var(--line); background: #fff; }
.chp-dock.is-collapsed { height: auto; }
.chp-dock.is-collapsed .chp-dock__body { display: none; }
.chp-dock__sum { font-size: 12.5px; color: var(--a-text); white-space: nowrap; }
.chp-dock:not(.is-collapsed) .chp-dock__sum { display: none; }
.chp-dock__open { flex: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chp-dock__open[hidden], .chp-steye[hidden] { display: none; }
.chp-plot.is-nosig [data-tcard] { display: none; }
/* Hộp cài đặt Lệnh và vị thế */
.chp-menu--iedit.chp-oedit { width: 300px; gap: 12px; }
.chp-oedit__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: -4px; }
.chp-oedit__top .chp-menu__head { margin: 0; }
.chp-pedit .chp-oedit__eye { color: #2563EB; }
.chp-pedit .chp-oedit__eye[aria-pressed="true"] { color: #94A3B8; }
.chp-oedit__seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.chp-oedit__seg button { width: 100%; }
.chp-oedit__sec { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.chp-oedit__h { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--a-ink); }
.chp-oedit__h.is-off { color: #94A3B8; }
.chp-oedit__sec > .chp-oedit__h:not(:first-child) { margin-top: 6px; }
.chp-oedit__hrow { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
/* Mọi con mắt trong hộp (đầu hộp + từng nhóm) cùng 1 cột */
.chp-pedit .chp-oedit__eye { flex: none; width: 26px; height: 26px; margin: 0 -6px 0 0; }
.chp-oedit__row { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--a-muted); }
.chp-oedit__row .chp-swatches { gap: 5px; flex-wrap: nowrap; }
.chp-oedit__row .chp-swatch { width: 20px; height: 20px; }
.chp-pedit .chp-seg button[aria-checked="true"] { background: #fff; color: var(--a-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chp-steye { flex: none; width: 30px; height: 30px; border-radius: 50%; }
.chp-steye[aria-pressed="false"] { color: var(--a-muted); background: var(--a-chip); }
.chp-dock__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.chp-dock.is-collapsed .chp-ran { display: none; }
.chp-sigs--dock { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.chp-dock__head { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.chp-dock__head::-webkit-scrollbar { display: none; }
.chp-dock__head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; }
.chp-dock__head h2 .icon { width: 16px; height: 16px; padding: 5px; box-sizing: content-box; border-radius: 6px; background: #EFF6FF; color: var(--blue); }
.chp-dock__head h2 .chp-stk--none .icon { background: #F5F5F4; color: var(--a-muted); }
.chp-stsel {
  position: relative; display: inline-flex; align-items: center; flex: none; height: 28px; max-width: 260px; padding: 0 28px 0 22px;
  border-radius: 100px; background: #EFF6FF; font-size: 12.5px; font-weight: 600; color: var(--blue);
}
.chp-stsel i { position: absolute; left: 10px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); pointer-events: none; }
.chp-stsel .dd-btn { max-width: 210px; height: 100%; }
.chp-stsel:has(.dd-value .dd-pet) { padding-left: 4px; }
.chp-stsel:has(.dd-value .dd-pet) > i { display: none; }
.chp-stsel .dd-value .dd-pet { width: 20px; height: 20px; border-radius: 50%; }
.chp-stsyms { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 8px 0 10px; border: 0; border-radius: 100px; background: var(--a-chip, #F1F1EF); font: inherit; font-size: 12.5px; color: var(--a-ink); cursor: pointer; }
.chp-stsyms[hidden] { display: none; }
.chp-stsyms:hover { background: #E7E5E4; }
.chp-stsyms i { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: var(--blue); font: 700 10.5px/1 var(--font-mono); font-style: normal; color: #fff; }
.chp-stsyms .icon { width: 12px; height: 12px; color: var(--a-muted); }
.chp-stsyms.is-out b { color: var(--a-muted); }
.chp-symsmenu { width: 220px; max-height: 320px; gap: 2px; }
.chp-symsmenu[hidden] { display: none; }
.chp-symsmenu__it { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: var(--a-ink); cursor: pointer; text-align: left; }
.chp-symsmenu__it:hover { background: var(--a-chip); }
.chp-symsmenu__it.is-on { background: #EFF6FF; color: var(--blue); }
.chp-symsmenu__it small { font-size: 11px; color: var(--a-muted); }
.chp-stnew { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #EFF6FF; color: var(--blue); }
.chp-stnew:hover { background: #DBEAFE; }
.chp-stedit { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #D97706; color: #fff; }
.chp-stedit .icon { width: 14px; height: 14px; }
.chp-stedit:hover { background: #B45309; color: #fff; }
.chp-stedit[hidden] { display: none; }
.chp-stsel > .icon { position: absolute; right: 9px; top: 7px; width: 13px; height: 13px; pointer-events: none; }
.chp-dock__meta { font-size: 12px; color: var(--a-muted); }
.chp-ran { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 100px; background: #ECFDF5; font-size: 11px; font-weight: 600; color: var(--a-up); }
.chp-ran::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chp-ran[hidden] { display: none; }
/* Đang tải (bấm Quá khứ | Demo / đổi khoảng) thay chữ "Đã chạy" cùng chỗ, rộng tối thiểu như nhau */
.chp-ran { min-width: 104px; justify-content: center; }
.chp-ran.is-busy { background: var(--a-chip); color: var(--a-muted); }
.chp-dock__gap { flex: 1; }
.chp-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 100px;
  background: #fff; font-size: 12.5px; color: var(--a-ink); cursor: pointer; white-space: nowrap;
}
.chp-btn .icon { width: 14px; height: 14px; }
.chp-btn:hover { background: var(--a-chip); }
.chp-btn:disabled { opacity: .45; cursor: default; }
.chp-btn[hidden] { display: none; }
.chp-btn--soft { border-color: transparent; background: #EFF6FF; color: var(--blue); }
.chp-btn--primary { border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 600; }
.chp-btn--primary:hover { background: #1D4ED8; }
.chp-btn--sm { height: 26px; padding: 0 10px; font-size: 12px; }
.chp-dock__body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 16px 12px; }
.chp-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.chp-tabs button {
  flex: none; padding: 8px 2px 9px; border: 0; border-bottom: 2px solid transparent; background: none;
  font-size: 13px; color: var(--a-text); cursor: pointer; white-space: nowrap;
}
.chp-tabs button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--a-ink); font-weight: 600; }
.chp-dock__msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--a-chip); font-size: 12.5px; color: var(--a-text); }
.chp-dock__msg[hidden] { display: none; }
.chp-pane { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; padding-top: 10px; overflow-y: auto; }
.chp-pane[hidden] { display: none; }
.chp-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); flex: none; padding: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.chp-kpi { display: grid; gap: 4px; padding: 0 16px; border-left: 1px solid var(--line); min-width: 0; }
.chp-kpi:first-child { border-left: 0; }
.chp-kpi small { font-size: 11.5px; color: var(--a-muted); }
.chp-kpi b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chp-kpi b.chg--up { color: var(--a-up); }
.chp-kpi b.chg--down { color: var(--a-down); }
.chp-blue { color: var(--blue); }
.chp-eq { display: flex; flex-direction: column; flex: 1; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.chp-eq__head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.chp-eq__growth { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.chp-eq__growth.is-up { background: #ECFDF5; color: var(--a-up); }
.chp-eq__growth.is-down { background: #FEF2F2; color: var(--a-down); }
.chp-eq__growth:empty { display: none; }
.chp-eq__chart { position: relative; flex: 1; min-height: 80px; }
.chp-tscroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.chp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.chp-table th { position: sticky; top: 0; padding: 8px 10px; background: var(--a-panel); font-size: 11px; font-weight: 600; color: var(--a-muted); text-align: left; text-transform: uppercase; white-space: nowrap; }
.chp-table td { padding: 8px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.chp-table tbody tr[data-goto] { cursor: pointer; }
.chp-table tbody tr[data-goto]:hover, .chp-table tbody tr[data-goto]:focus { background: #F4F7FF; outline: 0; }
.chp-table tr.is-current { background: #F4F7FF; }
.chp-table .chp-empty td { padding: 18px; color: var(--a-muted); text-align: center; white-space: normal; }
.chp-strong { font-weight: 600; }
.chp-dir { display: inline-block; padding: 2px 7px; border-radius: 4px; font: 700 10px/1.4 var(--font-mono); letter-spacing: .02em; }
.chp-dir--long { background: #ECFDF5; color: var(--up); }
.chp-dir--short { background: #FEF2F2; color: var(--down); }
.chp-setgrid { display: grid; grid-template-columns: 200px 200px minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.chp-cfg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 12.5px; }
.chp-cfg dt { color: var(--a-muted); }
.chp-cfg dd { margin: 0; font-weight: 500; }
.chp-pane > .chp-btn { width: fit-content; }

.chp-status {
  display: flex; align-items: center; gap: 14px; flex: none; min-height: 30px; padding: 0 12px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--a-muted); overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.chp-status::-webkit-scrollbar { display: none; }
.chp-status__gap { flex: 1; }
/* 3 cột: trái (trạng thái, nguồn) | giữa (phím tắt) | phải (khối lượng, giờ): chữ trạng thái đổi độ dài không đẩy phím tắt (người dùng 2026-10-28) */
.chp-status { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.chp-status__l { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chp-status__r { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.chp-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--a-up); }
.chp-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chp-live[data-mode="live"] i { animation: chp-pulse 1.6s infinite; }
.chp-live[data-mode="off"] { color: var(--a-down); }
.chp-live[data-mode="loading"], .chp-live[data-mode="mt"] { color: var(--a-text); }
@keyframes chp-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chp-live[data-mode="live"] i { animation: none; } }
/* Dòng phím tắt: mỗi phím 1 nhóm (phím + chữ), cách đều, cùng 1 đường giữa (người dùng 2026-10-25: sát, cao thấp lệch) */
.chp-keys { display: inline-flex; align-items: center; gap: 14px; }
.chp-key { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.chp-keys kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; font: 600 10px/1 var(--font-mono); color: var(--a-text); }

aside.chp-side {
  display: grid; grid-template-rows: minmax(120px, var(--top, 55%)) 7px minmax(140px, 1fr); min-width: 0; min-height: 0;
  padding: 0; border-radius: 0; background: #fff; font: inherit; letter-spacing: 0;
}
/* Mỗi nửa bảng bên cuộn riêng (danh sách mã | giao dịch) */
.chp-sp { display: flex; flex-direction: column; min-height: 0; }
.chp-sp__body { flex: 1; min-height: 0; padding: 10px 14px; overflow-y: auto; }
.chp-sp__body [hidden] { display: none; }
.chp-split { position: relative; background: var(--a-chip); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: row-resize; touch-action: none; }
.chp-split::after { content: ""; position: absolute; top: 2px; left: 50%; width: 32px; height: 1px; margin-left: -16px; border-top: 1px solid #C4C2BC; border-bottom: 1px solid #C4C2BC; }
.chp-split:hover, .chp-split:focus-visible { background: #EFF6FF; outline: 0; }
.chp-sp__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.chp-sp__head h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.chp-acsel { position: relative; flex: 1; max-width: 250px; font-size: 12px; color: var(--a-text); }
.chp-acsel[hidden] { display: none; }
.chp-acsel .dd-btn { width: 100%; max-width: 250px; height: 30px; padding: 0 24px 0 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.chp-acsel .dd-btn::after { content: ""; position: absolute; right: 9px; top: 10px; width: 6px; height: 6px; border: solid var(--a-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
/* Tài khoản kiểu MT5 trên điện thoại: nhãn trái, số phải */
.chp-acct { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0 -14px; padding: 10px 14px 4px; border-top: 1px solid var(--line); font-size: 12.5px; }
.chp-sec.chp-sec--top { margin: 0 0 6px; color: #7C3AED; }
.chp-acct[hidden] { display: none; }
.chp-acct dt { color: var(--a-text); }
.chp-acct dd { margin: 0; font-weight: 600; text-align: right; }
.chp-acct dd.chg--up { color: var(--up); }
.chp-acct dd.chg--down { color: var(--down); }
/* Lệnh đang mở kiểu MT5 trên điện thoại */
.chp-mpos { margin: 0 -14px; padding: 0; list-style: none; }
.chp-mpos__row { padding: 8px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.chp-mpos__row:hover, .chp-mpos__row:focus-visible { background: #F4F7FF; outline: 0; }
.chp-mpos__l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.chp-mpos__name b { font-weight: 600; }
.chp-mpos__buy { color: #2563EB; }
.chp-mpos__sell { color: var(--down); }
.chp-mpos__pnl { font-size: 13px; }
.chp-mpos__pnl.chg--up { color: #2563EB; }
.chp-mpos__pnl.chg--down { color: var(--down); }
.chp-mpos__l2 { margin-top: 2px; font-size: 12px; color: var(--a-text); }
.chp-mpos__more { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--a-text); }
.chp-mpos__more .num { text-align: right; color: var(--a-ink); }
.chp-mpos__more .chp-link { justify-self: end; }
.chp-mpos .chp-empty { padding: 10px 14px; border-top: 1px solid var(--line); }
.chp-side__tabs { display: flex; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.chp-side__tabs button {
  display: inline-flex; align-items: center; gap: 6px; padding: 14px 0 12px; border: 0; border-bottom: 2px solid transparent; background: none;
  font-size: 13.5px; color: var(--a-text); cursor: pointer;
}
.chp-side__tabs button .icon { width: 14px; height: 14px; }
.chp-side__tabs button[aria-selected="true"] { border-bottom-color: var(--a-ink); color: var(--a-ink); font-weight: 600; }
.chp-side__badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 5px; padding: 0 4px; border-radius: 100px; background: var(--blue); font: 700 10px/1 var(--font-mono); font-style: normal; color: #fff; }
.chp-side__badge[hidden] { display: none; }
[data-sigf] .chp-sig.is-cur { box-shadow: inset 2px 0 0 var(--blue); }
.chp-sig__st { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.chp-sig__st > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-sigf] .chp-sig__bot small { flex: none; white-space: nowrap; }
.chp-sig__pet { flex: none; width: 18px; height: 18px; border-radius: 5px; }
.chp-find--side { margin-bottom: 4px; }
.chp-sec { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; font-size: 11px; font-weight: 600; color: var(--a-muted); text-transform: uppercase; }
.chp-link { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--blue); text-transform: none; cursor: pointer; }
.chp-link:disabled { color: var(--a-muted); cursor: default; }
.chp-wl { display: grid; margin: 0 -6px; padding: 0; list-style: none; }
.chp-wl__row { position: relative; display: flex; align-items: center; border-radius: 8px; }
/* Rê chuột: xám trung tính; đang chọn: xanh (người dùng 2026-10-25: cùng 1 màu nên 2 dòng cạnh nhau trông như lỗi) */
.chp-wl__row:hover { background: #F5F5F4; }
.chp-wl__row.is-current { background: #EFF6FF; }
.chp-wl__btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 7px 8px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.chp-wl__name { display: grid; min-width: 0; }
.chp-wl__name b { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.chp-ic[data-fav][aria-pressed="true"] { background: transparent; color: #F59E0B; }
.chp-ic[data-fav][aria-pressed="true"] .icon { fill: #F59E0B; }
.chp-wl__pin { flex: none; width: 11px; height: 11px; color: #F59E0B; fill: #F59E0B; }
.chp-wl__row.is-current .chp-wl__name b { color: var(--blue); }
.chp-wl__name small { font-size: 10.5px; color: var(--a-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chp-wl__px { display: grid; justify-items: end; flex: none; }
.chp-wl__px b { font-size: 12.5px; font-weight: 600; }
.chp-wl__px small { font-size: 10.5px; }
.chp-wl__rm { position: absolute; top: 50%; right: 4px; opacity: 0; transform: translateY(-50%); background: #fff; box-shadow: 0 1px 3px rgba(26, 26, 26, .15); }
.chp-wl__grip { display: grid; place-items: center; flex: none; width: 16px; height: 30px; margin-left: 2px; padding: 0; border: 0; background: none; color: var(--a-muted); cursor: grab; opacity: 0; touch-action: none; }
.chp-wl__grip .icon { width: 14px; height: 14px; }
.chp-wl__row:hover .chp-wl__grip, .chp-wl__grip:focus-visible { opacity: 1; }
.chp-wl__row.is-sortable .chp-wl__btn { padding-left: 2px; }
.chp-wl.is-sorting { user-select: none; -webkit-user-select: none; }
.chp-wl.is-sorting .chp-wl__rm { display: none; }
.chp-wl.is-sorting .chp-wl__row { transition: transform .15s ease; }
.chp-wl.is-sorting .chp-wl__row.is-drag { transition: none; }
.chp-wl__row.is-drag { background: #EFF6FF; box-shadow: 0 6px 18px rgba(37, 99, 235, .2); z-index: 2; cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .chp-wl.is-sorting .chp-wl__row { transition: none; } }
.chp-wl__row.is-drag .chp-wl__grip { opacity: 1; cursor: grabbing; }
@media (hover: none) { .chp-wl__grip { opacity: .6; } }
.chp-wl__row:hover .chp-wl__rm, .chp-wl__rm:focus { opacity: 1; }
.chp-empty { padding: 10px 4px; font-size: 12px; line-height: 1.45; color: var(--a-muted); list-style: none; }
.chp-sigs, .chp-pos { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chp-sig, .chp-posrow { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--a-chip); cursor: pointer; }
.chp-posrow { cursor: default; border: 1px solid var(--line); background: #fff; }
.chp-sig.is-skipped { opacity: .6; }
.chp-sig__top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chp-sig .chp-sig__top .chp-dir { margin-left: auto; }
.chp-posrow .chp-posrow__pnl { margin-left: auto; font-size: 13px; }
.chp-sig__ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #fff; }
.chp-sig__ic .icon { width: 14px; height: 14px; }
.chp-sig__ic--long { color: var(--up); }
.chp-sig__ic--short { color: var(--down); }
.chp-sig__bot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--a-text); }
.chp-sig__bot small { font-size: 11px; color: var(--a-muted); }
.chp-posrow__close { justify-self: end; font-size: 11.5px; }
.chp-order { display: grid; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.chp-order__head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.chp-order__qty { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 8px; background: var(--a-chip); font-size: 12px; color: var(--a-muted); }
.chp-order__qty input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 600 13px var(--font-mono); text-align: right; color: var(--a-ink); }
.chp-order__qty i { font-style: normal; font-size: 12px; color: var(--a-text); }
.chp-order__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chp-buy, .chp-sell { height: 40px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; color: #fff; cursor: pointer; }
.chp-buy { background: var(--up); }
.chp-sell { background: var(--down); }
.chp-buy:hover, .chp-sell:hover { filter: brightness(.95); }
.chp-order__note { font-size: 10.5px; line-height: 1.4; color: #FF00FF; }

@media (max-width: 1360px) {
  .chp { grid-template-columns: 48px minmax(0, 1fr) 280px; }
  .chp-kpi { padding: 0 10px; }
  .chp-kpi b { font-size: 15px; }
  .chp-keys { display: none; }
}
@media (max-width: 1100px) {
  .chp-body { overflow: auto; }
  .chp { display: flex; flex-direction: column; height: auto; }
  .chp-rail { flex-direction: row; justify-content: flex-start; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; order: 1; }
  .chp-rail__sep { width: 1px; height: 22px; margin: 0 4px; }
  .chp-main { display: contents; }
  .chp-bar { order: 0; }
  .chp-plot { order: 3; flex: none; height: 62vh; min-height: 320px; }
  .chp-status { order: 4; }
  .chp-dock { order: 5; height: auto; }
  .chp-dock .chp-pane { overflow: visible; }
  .chp-eq { min-height: 200px; }
  aside.chp-side { order: 6; display: block; border-top: 8px solid var(--a-bg); }
  .chp-sp__body { overflow: visible; }
  .chp-split { display: none; }
  .chp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .chp-kpi:nth-child(4) { border-left: 0; }
  .chp-setgrid { grid-template-columns: 1fr 1fr; }
  .chp-cfg { grid-column: 1 / -1; }
  .chp-menu { width: min(360px, calc(100vw - 24px)); }
  .chp-menu--set { width: 220px; }
}
@media (max-width: 560px) {
  .chp-plot { height: 56vh; }
  .chp-ohlc { display: none; }
  .chp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chp-kpi:nth-child(odd) { border-left: 0; }
  .chp-kpi:nth-child(4) { border-left: 1px solid var(--line); }
  .chp-dock__body { padding: 0 12px 12px; }
}
.chp-dock__msg--fwd { margin: 0; background: #EFF6FF; color: var(--blue); }
.chp-dock__msg--fwd[hidden] { display: none; }
.chp-acct__note { margin: 4px 0 2px; font-size: 11.5px; color: var(--a-muted); }
.chp-acct__note[hidden] { display: none; }
.chp-acct__note.is-off { color: #D97706; font-weight: 600; }
/* Lỗi khi lưu: liệt kê mọi mục còn thiếu; ô thiếu viền đỏ */
.snew__error strong { display: block; margin-bottom: 4px; font-weight: 600; }
.snew__error ul { margin: 0; padding-left: 18px; list-style: disc; }
.dd-btn[aria-invalid="true"], .rsel--pat[aria-invalid="true"], .addrule[aria-invalid="true"] { border-color: var(--a-down) !important; }
.acct:has(.dd-btn[aria-invalid="true"]) { border-color: var(--a-down); }

/* Ô khung của điều kiện khi chưa chọn khung giao dịch */
.rsel--tf.rsel--locked .dd-btn:disabled { color: var(--a-muted); justify-content: center; }

/* Tao chien luoc - thiet ke 4 buoc (Pendev): tieu de buoc khong icon, buoc 3 chia 3 muc */
.snew .sstep__n { color: var(--a-muted); font-weight: 600; }
.snew .scard__title h2 { font-size: 17px; }
.snew__auto[hidden] { display: none; }
.sside__opt { display: flex !important; width: 100%; align-items: center; justify-content: center; gap: 6px; }
.sside__opt .icon { flex: none; width: 13px; height: 13px; }
.sside__opt--long .icon { color: var(--a-up); }
.sside__opt--short .icon { color: var(--a-down); }
.sseg.sside__seg { width: min(340px, 100%); }
.sside:has(.sside__hint:empty) { display: none; }
.snew .scard__head:has(.sside__seg) { padding-bottom: 14px; border-bottom: 1px solid var(--a-line); }
.sside { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.addrule--link { align-self: center; height: 34px; padding: 0 12px; border: 0; background: none; }
.addrule--link:hover { background: #EFF6FF; }
.sinds .addrule--link { width: auto; margin: 10px auto 0; }
.sinds { display: flex; flex-direction: column; border-top-style: solid; }

.sexit__h { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--a-ink); }
.sexit__sub { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.sexit__sl { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 24px; align-items: start; }
.sexit__col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.slrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; }
.sjoin { display: flex; align-items: stretch; height: 42px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; }
.sjoin:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.sjoin:has([aria-invalid="true"]) { border-color: var(--a-down); }
.sjoin > * { flex: 1 1 0; min-width: 0; }
.sjoin > * + * { border-left: 1px solid var(--a-line); }
.sjoin > [hidden] { display: none; }
.sjoin .rsel .dd-btn { height: 40px; border: 0; background: none; box-shadow: none !important; }
.sjoin .rsel > .icon { top: 13px; }
.sjoin .rsel.is-disabled > .icon { display: none; }
.sjoin .rsel .dd-btn:disabled { background: none; color: var(--a-text); }
.snew .sjoin input, .snew .tf .sjoin input { height: 40px; padding: 0 12px; border: 0; border-radius: 0; background: none; box-shadow: none; font: 600 13px/1.4 var(--font-body); color: var(--a-ink); text-align: right; }
.snew .sjoin > input + * { border-left: 1px solid var(--a-line); }
/* Trailing: vạch ngăn giữa ô chọn kiểu và ô giá trị (người dùng yêu cầu); đơn vị vẫn liền với giá trị */
.snew .sjoin > .rsel + input { border-left: 1px solid var(--a-line); }
.sjoin__unit { flex: 0 0 auto; display: grid; place-items: center; padding: 0 12px; border-left: 0 !important; font-size: 13px; color: var(--a-ink); white-space: nowrap; }
.sjoin__cell { display: flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 13px; color: var(--a-ink); }
.sjoin__cell i { flex: none; font-style: normal; }
.snew .sjoin__cell input { flex: 1 1 0; width: 0; min-width: 0; padding: 0; text-align: left; font-weight: 400; }
.spart, .sparts { min-width: 0; }
.spart > .sjoin { min-width: 0; }
.strail { display: flex; flex-direction: column; gap: 6px; margin-top: -4px; }
.strail[hidden] { display: none; }
.strail__type { flex: 2 1 0 !important; }
.strail__ind { flex: 2 1 0 !important; }
.strail__from { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; }
.strail__from[hidden] { display: none; }
.slimits { margin-top: 14px; }
.slillus { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px 10px 6px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-panel); }
.slillus figcaption { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 2px 4px 4px; text-align: center; }
.slillus b { font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--a-ink); }
.slillus small { font-size: 11px; line-height: 1.45; color: var(--a-muted); }
.slillus svg { display: block; width: 100%; height: auto; }
.slillus__t { font: 600 9px var(--font-body); fill: #6B7280; }
.slillus__t--blue { fill: var(--blue); }
.slillus__t--red { fill: #DC2626; }
.stp { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; }
.stp [hidden] { display: none; }
.sparts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sparts:empty { display: none; }
.spart { display: grid; grid-template-columns: 56px minmax(0, 1fr) 32px; align-items: center; gap: 10px; }
.spart__n { font-size: 12.5px; color: var(--a-text); }
.spart .sjoin__cell:first-child { flex: 2.4 1 0; }
.sparts__note { margin: 0; font-size: 11.5px; color: #D97706; }
.sparts__note[hidden] { display: none; }
.sparts__note.is-over { color: var(--a-down); font-weight: 600; }
.sother .rules:empty { display: none; }
@media (max-width: 1280px) { .sexit__sl { grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; } }
@media (max-width: 900px) {
  .sexit__sl, .slrow, .stp { grid-template-columns: minmax(0, 1fr); }
  .slillus { max-width: 320px; }
  .spart { grid-template-columns: minmax(0, 1fr) 32px; }
  .spart__n { grid-column: 1 / -1; }
}

/* Chien luoc nhieu ma: o tich trong bang chon ma, danh sach ma da chon, bang ket qua tung ma */
.symdd__tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 6px; }
.symdd__tools button { padding: 4px 6px; border: 0; border-radius: 6px; background: none; font-size: 12px; font-weight: 600; color: var(--blue); cursor: pointer; }
.symdd__tools button:hover { background: #EFF6FF; }
.symdd__tools button[hidden] { display: none; }
.symdd__tools [data-symclear] { margin-left: auto; color: var(--a-text); }
.symdd__chk { flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-right: 2px; border: 1.5px solid #C9CDD4; border-radius: 4px; background: #fff; color: transparent; }
.symdd__chk .icon { width: 11px; height: 11px; stroke-width: 3; }
.symdd__opt[aria-selected="true"] { background: #EFF6FF; }
.symdd__opt[aria-selected="true"] strong { color: var(--blue); }
.symdd__opt[aria-selected="true"] .symdd__chk { border-color: var(--blue); background: var(--blue); color: #fff; }
.symcombo__more { position: absolute; right: 34px; bottom: 10px; padding: 2px 8px; border-radius: 100px; background: #EFF6FF; font-size: 11.5px; font-style: normal; font-weight: 600; color: var(--blue); pointer-events: none; }
.symcombo__more[hidden] { display: none; }
.symchips { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.symchips[hidden] { display: none; }
.symchips__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.symchips__list li { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 100px; background: var(--a-chip); font-size: 12px; font-weight: 600; color: var(--a-ink); }
.symchips__list li:first-child { background: #EFF6FF; color: var(--blue); }
.symchips__list button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--a-muted); cursor: pointer; }
.symchips__list button:hover { background: #FEF2F2; color: var(--a-down); }
.symchips__list button .icon { width: 12px; height: 12px; }
.symchips__warn { margin: 0; font-size: 11.5px; color: #D97706; }
.symchips__warn[hidden] { display: none; }
.sdgroup { margin-top: 14px; }
.sdgroup[hidden] { display: none; }
.sdgroup__wrap { overflow-x: auto; }
.sdgroup__table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.sdgroup__table th, .sdgroup__table td { padding: 10px 12px; border-bottom: 1px solid var(--a-line); text-align: right; white-space: nowrap; }
.sdgroup__table th:first-child, .sdgroup__table td:first-child { text-align: left; }
.sdgroup__table thead th { font-size: 11.5px; font-weight: 600; color: var(--a-muted); }
.sdgroup__table tbody th { font-weight: 600; color: var(--a-ink); }
.sdgroup__table tbody tr[data-sym] { cursor: pointer; }
.sdgroup__table tbody tr[data-sym]:hover, .sdgroup__table tbody tr[data-sym]:focus-visible { background: var(--a-panel); outline: none; }
.sdgroup__table tbody tr.is-current { background: #EFF6FF; }
.sdgroup__table tbody tr.is-current th { color: var(--blue); }
.sdgroup__table td.is-up { color: var(--a-up); font-weight: 600; }
.sdgroup__table td.is-down { color: var(--a-down); font-weight: 600; }
.sdgroup__table td.sdgroup__wait { text-align: left; color: var(--a-muted); white-space: normal; }
.sdgroup__total th, .sdgroup__total td { border-bottom: 0; font-weight: 700; background: var(--a-panel); }
.sdgroup__note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--a-muted); }

/* Buoc 3: cong tac tu dong theo dieu kien vao lenh */
.sauto { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--a-ink); cursor: pointer; }
.sauto__note { margin: -4px 0 0; padding: 10px 14px; border-radius: 8px; background: #EFF6FF; font-size: 12px; line-height: 1.5; color: #4B5E80; }

/* Hinh minh hoa lenh mau (canvas) */
.slillus { min-width: 0; }
.slillus__cv { position: relative; flex: 1 1 auto; width: 100%; min-height: 150px; }
.slillus__cv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.slillus__legend { text-align: center; padding: 0 2px 4px; }

.slillus.is-empty { align-items: center; justify-content: center; min-height: 0; padding: 20px; text-align: center; border-style: dashed; }
.slillus.is-empty b { color: var(--a-text); }
.sjoin input:disabled { color: var(--a-muted); }

/* Hinh minh hoa cao bang cot Dung lo ben trai (khong day cao khoi), man hinh hep thi cao co dinh */
.sexit__sl { align-items: stretch; }
.slillus { padding: 10px 10px 8px; }
@media (max-width: 900px) { .slillus__cv { flex: none; height: 200px; } .slillus.is-empty { min-height: 140px; } }

.rval__t--hint { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.4; color: var(--a-muted); white-space: normal; }

.rval--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rval--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 900px) { .rval--3, .rval--2 { grid-template-columns: minmax(0, 1fr); } }

/* Chi bao da luu: chip bam de them vao chien luoc, x de xoa */
.indsaved { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--a-line); }
.indsaved[hidden] { display: none; }
.indsaved__t { font-size: 12px; font-weight: 600; color: var(--a-text); }
.indsaved__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.indsaved__list li { display: inline-flex; align-items: center; height: 28px; border-radius: 100px; background: var(--a-chip); }
.indsaved__use { height: 28px; padding: 0 4px 0 12px; border: 0; border-radius: 100px 0 0 100px; background: none; font-size: 12px; font-weight: 600; color: var(--blue); cursor: pointer; }
.indsaved__use:hover:not(:disabled) { text-decoration: underline; }
.indsaved__use:disabled { color: var(--a-muted); cursor: default; }
.indsaved__rm { display: grid; place-items: center; width: 22px; height: 22px; margin-right: 3px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--a-muted); cursor: pointer; }
.indsaved__rm:hover { background: #FEF2F2; color: var(--a-down); }
.indsaved__rm .icon { width: 12px; height: 12px; }


/* Dropdown dung chung: nut x xoa 1 muc trong danh sach */
.dd-opt__rm { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: -2px -4px -2px 8px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--a-muted); cursor: pointer; }
.dd-opt__rm:hover, .dd-opt__rm:focus-visible { background: #FEF2F2; color: var(--a-down); outline: none; }
.dd-opt__rm .icon { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.slillus__rare { display: block; color: #B45309; }
.slillus__case { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--a-muted); }
.slillus__nav { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; color: var(--a-text); cursor: pointer; }
.slillus__nav:hover { border-color: var(--blue); color: var(--blue); }
.slillus__nav .icon { width: 13px; height: 13px; }

/* Minh hoa chien luoc o sidebar phai (tren Tom tat): muc Dung lo chiem het chieu ngang */
.sexit__sl { grid-template-columns: minmax(0, 1fr); }
.slillus--side { padding: 0; border: 0; background: none; }
.slillus--side .slillus__cv { flex: none; height: 250px; }
.slillus--side.is-empty { min-height: 120px; padding: 18px; border: 1px dashed var(--a-line); border-radius: 8px; }

/* Trang Tao chien luoc (man hinh rong): icon ghim o goc moi khoi sidebar, khoi duoc ghim neo lai khi cuon
   (sidebar keo dai bang cot trai de khoi co cho bam; cac khoi phia sau truot xuong duoi khoi ghim) */
.spin { display: none; place-items: center; width: 30px; height: 30px; margin-left: auto; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--a-muted); cursor: pointer; }
.spin .icon { width: 16px; height: 16px; transform: rotate(45deg); transition: transform .15s; }
.spin:hover { background: #F5F4F1; color: var(--a-ink); }
.spin[aria-pressed="true"] { background: #EFF6FF; color: var(--blue); }
.spin[aria-pressed="true"] .icon { transform: none; }
@media (min-width: 1101px) {
  .snew__side { align-self: stretch; }
  .spin { display: grid; }
  .spinbox { position: sticky; top: 72px; z-index: 5; display: flex; flex-direction: column; gap: 12px; }
  .scard.is-pinned { box-shadow: 0 6px 20px rgba(15, 23, 42, .08); }
}

/* Thu vien chien luoc mau (trang Tao chien luoc) */
.stpl__btn { gap: 6px; height: 28px; min-height: 28px; margin-left: auto; padding: 0 12px; font-size: 12px; }
.stpl__btn .icon { width: 14px; height: 14px; }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.tplcard { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.tplcard:hover { box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.tplcard--trend { --tc: #2563EB; --tb: #EFF6FF; }
.tplcard--revert { --tc: #D97706; --tb: #FEF3C7; }
.tplcard--breakout { --tc: #059669; --tb: #ECFDF5; }
.tplcard--pa { --tc: #7C3AED; --tb: #F5F3FF; }
.tplcard__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tplcard__pic { flex: none; width: 48px; height: 48px; border-radius: 16px; }

.tplcard__ttl { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tplcard__ttl b { font-size: 14.5px; font-weight: 600; color: var(--a-ink); line-height: 1.3; }
.tplcard__ttl small { font-size: 12.5px; line-height: 1.4; color: var(--a-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tplcard__tf { flex: none; align-self: flex-start; padding: 2px 7px; border-radius: 6px; background: var(--a-chip); font: 600 11px/1.5 var(--font-mono, ui-monospace, monospace); color: var(--a-text); }
.tplcard__how { font-size: 13px; line-height: 1.5; color: #3A3A3A; }
.tplcard__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; border-top: 1px dashed var(--a-line); font-size: 12px; color: var(--a-text); margin-top: auto; }
.tplcard__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.tplcard__meta .icon { width: 13px; height: 13px; color: var(--a-muted); }
.tplcard__tick { position: absolute; top: -7px; right: -7px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 0 0 2px #fff; }
.tplcard__tick .icon { width: 12px; height: 12px; }
.tplcard:has(input:checked) { box-shadow: 0 0 0 1px var(--blue); }
.tplcard:has(input:checked) .tplcard__tick { display: grid; }
.tplcard__sell { margin: 0; font-size: 12.5px; color: var(--a-down); }
.tplcard__sell[hidden] { display: none; }
@media (max-width: 640px) { .tplgrid { grid-template-columns: 1fr; } }
.pchips__n { margin-left: 2px; font-size: 11px; font-weight: 600; opacity: .55; }
.tplnote { display: flex; gap: 8px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--a-muted); }
.tplnote .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }

/* Minh hoa: o "Trong vong N nen" (cac su kien / cac buoc), doi la hinh ve lai */
.sillus__win { display: flex; justify-content: center; margin: -6px 0 10px; }
.sillus__win[hidden], .sillus__win .swin[hidden] { display: none; }
.swin { position: relative; display: inline-flex; width: auto; }
.swin .dd-btn { width: auto; min-width: 168px; height: 32px; padding: 0 32px 0 12px; font-size: 12.5px; font-weight: 500; }
.swin > .icon { right: 11px; bottom: 9px; width: 13px; height: 13px; }
/* Dropdown: dong nhap so ngay trong danh sach (option data-input) */
.dd-in { display: flex; align-items: center; gap: 8px; margin: 4px 6px 2px; padding-top: 6px; border-top: 1px solid var(--a-line); font-size: 13px; color: var(--a-muted); }
.dd-in input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--a-line); border-radius: 6px; font: 500 13px var(--font-body); color: var(--a-ink); }
.dd-in input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.dd-in input[aria-invalid="true"] { border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.lconfirm__foot--one { grid-template-columns: 1fr; display: grid; }
.slillus__tabs { display: inline-flex; gap: 6px; margin-bottom: 4px; }
.slillus__tab { min-width: 28px; height: 26px; padding: 0 8px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; font: 600 12px var(--font-body); color: var(--a-text); cursor: pointer; }
.slillus__tab:hover { border-color: var(--blue); color: var(--blue); }
.slillus__tab.is-on { border-color: var(--blue); background: var(--blue); color: #fff; }
.slillus__case { margin-top: 3px; }

/* Ô số có mũi tên tăng / giảm (strategy-new.js addStepper) */
.nstep { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 0; align-self: center; }
/* Ô số nằm trong khung chung (.ufield, .sjoin): khung đã có viền xanh khi đang nhập, ô không vẽ thêm viền focus của trình duyệt (MauHinh/43a-c) */
.ufield input:focus, .ufield input:focus-visible, .sjoin input:focus, .sjoin input:focus-visible, .sjoin__cell input:focus { outline: none; box-shadow: none; }
/* Ẩn, chỉ hiện khi rê chuột vào ô hoặc đang nhập (người dùng chê xấu khi luôn hiện) */
.nstep { opacity: 0; transition: opacity .12s; }
input:hover + .nstep, input:focus + .nstep, .nstep:hover, .nwrap:hover > .nstep, .nwrap:focus-within > .nstep { opacity: 1; }
.nstep button { display: grid; place-items: center; width: 18px; height: 14px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--a-muted); cursor: pointer; }
.nstep button:hover { background: var(--a-panel); color: var(--blue); }
.nstep button:active { background: #DBEAFE; }
.nstep .icon, .nstep svg { width: 12px; height: 12px; stroke-width: 2.5; }
.nwrap { position: relative; display: flex; min-width: 0; }
.nwrap > input { flex: 1; min-width: 0; width: 100%; padding-right: 26px !important; }
.nwrap > .nstep { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.nwrap--n { flex: none !important; width: 70px; }
.nwrap--n > input { text-align: center; padding-left: 4px !important; }
.snew .sjoin > .nstep { flex: none; padding-right: 6px; border-left: 0; }
.snew .sjoin > input + .nstep { border-left: 0; }
.snew .sjoin > .nstep + * { border-left: 1px solid var(--a-line); }
.snew .sjoin > input:has(+ .nstep) { padding-right: 4px; }
input:disabled + .nstep, input[hidden] + .nstep, .nwrap:has(input:disabled) > .nstep { visibility: hidden; }

@media (max-width: 560px) { .chp-rb .chp-rb__chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
