/* ==========================================================================
   css/trading-surfaces.css — BỀ MẶT GIAO DỊCH (Obsidian Dark, orchid #A86BD1)
   --------------------------------------------------------------------------
   Phạm vi: chỉ 5 route
     #/equity                    Bảng giá · phiếu lệnh · sổ lệnh trong ngày
     #/utilities/margin-repay    Trả nợ ký quỹ
     #/utilities/cash-advance    Ứng trước tiền bán
     #/utilities/money-transfer  Chuyển / nộp tiền
     #/utilities/product-register Đăng ký gói sản phẩm
   Mount contract (shell gắn):  #view-root[data-route="<hash thật>"]
   Fallback khi chưa kịp gắn data-route: :has(<id/class riêng của màn>)
     #wt-ticket · #wt-mr-form · #wt-ca-form · #wt-tf-from · #wt-pr-confirm
   Chỉ CSS. Không đổi route/action/id, không thêm dữ liệu hay nội dung.
   Bề mặt: hàng bảng tối, input/select/checkbox dark scheme, banner lỗi/cảnh
   báo dạng tinted, biên lai tối. Không còn mảng trắng hay checkbox trắng.
   File được link SAU css chính; module còn tự chèn <style id="wt-screens-style">
   sau đó, nên mọi rule ở đây đều có tiền tố #view-root (hoặc id) để thắng
   cascade. Chỉ 2 chỗ phải dùng !important: pill "giá chốt" (inline style của
   live-quotes) và viền biên lai (module đặt !important).
   ========================================================================== */

/* ==========================================================================
   0. TOKENS THEO MÀN — kế thừa token shell, fallback Obsidian Dark
   ========================================================================== */

#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) {
  --ts-ink: var(--tps-text, #FCFCFE);
  --ts-ink-2: var(--tps-text-2, #CFD5DE);
  --ts-muted: var(--tps-muted, #8E95A2);
  --ts-line: var(--tps-border, rgba(252, 252, 254, .09));
  --ts-line-soft: var(--tps-border-soft, rgba(252, 252, 254, .055));
  --ts-surface: var(--tps-surface, rgba(10, 15, 20, .86));
  --ts-surface-2: var(--tps-surface-2, rgba(15, 22, 29, .90));
  --ts-warm: var(--tps-bg, #03080A);
  --ts-plum: var(--tps-accent, #A86BD1);
  --ts-plum-deep: var(--tps-accent-deep, #7B3FA3);
  --ts-plum-soft: var(--tps-accent-soft, rgba(168, 107, 209, .14));
  --ts-plum-line: var(--tps-accent-line, rgba(168, 107, 209, .36));
  --ts-up: var(--tps-up, #25D38A);
  --ts-down: var(--tps-down, #FF6B6B);
  --ts-ref: var(--tps-ref, #F2C94C);
  --ts-ceil: var(--tps-ceiling, #D982FF);
  --ts-floor: var(--tps-floor, #38D9E8);
  --ts-num: var(--tps-font-num, ui-monospace, "Cascadia Mono", Consolas, monospace);
  --ts-ring: 0 0 0 3px rgba(168, 107, 209, .18);
  --ts-shadow: 0 1px 2px rgba(0, 0, 0, .40), 0 14px 34px rgba(0, 0, 0, .32);
  --ts-err: #FFA3A3;
  --ts-err-bg: rgba(255, 107, 107, .12);
  --ts-err-line: rgba(255, 107, 107, .34);
  --ts-warn-ink: #F7D778;
  --ts-warn-bg: rgba(242, 201, 76, .12);
  --ts-warn-line: rgba(242, 201, 76, .34);
  color: var(--ts-ink);
  color-scheme: dark;
  accent-color: #A86BD1;
}

/* Nhịp dọc của trang: đầu màn → lưới số liệu → card */
#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) > .tps-page-head {
  margin-bottom: 16px;
}

/* Card cấp trang (sổ lệnh, món giải ngân, lệnh bán, xác nhận) */
#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) > .tps-card {
  border-color: var(--ts-line);
  box-shadow: var(--ts-shadow);
}

#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) > .tps-card > .tps-card__head {
  background: var(--ts-surface);
  border-bottom-color: var(--ts-line-soft);
}

/* ==========================================================================
   1. SỐ LIỆU — typography số, không nhảy cột
   ========================================================================== */

#view-root:is([data-route="#/equity"], [data-route="#/utilities/cash-advance"], :has(#wt-ticket), :has(#wt-ca-form)) .tps-stat__value {
  font-family: var(--ts-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -.35px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

#view-root:is([data-route="#/equity"], [data-route="#/utilities/cash-advance"], :has(#wt-ticket), :has(#wt-ca-form)) .tps-stat__label {
  letter-spacing: .6px;
}

/* Dải chỉ số thị trường trên Bảng giá */
#view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 {
  gap: 12px;
  margin-bottom: 16px;
}

#view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat {
  padding: 12px 14px;
  background: var(--ts-surface);
  border-color: var(--ts-line-soft);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .24);
}

#view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat__value {
  font-size: 17px;
}

#view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat__value.is-up {
  color: var(--ts-up);
}

#view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat__value.is-down {
  color: var(--ts-down);
}

/* Số liệu màn Ứng tiền: “Số thực nhận” là con số quyết định */
#view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt {
  margin-bottom: 16px;
}

#view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt .tps-grid--3 {
  gap: 12px;
}

#view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt .tps-stat {
  padding: 14px 16px;
  background: var(--ts-surface);
  border-color: var(--ts-line-soft);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .24);
}

#view-root #wt-ca-net {
  color: var(--ts-plum);
  font-size: 21px;
  letter-spacing: -.5px;
}

/* ==========================================================================
   2. BỐ CỤC BẢNG GIÁ + PHIẾU LỆNH
   ========================================================================== */

#view-root .wt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
  align-items: start;
}

#view-root .wt-layout > * {
  min-width: 0;
}

#view-root .wt-card-priceboard {
  overflow: hidden;
}

/* Link “giá chốt” do live-quotes chèn bằng inline style nền tối — hạ về nền sáng */
#view-root #wt-pb-live {
  border-color: var(--ts-line) !important;
  color: var(--ts-muted) !important;
  background: var(--ts-surface-2);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. BẢNG GIÁ — canh cột, màu tăng/giảm + dấu, dòng đang chọn
   ========================================================================== */

#view-root #wt-priceboard {
  width: 100%;
  font-size: 12px;
}

#view-root #wt-priceboard thead th {
  padding: 9px 10px;
  font-size: 9px;
  letter-spacing: .6px;
  background: var(--ts-surface-2);
  border-bottom: 1px solid var(--ts-line);
}

#view-root #wt-priceboard thead th:first-child {
  text-align: left;
  padding-left: 14px;
}

#view-root #wt-priceboard thead th.num {
  text-align: right;
}

#view-root #wt-priceboard tbody td {
  height: 40px;
  padding: 0 10px;
  border-bottom: 1px solid var(--ts-line-soft);
  white-space: nowrap;
}

#view-root #wt-priceboard tbody td:first-child {
  padding-left: 14px;
}

#view-root #wt-priceboard tbody tr:nth-child(even) {
  background: rgba(252, 252, 254, .016);
}

#view-root #wt-priceboard tbody tr:hover {
  background: rgba(168, 107, 209, .09);
}

#view-root #wt-priceboard tbody tr.is-selected {
  background: var(--ts-plum-soft);
}

#view-root #wt-priceboard tbody tr.is-selected td {
  border-bottom-color: rgba(168, 107, 209, .30);
}

#view-root #wt-priceboard tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--ts-plum);
}

#view-root #wt-priceboard td.sym {
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: .4px;
  color: var(--ts-ink);
}

/* Giá khớp: cột số nhưng JS chỉ gắn .wt-mono → canh phải tại đây */
#view-root #wt-priceboard td.wt-mono {
  text-align: right;
  font-family: var(--ts-num);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.1px;
}

#view-root #wt-priceboard td.num {
  font-family: var(--ts-num);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Thay đổi / %: đậm hơn để đọc nhanh, dấu +/- đã có trong dữ liệu */
#view-root #wt-priceboard td.num.is-up,
#view-root #wt-priceboard td.num.is-down {
  font-weight: 700;
}

#view-root #wt-priceboard td.num.is-ref {
  color: var(--ts-ref);
  font-weight: 600;
}

/* Trần / sàn: thêm nền nhạt để không phụ thuộc riêng vào màu chữ */
#view-root #wt-priceboard td.is-ceil {
  color: var(--ts-ceil);
  background: rgba(217, 130, 255, .10);
}

#view-root #wt-priceboard td.is-floor {
  color: var(--ts-floor);
  background: rgba(56, 217, 232, .10);
}

#view-root #wt-priceboard tbody tr {
  cursor: pointer;
}

#view-root #wt-priceboard tbody tr:active {
  background: rgba(168, 107, 209, .14);
}

/* ==========================================================================
   4. PHIẾU LỆNH — Mua/Bán, ô nhập số, sức mua, lỗi, focus
   ========================================================================== */

#view-root .wt-ticket-wrap .tps-card {
  border-color: var(--ts-line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 16px 36px rgba(168, 107, 209, .12);
}

#view-root #wt-ticket .tps-card__head {
  padding: 13px 16px;
}

#view-root #wt-ticket .tps-card__title {
  font-size: 13px;
  letter-spacing: .1px;
}

#view-root #wt-ticket .tps-card__body {
  padding: 14px 16px 16px;
}

/* Segmented Mua/Bán: nền chung, nút đang chọn đặc màu ngữ nghĩa */
#view-root .wt-tk-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--ts-line);
  border-radius: 11px;
  background: var(--ts-surface-2);
}

#view-root .wt-tk-side .tps-btn {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .2px;
  transition: background .15s, color .15s, box-shadow .15s;
}

#view-root .wt-tk-side .tps-btn.is-buy {
  color: var(--ts-up);
}

#view-root .wt-tk-side .tps-btn.is-sell {
  color: var(--ts-down);
}

#view-root .wt-tk-side .tps-btn.is-buy:not(.is-active):hover,
#view-root .wt-tk-side .tps-btn.is-sell:not(.is-active):hover {
  background: var(--ts-surface);
  border-color: var(--ts-line);
}

#view-root .wt-tk-side .tps-btn.is-buy.is-active {
  background: var(--ts-up);
  border-color: var(--ts-up);
  color: #04140C;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

#view-root .wt-tk-side .tps-btn.is-sell.is-active {
  background: var(--ts-down);
  border-color: var(--ts-down);
  color: #04140C;
  box-shadow: 0 2px 6px rgba(255, 107, 107, .28);
}

#view-root .wt-tk-side .tps-btn:focus-visible {
  outline: 2px solid var(--ts-plum);
  outline-offset: 2px;
}

#view-root #wt-ticket .wt-grid-2 {
  gap: 10px;
}

#view-root #wt-ticket .tps-field {
  gap: 6px;
}

#view-root #wt-ticket .tps-label {
  font-size: 9.5px;
  letter-spacing: .55px;
  color: var(--ts-muted);
}

#view-root #wt-ticket .tps-input {
  height: 40px;
  border-radius: 9px;
  font-size: 13.5px;
  background: var(--ts-surface);
}

#view-root #wt-ticket .tps-input:hover {
  border-color: rgba(252, 252, 254, .18);
}

#view-root #wt-ticket .tps-input:focus {
  border-color: var(--ts-plum);
  box-shadow: var(--ts-ring);
}

/* Hint trong các bề mặt này đậm hơn mức muted mặc định để đọc trên nền trắng */
#view-root #wt-ticket .wt-hint:not(.wt-hint--warn),
#view-root .wt-form .wt-hint:not(.wt-hint--warn),
#view-root .wt-product-card .wt-hint:not(.wt-hint--warn) {
  color: #9AA2AF;
}

#view-root #wt-tk-symbol {
  font-family: var(--ts-num);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#view-root #wt-tk-price,
#view-root #wt-tk-volume {
  font-family: var(--ts-num);
  font-size: 14.5px;
  font-weight: 650;
  text-align: right;
  letter-spacing: .1px;
}

/* Sức mua tối đa: dải thông tin nhẹ, số mận */
#view-root .wt-maxline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  margin: 12px 0 8px;
  padding: 9px 12px;
  border: 1px solid rgba(168, 107, 209, .28);
  border-radius: 9px;
  background: rgba(168, 107, 209, .07);
  font-size: 11px;
  color: var(--ts-muted);
}

#view-root .wt-maxline > span:first-child {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

#view-root .wt-maxline b {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  font-family: var(--ts-num);
  font-size: 13px;
  font-weight: 750;
  color: var(--ts-plum);
  white-space: nowrap;
}

#view-root .wt-maxline .wt-hint {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 10.5px;
  color: var(--ts-muted);
}

/* Gợi ý mã */
#view-root .wt-suggest {
  margin-top: 5px;
  border: 1px solid var(--ts-line);
  border-radius: 9px;
  background: var(--ts-surface);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .46);
}

#view-root .wt-suggest__item {
  padding: 9px 11px;
  border-bottom: 1px solid var(--ts-line-soft);
  font-size: 12.5px;
}

#view-root .wt-suggest__item:last-child {
  border-bottom: 0;
}

#view-root .wt-suggest__item:hover {
  background: var(--ts-plum-soft);
}

#view-root .wt-suggest__sym {
  min-width: 46px;
  font-family: var(--ts-num);
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--ts-ink);
}

#view-root .wt-suggest__name {
  font-size: 11.5px;
  color: var(--ts-muted);
}

/* Nút gửi lệnh + hỏi AI */
#view-root #wt-ticket #wt-tk-submit {
  height: 44px;
  margin-top: 2px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: .1px;
}

#view-root #wt-ticket #wt-tk-submit:hover {
  background: #BE86E3;
  border-color: #BE86E3;
}

#view-root #wt-ticket #wt-tk-askai {
  display: flex;
  width: 100%;
  height: 36px;
  margin-top: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ts-plum);
  font-size: 12px;
  font-weight: 650;
}

#view-root #wt-ticket #wt-tk-askai:hover {
  background: var(--ts-plum-soft);
  border-color: transparent;
}

/* Lỗi trong phiếu lệnh: khối đọc được, không đẩy layout khi rỗng */
#view-root #wt-ticket .wt-field-error:not(:empty) {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ts-err-line);
  border-left: 3px solid var(--ts-down);
  border-radius: 8px;
  background: var(--ts-err-bg);
  font-size: 11.5px;
  color: var(--ts-err);
}

/* ==========================================================================
   5. SỔ LỆNH TRONG NGÀY
   ========================================================================== */

#view-root #wt-orders {
  width: 100%;
}

#view-root #wt-orders thead th {
  padding: 10px 14px;
  font-size: 9px;
}

#view-root #wt-orders tbody td {
  height: 44px;
  padding: 0 14px;
  font-size: 12px;
}

#view-root #wt-orders td.sym {
  font-family: var(--ts-num);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .5px;
}

#view-root #wt-orders td.num {
  font-family: var(--ts-num);
  font-variant-numeric: tabular-nums;
}

/* Cột Mua/Bán: nhãn chữ đậm, giữ nguyên nội dung MUA/BÁN */
#view-root #wt-orders td:nth-child(2) {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .5px;
}

#view-root #wt-orders td:nth-child(2).is-up {
  color: var(--ts-up);
}

#view-root #wt-orders td:nth-child(2).is-down {
  color: var(--ts-down);
}

#view-root #wt-orders tbody .tps-btn--sm {
  height: 27px;
  padding: 0 10px;
  font-size: 11px;
}

/* Xác nhận huỷ tại dòng */
#view-root .wt-inline-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 5px 4px 9px;
  border: 1px solid var(--ts-warn-line);
  border-radius: 8px;
  background: var(--ts-warn-bg);
}

#view-root .wt-inline-confirm .wt-hint {
  font-size: 10.5px;
  color: var(--ts-warn-ink);
}

/* ==========================================================================
   6. BIỂU MẪU (Trả nợ · Ứng tiền · Chuyển tiền)
   ========================================================================== */

#view-root .wt-form {
  gap: 14px;
}

#view-root .wt-form .tps-input {
  height: 40px;
  border-radius: 9px;
  font-size: 13.5px;
}

#view-root .wt-form .tps-input:hover {
  border-color: rgba(252, 252, 254, .18);
}

#view-root .wt-form .tps-input:focus {
  border-color: var(--ts-plum);
  box-shadow: var(--ts-ring);
}

#view-root .wt-form .tps-label {
  font-size: 9.5px;
  letter-spacing: .55px;
}

#view-root .wt-form .wt-grid-2 {
  gap: 12px;
}

#view-root .wt-grid-2 > .tps-field {
  min-width: 0;
}

/* Số tiền: chữ số thẳng cột, canh phải như sổ tài khoản */
#view-root #wt-mr-amount,
#view-root #wt-ca-amount,
#view-root #wt-tf-amount {
  font-family: var(--ts-num);
  font-size: 15px;
  font-weight: 650;
  text-align: right;
  letter-spacing: .1px;
}

/* Nút gợi ý số tiền: chip mận nhạt */
#view-root .wt-quick {
  gap: 8px;
}

/* Chip chỉnh số tiền nằm dưới ô nhập tiền (cột phải) trên desktop */
#view-root #wt-mr-form .wt-quick {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  #view-root #wt-mr-form .wt-quick {
    justify-content: flex-start;
  }

  #view-root .wt-quick .tps-btn {
    flex: 1 1 auto;
  }
}

#view-root .wt-quick .tps-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(168, 107, 209, .30);
  border-radius: 99px;
  background: var(--ts-plum-soft);
  color: var(--ts-plum);
  font-size: 11.5px;
  font-weight: 650;
}

#view-root .wt-quick .tps-btn:hover {
  border-color: rgba(168, 107, 209, .55);
  background: rgba(168, 107, 209, .24);
}

/* Checkbox */
#view-root .wt-check {
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ts-ink);
}

#view-root .wt-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ts-plum);
}

#view-root .wt-check input:focus-visible {
  outline: 2px solid var(--ts-plum);
  outline-offset: 2px;
}

/* Panel xem trước / biên lai dạng key-value */
#view-root .wt-preview {
  padding: 2px 14px;
  border: 1px solid var(--ts-line-soft);
  border-radius: 10px;
  background: var(--ts-surface-2);
}

/* Hai dòng cuối của preview là kết quả (dư nợ còn lại, Rtt sau trả) */
#view-root .wt-preview .wt-kv > :nth-last-child(-n + 4) {
  color: var(--ts-ink);
  font-weight: 700;
}

#view-root .wt-preview .wt-kv {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 14px;
  font-size: 12.5px;
}

#view-root .wt-preview .wt-kv__k {
  padding: 8px 0;
  border-bottom: 1px dashed var(--ts-line);
  color: var(--ts-muted);
  line-height: 1.45;
}

#view-root .wt-preview .wt-kv__v {
  padding: 8px 0;
  border-bottom: 1px dashed var(--ts-line);
  text-align: right;
  font-family: var(--ts-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#view-root .wt-preview .wt-kv > :nth-last-child(-n + 2) {
  border-bottom: 0;
}

#view-root .wt-preview .wt-hint {
  padding: 0 0 10px;
}

#view-root .wt-preview .wt-hint--warn {
  margin: 2px 0 10px;
}

/* Dòng nút gửi */
#view-root .wt-submit-row {
  margin-top: 4px;
  gap: 10px;
}

#view-root .wt-submit-row .tps-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

#view-root .wt-submit-row .tps-btn--primary:hover {
  background: #BE86E3;
  border-color: #BE86E3;
}

/* Lỗi biểu mẫu */
#view-root .wt-form > .wt-field-error:not(:empty),
#view-root #wt-ca-form .wt-field-error:not(:empty) {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--ts-err-line);
  border-left: 3px solid var(--ts-down);
  border-radius: 8px;
  background: var(--ts-err-bg);
  font-size: 11.5px;
  color: var(--ts-err);
}

/* Cảnh báo nghiệp vụ (quá hạn, thiếu tiền, chưa đủ điều kiện) */
#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) .wt-hint--warn {
  display: block;
  margin-top: 4px;
  padding: 5px 8px;
  border: 1px solid var(--ts-warn-line);
  border-radius: 6px;
  background: var(--ts-warn-bg);
  color: var(--ts-warn-ink);
  font-size: 10.5px;
  line-height: 1.45;
}

/* Biên lai: viền mận, không dùng viền xanh của module */
#view-root .wt-receipt {
  border-color: var(--ts-plum-line) !important;
  box-shadow: var(--ts-shadow);
}

#view-root .wt-receipt > .tps-card__head {
  background: rgba(252, 252, 254, .03);
  border-bottom-color: rgba(252, 252, 254, .06);
}

/* ==========================================================================
   7. BẢNG MÓN GIẢI NGÂN · LỆNH BÁN CHỜ THANH TOÁN
   ========================================================================== */

#view-root #wt-mr-loans,
#view-root #wt-ca-orders {
  width: 100%;
}

#view-root #wt-mr-loans thead th,
#view-root #wt-ca-orders thead th {
  padding: 10px 14px;
  font-size: 9px;
}

#view-root #wt-mr-loans tbody td,
#view-root #wt-ca-orders tbody td {
  height: 44px;
  padding: 0 14px;
  font-size: 12px;
}

#view-root #wt-mr-loans td.sym {
  font-family: var(--ts-num);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

#view-root #wt-ca-orders td.sym {
  font-family: var(--ts-num);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

#view-root #wt-ca-orders td:nth-child(2) {
  font-weight: 750;
  letter-spacing: .4px;
}

#view-root #wt-mr-loans td.num,
#view-root #wt-ca-orders td.num {
  font-family: var(--ts-num);
  font-variant-numeric: tabular-nums;
}

/* Badge trong bảng đứng cùng dòng số, cảnh báo xuống dòng riêng */
#view-root #wt-mr-loans tbody td .tps-badge {
  vertical-align: middle;
}

/* ==========================================================================
   8. CHUYỂN / NỘP TIỀN
   ========================================================================== */

#view-root .wt-2col {
  gap: 16px;
}

#view-root .wt-2col > .tps-card {
  border-color: var(--ts-line);
  box-shadow: var(--ts-shadow);
}

/* Thân card chuyển tiền không có .wt-form → tự tạo nhịp dọc */
#view-root .wt-2col > .tps-card > .tps-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#view-root .wt-2col > .tps-card > .tps-card__body {
  padding: 16px;
}

#view-root .wt-2col .wt-hint {
  color: #9AA2AF;
}

/* Số dư khả dụng của tiểu khoản nguồn: một dòng số phải đọc được, không phải ghi chú mờ */
#view-root #wt-tf-balance {
  margin-top: -2px;
  padding: 8px 10px;
  border: 1px solid var(--ts-line-soft);
  border-radius: 8px;
  background: var(--ts-surface-2);
  color: var(--ts-ink-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

#view-root #wt-tf-submit {
  height: 42px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

#view-root #wt-tf-submit:hover {
  background: #BE86E3;
  border-color: #BE86E3;
}

#view-root .wt-2col .tps-field {
  gap: 6px;
}

/* Phí ứng: dòng số phụ, canh cột số */
#view-root #wt-ca-fee {
  color: var(--ts-ink-2);
  font-variant-numeric: tabular-nums;
}

#view-root .wt-2col .tps-label {
  font-size: 9.5px;
  letter-spacing: .55px;
}

#view-root .wt-2col .tps-input {
  height: 40px;
  border-radius: 9px;
  font-size: 13.5px;
}

#view-root .wt-2col .tps-input:focus {
  border-color: var(--ts-plum);
  box-shadow: var(--ts-ring);
}

#view-root #wt-tf-note {
  font-size: 13px;
}

#view-root .wt-2col .wt-sep-line {
  height: 1px;
  margin: 14px 0;
  background: var(--ts-line-soft);
}

/* Khối tài khoản nhận tiền + QR */
#view-root .wt-bank-top {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 6px;
}

#view-root .wt-qr {
  flex: 0 0 auto;
  padding: 8px;
  border: 1px solid var(--ts-line);
  border-radius: 12px;
  background: #FCFCFE;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

#view-root .wt-qr svg {
  display: block;
  border-radius: 4px;
}

#view-root .wt-bank {
  min-width: 200px;
}

#view-root .wt-bank__row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--ts-line-soft);
}

#view-root .wt-bank__row:last-child {
  border-bottom: 0;
}

#view-root .wt-bank__row .wt-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--ts-muted);
}

#view-root .wt-bank__row b {
  text-align: left;
  font-family: var(--ts-num);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1px;
  color: var(--ts-ink);
  word-break: break-word;
}

/* Nội dung chuyển khoản + nút sao chép */
#view-root .wt-copy {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px dashed rgba(168, 107, 209, .32);
  border-radius: 9px;
  background: rgba(252, 252, 254, .03);
}

#view-root .wt-copy__text {
  font-family: var(--ts-num);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .9px;
  color: var(--ts-plum);
}

#view-root .wt-copy .tps-btn--sm {
  height: 28px;
  border-color: rgba(168, 107, 209, .36);
  color: var(--ts-plum);
  font-weight: 650;
}

/* Hướng dẫn nộp tiền */
#view-root .wt-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--ts-ink-2);
  line-height: 1.6;
}

#view-root .wt-steps li {
  margin: 4px 0;
}

#view-root .wt-steps li::marker {
  color: var(--ts-plum);
  font-weight: 700;
}

/* ==========================================================================
   9. ĐĂNG KÝ GÓI SẢN PHẨM
   ========================================================================== */

#view-root .wt-product-grid {
  gap: 12px;
}

/* 4 gói trong demo: 4 cột ở bề rộng đủ, 2 cột ở tablet */
@media (min-width: 1500px) {
  #view-root .wt-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1499px) and (min-width: 721px) {
  #view-root .wt-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#view-root .wt-product-card {
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--ts-line);
  border-radius: 12px;
  background: var(--ts-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .24);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

#view-root .wt-product-card:hover {
  border-color: rgba(168, 107, 209, .55);
  background: var(--ts-surface);
  box-shadow: 0 8px 22px rgba(168, 107, 209, .12);
  transform: translateY(-1px);
}

#view-root .wt-product-card.is-selected {
  border-color: var(--ts-plum);
  background: rgba(168, 107, 209, .10);
  box-shadow: 0 0 0 2px rgba(168, 107, 209, .16);
}

#view-root .wt-product-card.is-selected:hover {
  transform: none;
}

#view-root .wt-product-card h4 {
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.35;
  color: var(--ts-ink);
}

#view-root .wt-product-card .tps-badge {
  flex: 0 0 auto;
}

#view-root .wt-product-card__meta {
  font-family: var(--ts-num);
  font-size: 10.5px;
  letter-spacing: .2px;
  color: var(--ts-muted);
}

#view-root .wt-product-card__rate {
  margin: 2px 0 0;
  font-family: var(--ts-num);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.4px;
  color: var(--ts-plum);
  line-height: 1.2;
}

#view-root .wt-product-card .wt-hint {
  font-size: 11.5px;
}

#view-root .wt-cond {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ts-muted);
}

#view-root .wt-cond li {
  margin: 3px 0;
}

#view-root .wt-cond li::marker {
  color: #BC8AE0;
}

#view-root .wt-product-grid + .wt-hint {
  margin-top: 12px;
}

/* Panel xác nhận đăng ký */
#view-root #wt-pr-confirm.tps-card > .tps-card__head {
  background: rgba(252, 252, 254, .03);
  border-bottom-color: rgba(252, 252, 254, .06);
}

#view-root #wt-pr-confirm .tps-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#view-root #wt-pr-confirm .wt-kv {
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 6px 14px;
  font-size: 12.5px;
}

#view-root #wt-pr-confirm .wt-kv__k {
  color: var(--ts-muted);
}

#view-root #wt-pr-confirm .wt-kv__v {
  font-family: var(--ts-num);
  font-weight: 650;
  color: var(--ts-ink);
}

#view-root #wt-pr-confirm .wt-sep-line {
  height: 1px;
  margin: 0;
  background: var(--ts-line-soft);
}

#view-root #wt-pr-confirm .wt-field-error:not(:empty) {
  padding: 8px 10px;
  border: 1px solid var(--ts-err-line);
  border-left: 3px solid var(--ts-down);
  border-radius: 8px;
  background: var(--ts-err-bg);
  font-size: 11.5px;
  color: var(--ts-err);
}

#view-root #wt-pr-confirm .wt-row {
  gap: 10px;
}

#view-root #wt-pr-confirm .wt-otp-row {
  margin: 2px 0 0;
}

#view-root #wt-pr-confirm #wt-pr-otp,
#view-root #wt-pr-confirm #wt-pr-submit {
  height: 40px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
}

#view-root #wt-pr-confirm #wt-pr-submit {
  min-width: 170px;
}

#view-root #wt-pr-confirm #wt-pr-submit:disabled {
  background: var(--ts-surface-2);
  border-color: var(--ts-line);
  color: #6F7783;
  opacity: 1;
}

#view-root #wt-pr-confirm .wt-link {
  color: var(--ts-plum);
  font-weight: 650;
  text-underline-offset: 2px;
}

#view-root #wt-pr-confirm .wt-link:hover {
  color: var(--ts-plum-deep);
}

/* SmartOTP */
#view-root .wt-otp {
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid var(--ts-line);
  border-radius: 10px;
  background: var(--ts-surface-2);
}

#view-root .wt-otp .wt-hint {
  font-size: 11.5px;
}

#view-root .wt-otp-cells {
  gap: 8px;
  margin: 10px 0 12px;
}

#view-root .wt-otp-cells .tps-input {
  width: 42px;
  height: 48px;
  padding: 0;
  border-radius: 9px;
  font-family: var(--ts-num);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
  background: var(--ts-surface);
}

#view-root .wt-otp-cells .tps-input:focus {
  border-color: var(--ts-plum);
  box-shadow: var(--ts-ring);
}

/* Điều khoản dịch vụ (overlay trong #view-root) */
#view-root .wt-terms {
  background: rgba(2, 5, 7, .74);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

#view-root .wt-terms__box {
  border-radius: 14px;
  background: var(--ts-surface);
  border: 1px solid var(--ts-line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .62);
}

#view-root .wt-terms__head {
  padding: 14px 18px;
  background: var(--ts-surface);
  border-bottom: 1px solid var(--ts-line);
  font-size: 13.5px;
}

#view-root .wt-terms__body {
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ts-ink-2);
}

#view-root .wt-terms__body h4 {
  font-size: 13px;
  color: var(--ts-ink);
}

#view-root .wt-terms__foot {
  padding: 12px 18px;
  background: var(--ts-surface-2);
  border-top: 1px solid var(--ts-line);
}

#view-root .wt-terms__foot .tps-btn {
  height: 38px;
  min-width: 110px;
  border-radius: 9px;
  font-weight: 700;
}

/* Chưa chọn gói → ô trống có chủ đích */
#view-root #wt-pr-confirm.tps-empty {
  padding: 24px 18px;
  border: 1px dashed rgba(252, 252, 254, .12);
  border-radius: 12px;
  background: rgba(252, 252, 254, .02);
  color: var(--ts-muted);
  font-size: 12.5px;
}

/* ==========================================================================
   10. GHI CHÚ CHUYỂN TIỂU KHOẢN · NHẮC NGHIỆP VỤ
   ========================================================================== */

#view-root .wt-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--ts-warn-line);
  border-radius: 10px;
  background: var(--ts-warn-bg);
  font-size: 12px;
}

#view-root .wt-switch__icon {
  color: var(--ts-plum);
  font-size: 14px;
}

#view-root .wt-switch__text {
  flex: 1 1 280px;
  color: #F2C94C;
  line-height: 1.5;
}

#view-root .wt-switch .tps-btn {
  height: 30px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
}

/* ==========================================================================
   11. FOCUS — vòng orchid, không phá layout
   ========================================================================== */

#view-root .wt-form .tps-btn:focus-visible,
#view-root .wt-ticket-wrap .tps-btn:focus-visible,
#view-root .wt-2col .tps-btn:focus-visible,
#view-root #wt-pr-confirm .tps-btn:focus-visible,
#view-root .wt-product-card:focus-visible {
  outline: 2px solid var(--ts-plum);
  outline-offset: 2px;
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */

/* Nội dung hẹp hơn ~1000px (copilot chiếm 384px) → phiếu lệnh xuống dưới */
@media (max-width: 1400px) {
  #view-root .wt-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-root .wt-ticket-wrap {
    position: static;
  }
}

@media (min-width: 1401px) {
  #view-root .wt-ticket-wrap {
    position: sticky;
    top: 4px;
  }
}

@media (max-width: 1180px) {
  #view-root .wt-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-root .wt-2col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  #view-root .wt-layout {
    gap: 14px;
  }

  #view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt .tps-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt .tps-stat:last-child {
    grid-column: 1 / -1;
  }

  #view-root:is(
    [data-route="#/equity"],
    [data-route="#/utilities/margin-repay"],
    [data-route="#/utilities/cash-advance"],
    [data-route="#/utilities/money-transfer"],
    [data-route="#/utilities/product-register"],
    :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
  ) .wt-table-wrap {
    max-height: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  #view-root #wt-priceboard {
    min-width: 600px;
  }

  #view-root #wt-orders {
    min-width: 640px;
  }

  #view-root #wt-mr-loans {
    min-width: 780px;
  }

  #view-root #wt-ca-orders {
    min-width: 760px;
  }

  /* Mobile: bảng cuộn ngang nhưng tiêu đề dòng vẫn dính */
  #view-root #wt-priceboard thead th,
  #view-root #wt-orders thead th,
  #view-root #wt-mr-loans thead th,
  #view-root #wt-ca-orders thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

@media (max-width: 720px) {
  /* Bảng giá cao tối đa ~8 dòng để phiếu lệnh tới sớm hơn trên mobile */
  #view-root .wt-card-priceboard .wt-table-wrap {
    max-height: 340px;
  }

  #view-root .wt-grid-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #view-root .wt-product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-root .wt-product-card__rate {
    font-size: 19px;
  }

  #view-root .wt-tk-side .tps-btn {
    height: 42px;
    font-size: 13.5px;
  }

  #view-root #wt-ticket .tps-input {
    height: 44px;
    font-size: 15px;
  }

  #view-root #wt-tk-price,
  #view-root #wt-tk-volume {
    font-size: 15px;
  }

  #view-root #wt-ticket #wt-tk-submit {
    height: 46px;
    font-size: 14px;
  }

  #view-root .wt-form .tps-input {
    height: 44px;
    font-size: 15px;
  }

  #view-root #wt-mr-amount,
  #view-root #wt-ca-amount,
  #view-root #wt-tf-amount {
    font-size: 16px;
  }

  #view-root .wt-submit-row {
    flex-direction: column;
    align-items: stretch;
  }

  #view-root .wt-submit-row .tps-btn {
    width: 100%;
    height: 44px;
  }

  #view-root #wt-pr-confirm .tps-card__body {
    padding: 14px;
  }

  #view-root #wt-pr-confirm .wt-kv {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }

  #view-root #wt-pr-confirm .wt-kv__v {
    text-align: right;
  }

  #view-root .wt-otp-cells {
    gap: 6px;
  }

  #view-root .wt-otp-cells .tps-input {
    width: 38px;
    height: 46px;
    font-size: 16px;
  }

  #view-root .wt-bank-top {
    flex-direction: column;
    align-items: center;
  }

  #view-root .wt-bank {
    width: 100%;
    min-width: 0;
  }

  #view-root .wt-bank__row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-root .wt-bank__row b {
    font-size: 12px;
    text-align: right;
    word-break: break-word;
  }

  #view-root .wt-copy {
    flex-wrap: wrap;
  }

  #view-root .wt-copy__text {
    font-size: 12.5px;
    letter-spacing: .6px;
  }

  #view-root .wt-terms {
    padding: 14px;
  }

  #view-root .wt-terms__box {
    max-height: 88vh;
  }

  #view-root .wt-preview .wt-kv__k {
    font-size: 12px;
  }

  #view-root .wt-preview .wt-kv__v {
    font-size: 12.5px;
  }

  #view-root .wt-inline-confirm {
    flex-direction: column;
    align-items: stretch;
    padding: 6px;
  }

  #view-root .wt-inline-confirm .tps-btn {
    width: 100%;
  }

  #view-root .wt-switch {
    align-items: flex-start;
  }

  #view-root .wt-switch .tps-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat__value {
    font-size: 15px;
    letter-spacing: -.4px;
  }

  /* Giá trị khớp có 20 ký tự: cho card rộng full dòng thay vì bẻ số */
  #view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat:nth-child(2) {
    grid-column: 1 / -1;
  }

  #view-root:is([data-route="#/equity"], :has(#wt-ticket)) > .tps-grid--4 .tps-stat:nth-child(2) .tps-stat__value {
    font-size: 16px;
  }

  #view-root:is([data-route="#/utilities/cash-advance"], :has(#wt-ca-form)) .wt-mt .tps-stat__value {
    font-size: 15.5px;
  }

  #view-root #wt-ticket .tps-card__body {
    padding: 12px 12px 14px;
  }

  #view-root .wt-maxline {
    padding: 8px 10px;
  }

  #view-root .wt-preview {
    padding: 2px 11px;
  }

  #view-root .wt-preview .wt-kv__k {
    max-width: 55%;
  }
}

/* Tôn trọng giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  #view-root .wt-product-card,
  #view-root .wt-tk-side .tps-btn,
  #view-root .wt-quick .tps-btn {
    transition: none;
  }
}

/* ==========================================================================
   OBSIDIAN REVISION — bề mặt giao dịch trên canvas obsidian #03080A
   --------------------------------------------------------------------------
   Chỉ đổi màu/viền của các điểm còn hard-code. Không đổi bố cục, id, route
   hay hành vi của bảng giá, phiếu lệnh, biểu mẫu. Input/select/checkbox theo
   color-scheme: dark + accent-color orchid; banner lỗi/cảnh báo dạng tinted
   đọc được trên nền tối; biên lai/preview/OTP là bề mặt tối, không mảng trắng.
   ========================================================================== */

#view-root:is(
  [data-route="#/equity"],
  [data-route="#/utilities/margin-repay"],
  [data-route="#/utilities/cash-advance"],
  [data-route="#/utilities/money-transfer"],
  [data-route="#/utilities/product-register"],
  :has(.wt-card-priceboard, .wt-form, .wt-2col, .wt-product-grid)
) {
  --ts-err-bg: rgba(255, 107, 107, .12);
  --ts-err-line: rgba(255, 107, 107, .34);
  --ts-warn-bg: rgba(242, 201, 76, .12);
  --ts-warn-line: rgba(242, 201, 76, .34);
  --ts-ring: 0 0 0 3px rgba(168, 107, 209, .20);
}

/* ---- Native control: dark scheme, accent orchid (không checkbox trắng) ---- */
#view-root :is(input, select, textarea) {
  color-scheme: dark;
  accent-color: #A86BD1;
  caret-color: #A86BD1;
}
#view-root select option,
#view-root select optgroup {
  background-color: #0D141A;
  color: #FCFCFE;
}
#view-root input[type="checkbox"],
#view-root input[type="radio"] {
  accent-color: #A86BD1;
  color-scheme: dark;
}

/* Checkbox/radio vẽ lại theo dark theme: không còn ô trắng mặc định của OS */
#view-root input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-grid;
  place-content: center;
  margin: 0;
  border: 1px solid rgba(252, 252, 254, .30);
  border-radius: 4px;
  background: rgba(252, 252, 254, .06);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
#view-root input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transform-origin: center;
  transition: transform .12s ease-out;
  background: #0A0710;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
#view-root input[type="checkbox"]:checked {
  background: #A86BD1;
  border-color: #A86BD1;
}
#view-root input[type="checkbox"]:checked::before { transform: scale(1); }
#view-root input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#view-root input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(168, 107, 209, .65);
  outline-offset: 2px;
}

/* select.tps-input: giữ mũi tên nhưng nền kính giống input text */
#view-root select.tps-input {
  background-color: rgba(252, 252, 254, .04);
  color: var(--ts-ink);
  color-scheme: dark;
}
#view-root input[type="checkbox"]:focus-visible,
#view-root input[type="radio"]:focus-visible {
  outline: 2px solid var(--ts-plum);
  outline-offset: 2px;
}

/* ---- Tiêu đề không tương tác: bỏ viền focus / caret lạ khi click ---- */
#view-root :is(
  h1, h2, h3, h4, h5, h6, legend,
  .tps-page-head__title, .tps-card__title, .pf-card__title,
  .wt-product-card h4, .wt-detail-block__title
) {
  outline: none;
  caret-color: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Bảng giá ---- */
#view-root #wt-priceboard tbody tr:nth-child(even) { background: rgba(252, 252, 254, .016); }
#view-root #wt-priceboard tbody tr:hover { background: rgba(168, 107, 209, .08); }
#view-root #wt-priceboard tbody tr:active { background: rgba(168, 107, 209, .14); }
#view-root #wt-priceboard tbody tr.is-selected { background: rgba(168, 107, 209, .14); }
#view-root #wt-priceboard tbody tr.is-selected td { border-bottom-color: rgba(168, 107, 209, .34); }
#view-root #wt-priceboard td.is-ceil { color: var(--ts-ceil); background: rgba(217, 130, 255, .10); }
#view-root #wt-priceboard td.is-floor { color: var(--ts-floor); background: rgba(56, 217, 232, .10); }

/* Sổ lệnh · món giải ngân · lệnh bán chờ thanh toán */
#view-root :is(#wt-orders, #wt-mr-loans, #wt-ca-orders) tbody tr:nth-child(even) {
  background: rgba(252, 252, 254, .014);
}
#view-root :is(#wt-orders, #wt-mr-loans, #wt-ca-orders) tbody tr:hover {
  background: rgba(168, 107, 209, .08);
}

/* Vùng cuộn bảng: thanh cuộn tối, không lộ track trắng */
#view-root .wt-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(207, 213, 222, .22) transparent;
}
#view-root .wt-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
#view-root .wt-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(207, 213, 222, .22);
  border: 2px solid transparent;
  border-radius: 8px;
}
#view-root .wt-table-wrap::-webkit-scrollbar-track { background: transparent; }

/* ---- Phiếu lệnh: segmented Mua/Bán, dải sức mua, gợi ý mã ---- */
#view-root .wt-tk-side {
  background: rgba(252, 252, 254, .035);
  border-color: var(--ts-line);
}
#view-root .wt-tk-side .tps-btn.is-buy:not(.is-active):hover,
#view-root .wt-tk-side .tps-btn.is-sell:not(.is-active):hover {
  background: rgba(252, 252, 254, .06);
  border-color: var(--ts-line);
}
#view-root .wt-tk-side .is-buy.is-active {
  background: linear-gradient(160deg, #1FC98A 0%, #0E9C68 100%);
  border-color: rgba(37, 211, 138, .55);
  color: #04140C;
  box-shadow: 0 4px 14px rgba(37, 211, 138, .22);
}
#view-root .wt-tk-side .is-sell.is-active {
  background: linear-gradient(160deg, #FF7A7A 0%, #DC4343 100%);
  border-color: rgba(255, 107, 107, .55);
  color: #1A0505;
  box-shadow: 0 4px 14px rgba(255, 107, 107, .20);
}

#view-root .wt-maxline {
  border-color: var(--ts-plum-line);
  background: rgba(168, 107, 209, .07);
  color: var(--ts-muted);
}
#view-root .wt-maxline b { color: var(--ts-plum); }

#view-root .wt-suggest {
  background: rgba(8, 12, 17, .96);
  border-color: var(--ts-line);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
#view-root .wt-suggest__item:hover { background: rgba(168, 107, 209, .12); }

/* ---- Chip gợi ý số tiền ---- */
#view-root .wt-quick .tps-btn {
  border-color: rgba(168, 107, 209, .30);
  background: rgba(168, 107, 209, .12);
  color: var(--ts-plum);
}
#view-root .wt-quick .tps-btn:hover {
  border-color: rgba(168, 107, 209, .55);
  background: rgba(168, 107, 209, .22);
}

/* ---- Biên lai / preview / OTP: bề mặt tối, không mảng trắng ---- */
#view-root .wt-receipt {
  border-color: var(--ts-plum-line) !important;
  background: var(--ts-surface);
  box-shadow: var(--ts-shadow);
}
#view-root .wt-receipt > .tps-card__head {
  background: rgba(168, 107, 209, .10);
  border-bottom-color: var(--ts-plum-line);
}
#view-root .wt-preview {
  background: rgba(8, 12, 17, .55);
  border-color: var(--ts-line-soft);
}
#view-root .wt-preview .wt-kv__k { color: var(--ts-muted); }
#view-root .wt-otp {
  background: rgba(8, 12, 17, .55);
  border-color: var(--ts-line);
}
#view-root .wt-otp-cells .tps-input {
  background: rgba(252, 252, 254, .05);
  border-color: var(--ts-line);
  color: var(--ts-ink);
}
#view-root .wt-summary {
  background: rgba(252, 252, 254, .03);
  border-top-color: var(--ts-line);
}

/* ---- Chuyển / nộp tiền: QR + nội dung chuyển khoản ---- */
#view-root .wt-qr {
  background: #FCFCFE;
  border-color: rgba(168, 107, 209, .36);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
#view-root .wt-copy {
  border-color: rgba(168, 107, 209, .32);
  background: rgba(168, 107, 209, .07);
}
#view-root .wt-copy__text { color: var(--ts-plum); }
#view-root .wt-copy .tps-btn--sm {
  border-color: rgba(168, 107, 209, .36);
  color: var(--ts-plum);
  background: rgba(252, 252, 254, .05);
}
#view-root .wt-copy .tps-btn--sm:hover { background: rgba(252, 252, 254, .09); }

/* ---- Gói sản phẩm ---- */
#view-root .wt-product-card {
  background: var(--ts-surface);
  border-color: var(--ts-line);
}
#view-root .wt-product-card:hover {
  border-color: rgba(168, 107, 209, .55);
  background: rgba(15, 22, 29, .93);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .42);
}
#view-root .wt-product-card.is-selected {
  border-color: var(--ts-plum);
  background: rgba(168, 107, 209, .12);
  box-shadow: 0 0 0 2px rgba(168, 107, 209, .22);
}
#view-root .wt-product-card__rate { color: var(--ts-plum); }
#view-root .wt-cond li::marker { color: rgba(168, 107, 209, .70); }

#view-root #wt-pr-confirm.tps-card > .tps-card__head {
  background: rgba(168, 107, 209, .10);
  border-bottom-color: var(--ts-plum-line);
}
#view-root #wt-pr-confirm.tps-empty {
  border-color: rgba(252, 252, 254, .12);
  background: rgba(252, 252, 254, .02);
  color: var(--ts-muted);
}
#view-root #wt-pr-confirm #wt-pr-submit:disabled {
  background: rgba(252, 252, 254, .03);
  border-color: var(--ts-line-soft);
  color: #6F7783;
}

/* ---- Điều khoản dịch vụ: overlay tối, hộp đọc được ---- */
#view-root .wt-terms { background: rgba(2, 5, 7, .72); }
#view-root .wt-terms__box {
  background: rgba(10, 15, 20, .97);
  border-color: var(--ts-line);
  box-shadow: 0 34px 84px rgba(0, 0, 0, .72);
}
#view-root .wt-terms__head {
  background: rgba(252, 252, 254, .03);
  border-bottom-color: var(--ts-line);
}
#view-root .wt-terms__foot {
  background: rgba(252, 252, 254, .02);
  border-top-color: var(--ts-line);
}

/* ---- Banner cảnh báo chuyển tiểu khoản ---- */
#view-root .wt-switch {
  border-color: var(--ts-warn-line);
  background: var(--ts-warn-bg);
}
#view-root .wt-switch__text { color: #F2C94C; }

/* ---- Lỗi biểu mẫu: khối tinted đọc được, không phải mảng hồng sáng ---- */
#view-root #wt-ticket .wt-field-error:not(:empty),
#view-root .wt-form > .wt-field-error:not(:empty),
#view-root #wt-ca-form .wt-field-error:not(:empty),
#view-root #wt-pr-confirm .wt-field-error:not(:empty) {
  border-color: var(--ts-err-line);
  border-left-color: var(--ts-down);
  background: var(--ts-err-bg);
  color: var(--ts-err);
}

/* ---- Dòng xác nhận huỷ tại chỗ ---- */
#view-root .wt-inline-confirm {
  border-color: var(--ts-warn-line);
  background: var(--ts-warn-bg);
}
#view-root .wt-inline-confirm .wt-hint { color: var(--ts-warn-ink); }
