/* TD-043 Chặng 6 bước 3: màn "TV chuyền · chọn màn hiện trên TV" (#/sx/tv, public/js/sx-tvql.js) theo bản phác đã duyệt
   khao-sat/de-xuat-11-11/tv-chon-man (quyết định 142; TV tổ chỉ 3 màn – quyết định 138). Chỉ áp trong lớp .tvql: trang, hộp thoại của màn, thông báo Hoàn tác.
   Cỡ tính theo em: nút A− / A+ đổi cỡ chữ cả trang. Từ 1500 px: hai cột (khung đổi màn bên trái, danh sách TV, nhật ký bên phải); 900–1499 px: một cột;
   dưới 900 px (điện thoại): một cột, danh sách thành thẻ, vùng bấm từ 44 px. Số kết quả màu xanh dương đậm #1E4E8C như bản chốt TV. */
.tvql {
  --tq-nen: #F3F2EF; --tq-the: #FFFFFF; --tq-vien: #DEDBD4; --tq-rac: #E9E6DE; --tq-chu: #2E2A24; --tq-phu: #5E5A52;
  --tq-so: #1E4E8C; --tq-brand: #B4530A; --tq-brand-ink: #8E3F05; --tq-brand-tint: #FFF6EE; --tq-brand-soft: #FBE3CC;
  --tq-ok: #1B6B45; --tq-ok-soft: #E4F3EA; --tq-do: #A1261A; --tq-do-soft: #FCE9E6; --tq-xam: #66768C; --tq-xam-soft: #EEF1F5;
  color: var(--tq-chu);
}
.mwrap.tvql { max-width: none; font-size: 15px; }   /* TD-202: giãn theo khung chính */
.tvql .tq-so { color: var(--tq-so); font-weight: 800; font-variant-numeric: tabular-nums; }
.tvql .tq-muted { font-size: .8125em; color: var(--tq-phu); }
.tvql .tq-block { display: block; margin-top: .25em; }
.tvql .tq-bad, .tvql .tq-lost { color: var(--tq-do); font-weight: 700; }
.tvql .tq-t-dt { display: none; }
.tvql .tq-link { border: 0; background: none; padding: 0; color: var(--tq-brand-ink); font-weight: 700; cursor: pointer; font-size: inherit; }

/* Thanh tiêu đề: phạm vi, cỡ chữ, Cài đặt TV */
.tvql .tq-bar { display: flex; align-items: center; gap: .625em; flex-wrap: wrap; justify-content: flex-end; }
.tvql .tq-scope { font-size: .8125em; color: var(--tq-phu); white-space: nowrap; }
.tvql .tq-scope b { color: var(--tq-chu); }
.tvql .tq-fsz { display: inline-flex; border: 1px solid var(--tq-vien); border-radius: 999px; overflow: hidden; background: var(--tq-the); }
.tvql .tq-fsz button { border: 0; background: none; padding: .375em .75em; font-weight: 700; font-size: .875em; cursor: pointer; }
.tvql .tq-fsz button + button { border-left: 1px solid var(--tq-vien); }
.tvql .tq-btn-out { border: 1px solid var(--tq-vien); background: var(--tq-the); border-radius: 999px; padding: .5em 1em; font-weight: 700; font-size: .875em; white-space: nowrap; cursor: pointer; }
.tvql .tq-btn-chinh { flex: 0 0 auto; white-space: nowrap; border: 0; background: var(--tq-brand); color: #fff; border-radius: .75em; padding: .75em 1.75em; font-weight: 800; font-size: 1em; box-shadow: 0 2px 0 var(--tq-brand-ink); cursor: pointer; }
.tvql .tq-btn-chinh:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Thẻ, bố cục */
.tvql .tq-card { background: var(--tq-the); border: 1px solid var(--tq-vien); border-radius: 1em; min-width: 0; padding: 1em 1.25em; }
.tvql .tq-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: .75em; flex-wrap: wrap; }
.tvql .tq-card-h h2 { font-size: 1.125em; font-weight: 800; margin: 0; }
.tvql .tq-trong { margin-top: .75em; }
.tvql .tq-tren { display: flex; flex-direction: column; gap: .5em; margin-bottom: .875em; }
.tvql .tq-tren:empty { display: none; }
.tvql .tq-layout { display: grid; gap: .875em; grid-template-columns: minmax(0, 1fr); align-items: start; }
.tvql .tq-phai { display: flex; flex-direction: column; gap: .875em; min-width: 0; }
/* Hai cột từ 1500 px. 1280–1499 px (màn văn phòng 1366 px) một cột: cột trạng thái TV đủ rộng, không gãy 3–4 dòng (kiểm k3);
   khung đổi màn xếp ba bước nằm ngang để không đẩy danh sách xuống xa */
@media (min-width: 1500px) {
  .tvql .tq-layout.hai { grid-template-columns: 28em minmax(0, 1fr); }
}
@media (min-width: 1024px) and (max-width: 1499px) {
  .tvql .tq-layout.hai .tq-buoc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.25em; align-items: start; }
  .tvql .tq-layout.hai .tq-buoc .tq-key { grid-template-columns: 1fr; }
}
.tvql .tq-note { font-size: .8125em; color: var(--tq-phu); margin: 0; padding: 0 .25em; }
.tvql .tq-note b { color: var(--tq-chu); }
.tvql .tq-chips { display: flex; flex-wrap: wrap; gap: .375em; margin-top: .5em; }
.tvql .tq-nm { margin-bottom: .75em; }
.tvql .tq-chip { display: inline-flex; align-items: center; border: 1px solid var(--tq-vien); background: var(--tq-the); color: var(--tq-chu); border-radius: 999px; padding: .3125em .75em; font-weight: 700; font-size: .875em; white-space: nowrap; cursor: pointer; text-decoration: none; }
.tvql .tq-chip.sel { border-color: var(--tq-brand); background: var(--tq-brand-tint); color: var(--tq-brand-ink); box-shadow: inset 0 0 0 1px var(--tq-brand); }
.tvql .tq-chip.dash { border-style: dashed; color: var(--tq-phu); }
.tvql .tq-chip .n { font-weight: 600; color: var(--tq-phu); margin-left: .25em; }
.tvql .tq-chip.sel .n { color: var(--tq-brand-ink); }

/* Thẻ nhanh của quản đốc, giám đốc sản xuất */
.tvql .tq-nhanh { display: grid; grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); gap: .75em; }
.tvql .tq-quick { position: relative; overflow: hidden; background: var(--tq-brand-tint); border: 1px solid var(--tq-brand-soft); border-radius: 1em; padding: 1em 1em .5em 1.375em; }
.tvql .tq-quick::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .375em; background: var(--tq-brand); }
.tvql .tq-q-eye { font-size: .8125em; font-weight: 700; color: var(--tq-brand-ink); }
.tvql .tq-q-title { font-size: 1.5em; font-weight: 800; line-height: 1.2; margin: .125em 0 0; }
.tvql .tq-q-now { margin: .375em 0 0; font-size: .9375em; }
.tvql .tq-q-btn { margin-top: .75em; width: 100%; min-height: 4em; border: 0; border-radius: .875em; background: var(--tq-brand); color: #fff; font-size: 1.125em; font-weight: 800; line-height: 1.25; padding: .625em .75em; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--tq-brand-ink); cursor: pointer; }
.tvql .tq-q-btn span { font-size: .875em; font-weight: 600; opacity: .95; }
.tvql .tq-q-btn.sec { background: var(--tq-the); color: var(--tq-brand-ink); border: 2px solid var(--tq-brand); box-shadow: none; }
.tvql .tq-q-btn:disabled { opacity: .5; cursor: wait; }
.tvql .tq-q-foot { margin-top: .25em; font-size: .875em; color: var(--tq-phu); display: flex; justify-content: space-between; align-items: center; gap: .5em; flex-wrap: wrap; min-height: 2.75em; }

/* Dải "Đang áp dụng" */
.tvql .tq-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: .875em; background: var(--tq-brand-tint); border: 1px solid var(--tq-brand-soft); border-radius: 1em; padding: .625em .75em .625em 1.375em; }
.tvql .tq-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .375em; background: var(--tq-brand); }
.tvql .tq-ico { flex: 0 0 auto; width: 2.25em; height: 2.25em; border-radius: .625em; background: var(--tq-brand-soft); color: var(--tq-brand-ink); display: grid; place-items: center; }
.tvql .tq-b-txt { flex: 1 1 auto; min-width: 0; font-size: .9375em; }
.tvql .tq-b-lbl { display: inline-block; margin-right: .5em; font-size: .8em; font-weight: 800; color: var(--tq-brand-ink); background: var(--tq-brand-soft); border-radius: 999px; padding: .0625em .5em; }
.tvql .tq-who { color: var(--tq-phu); }
.tvql .tq-btn-back { flex: 0 0 auto; border: 1px solid var(--tq-brand); background: var(--tq-the); color: var(--tq-brand-ink); border-radius: 999px; padding: .5em 1em; font-weight: 800; font-size: .875em; white-space: nowrap; cursor: pointer; }

/* Duyệt TV mới */
.tvql .tq-duyet-in { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; margin: .5em 0 .25em; }
.tvql .tq-ma { font-size: 1.25em; letter-spacing: .15em; width: 9em; font-variant-numeric: tabular-nums; padding: .375em .5em; border: 1px solid var(--tq-vien); border-radius: .5em; }
.tvql .tq-ma::placeholder { letter-spacing: normal; font-size: .8em; }
.tvql .tq-duyet .tq-btn-chinh { padding: .625em 1.25em; }

/* Khung đổi màn */
.tvql .tq-step { margin-top: .875em; }
.tvql .tq-step-h { display: flex; align-items: center; gap: .5em; font-size: .9375em; font-weight: 800; }
.tvql .tq-no { width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--tq-brand-soft); color: var(--tq-brand-ink); font-size: .8125em; display: grid; place-items: center; }
.tvql .tq-aside { margin-left: auto; border: 0; background: none; padding: 0; font-size: .8125em; font-weight: 700; color: var(--tq-brand-ink); cursor: pointer; }
.tvql .tq-sets, .tvql .tq-opts { margin-top: .5em; display: flex; flex-direction: column; gap: .5em; }
.tvql .tq-set, .tvql .tq-opt { display: flex; align-items: center; gap: .75em; padding: .4375em .75em; border: 1px solid var(--tq-vien); border-radius: .75em; background: var(--tq-the); cursor: pointer; }
.tvql .tq-set.sel, .tvql .tq-opt.sel { border-color: var(--tq-brand); background: var(--tq-brand-tint); box-shadow: inset 0 0 0 1px var(--tq-brand); }
.tvql .tq-set:focus-visible, .tvql .tq-opt:focus-visible { outline: 2px solid var(--tq-brand); outline-offset: 2px; }
.tvql .tq-radio { flex: 0 0 auto; width: 1.25em; height: 1.25em; border-radius: 50%; border: 2px solid var(--tq-xam); display: grid; place-items: center; }
.tvql .sel > .tq-radio { border-color: var(--tq-brand); }
.tvql .sel > .tq-radio::after { content: ""; width: .625em; height: .625em; border-radius: 50%; background: var(--tq-brand); }
.tvql .tq-set-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tvql .tq-set-txt b { font-size: .9375em; font-weight: 800; }
.tvql .tq-set-txt small { font-size: .8125em; color: var(--tq-phu); }
.tvql .tq-scrs { flex: 0 0 auto; display: inline-flex; gap: .3125em; }
.tvql .tq-scr { font-style: normal; width: 1.875em; height: 1.875em; border-radius: .5em; border: 1.5px solid var(--tq-xam); background: var(--tq-the); color: var(--tq-xam); font-weight: 800; font-size: .875em; display: inline-grid; place-items: center; padding: 0; font-variant-numeric: tabular-nums; }
.tvql .tq-scr.on { background: var(--tq-so); border-color: var(--tq-so); color: #fff; }
.tvql button.tq-scr { cursor: pointer; }
.tvql button.tq-scr:hover { box-shadow: 0 0 0 2px var(--tq-brand-soft); }
.tvql .tq-key { margin-top: .5em; padding: .5em .75em; background: var(--tq-nen); border-radius: .625em; font-size: .8125em; color: var(--tq-phu); display: grid; grid-template-columns: 1fr 1fr; gap: .125em .75em; }
.tvql .tq-key b { color: var(--tq-chu); }
.tvql .tq-k-foot { grid-column: 1 / -1; margin-top: .25em; padding-top: .3125em; border-top: 1px solid var(--tq-vien); }
.tvql .tq-pick { margin-top: .5em; font-size: .875em; }
.tvql .tq-pick-note { margin-top: .25em; font-size: .8125em; color: var(--tq-phu); }
.tvql .tq-opt-txt { flex: 1 1 auto; min-width: 0; font-size: .9375em; font-weight: 700; }
.tvql .tq-opt-txt .lite { font-weight: 500; color: var(--tq-phu); }
.tvql .tq-opt-txt.dates { display: flex; align-items: center; gap: .375em .5em; flex-wrap: wrap; }
.tvql .tq-date { width: 9.75em; border: 1px solid var(--tq-vien); background: var(--tq-the); border-radius: .5em; padding: .25em .5em; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9375em; }
.tvql .tq-apply-box { margin-top: .875em; padding-top: .75em; border-top: 1px solid var(--tq-rac); }
.tvql .tq-sum { font-size: .9375em; }
.tvql .tq-sum b { font-weight: 800; }
.tvql .tq-warn { margin-top: .375em; font-size: .8125em; color: var(--tq-brand-ink); font-weight: 600; }
.tvql .tq-warn.bad { color: var(--tq-do); }
.tvql .tq-apply-row { margin-top: .75em; display: flex; align-items: center; gap: .875em; }
.tvql .tq-apply-note { min-width: 0; font-size: .8125em; color: var(--tq-phu); }

/* Danh sách TV */
.tvql .tq-list { padding-bottom: .5em; }
.tvql .tq-list-top { display: flex; align-items: center; justify-content: space-between; gap: .75em; flex-wrap: wrap; }
.tvql .tq-list-top .tq-chips { margin-top: 0; }
.tvql .tq-counts { margin-top: .5em; display: flex; align-items: center; justify-content: space-between; gap: .5em 1em; flex-wrap: wrap; font-size: .875em; color: var(--tq-phu); }
.tvql .tq-legend { display: inline-flex; align-items: center; gap: .875em; flex-wrap: wrap; }
.tvql .tq-legend span { display: inline-flex; align-items: center; gap: .3125em; white-space: nowrap; }
.tvql .tq-legend .tq-scr { width: 1.25em; height: 1.25em; font-size: .6875em; border-radius: .3125em; }
.tvql .tq-dot { font-style: normal; flex: 0 0 auto; width: .625em; height: .625em; border-radius: 50%; display: inline-block; }
.tvql .tq-dot.ok { background: var(--tq-ok); box-shadow: 0 0 0 3px var(--tq-ok-soft); }
.tvql .tq-dot.do { background: var(--tq-do); box-shadow: 0 0 0 3px var(--tq-do-soft); }
.tvql .tq-dot.xam { background: var(--tq-xam); box-shadow: 0 0 0 3px var(--tq-xam-soft); }
.tvql .tq-rule { margin-top: .5em; font-size: .8125em; color: var(--tq-phu); }
.tvql .tq-rule b { color: var(--tq-chu); }
.tvql .tq-trong-ds { margin-top: .75em; padding: .75em; border: 1px dashed var(--tq-vien); border-radius: .75em; color: var(--tq-phu); }
.tvql .tq-tbl { margin-top: .625em; }
.tvql .tq-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto 6em 2.25em; grid-template-areas: "tv st btn bo act"; align-items: center; column-gap: .75em; padding: .3125em .75em; min-height: 2.875em; border-top: 1px solid var(--tq-rac); }
.tvql .tq-row.tq-th { min-height: 2.25em; border-top: 0; border-bottom: 2px solid var(--tq-chu); font-size: .8125em; font-weight: 700; color: var(--tq-phu); }
.tvql .tq-row.tq-th .lite { font-weight: 500; }
.tvql .tq-row.ngung { background: var(--tq-nen); }
.tvql .tq-c-tv { grid-area: tv; min-width: 0; display: flex; align-items: center; gap: .5em; }
.tvql .tq-tv-nhan { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tvql .tq-tv-nhan b { font-weight: 800; font-size: 1em; }
.tvql .tq-tv-nhan > span { color: var(--tq-phu); }
.tvql .tq-tv-nhan small { display: block; font-size: .8125em; color: var(--tq-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvql .tq-chon { flex: 0 0 auto; width: 1.375em; height: 1.375em; margin: 0; accent-color: var(--tq-brand); }
.tvql .tq-c-st { grid-area: st; min-width: 0; display: flex; align-items: center; gap: .5em; }
.tvql .tq-st { min-width: 0; display: flex; flex-direction: column; }
.tvql .tq-st-main { overflow-wrap: anywhere; }
.tvql .tq-st-main.bad { color: var(--tq-do); font-weight: 700; }
.tvql .tq-st-sub { font-size: .8125em; color: var(--tq-phu); line-height: 1.3; }
.tvql .tq-plan { color: var(--tq-brand-ink); font-weight: 700; }
.tvql .tq-c-btn { grid-area: btn; }
.tvql .tq-c-bo { grid-area: bo; }
.tvql .tq-c-act { grid-area: act; justify-self: end; }
.tvql .tq-tag { display: inline-block; border-radius: 999px; padding: .125em .625em; font-size: .8125em; font-weight: 800; white-space: nowrap; border: 1px solid var(--tq-vien); background: var(--tq-the); color: var(--tq-chu); }
.tvql .tq-tag.khach { background: var(--tq-brand-tint); border-color: var(--tq-brand-soft); color: var(--tq-brand-ink); }
.tvql .tq-tag.tuy { border-style: dashed; }
.tvql .tq-tag.ngung { color: var(--tq-phu); }
.tvql .tq-more { width: 2.25em; height: 2.25em; border: 1px solid var(--tq-vien); background: var(--tq-the); border-radius: .5em; font-weight: 800; font-size: 1.125em; line-height: 1; display: grid; place-items: center; padding: 0; color: var(--tq-phu); cursor: pointer; }
.tvql .tq-grp { display: flex; align-items: baseline; justify-content: space-between; gap: .75em; flex-wrap: wrap; padding: .4375em .75em; background: var(--tq-nen); border-top: 1px solid var(--tq-rac); font-size: .875em; color: var(--tq-phu); }
.tvql .tq-grp b { font-size: 1.07em; font-weight: 800; color: var(--tq-chu); }
.tvql .tq-g-r { font-weight: 600; }
.tvql .tq-g-r.khach { color: var(--tq-brand-ink); font-weight: 700; }
/* Dòng "n TV khác của Xưởng x · … · Xem tất cả ›" khi danh sách thu gọn (bản phác tv-chon-man) */
.tvql .tq-them { display: flex; align-items: center; justify-content: space-between; gap: .5em 1em; flex-wrap: wrap; padding: .4375em .75em; border-top: 1px solid var(--tq-rac); font-size: .875em; color: var(--tq-phu); }
.tvql .tq-them .tq-link { white-space: nowrap; }
.tvql .tq-huy-hen { font-size: .9em; margin-left: .25em; color: var(--tq-do); }
.tvql .tq-dlg-warn { margin-top: .625em; padding: .5em .75em; border-radius: .625em; background: var(--tq-brand-tint); border: 1px solid var(--tq-brand-soft); color: var(--tq-brand-ink); font-size: .8125em; font-weight: 600; }
.tvql .tq-chua-giao b { color: var(--tq-do); }

/* Nhật ký */
.tvql .tq-log { padding-bottom: .5em; }
.tvql .tq-log-rows { margin-top: .375em; }
.tvql .tq-log-row { display: grid; grid-template-columns: 7.5em 14em minmax(0, 1fr); gap: .75em; padding: .3125em 0; border-top: 1px solid var(--tq-rac); font-size: .875em; align-items: baseline; }
.tvql .tq-log-row .t { font-weight: 700; color: var(--tq-phu); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvql .tq-log-row .w b { font-weight: 800; }
.tvql .tq-log-row .w span { color: var(--tq-phu); }
.tvql .tq-log-row .x { min-width: 0; }

/* Hộp thoại của màn (thân hộp có lớp .tvql) */
.tvql.tq-hop h3 { font-size: 1em; font-weight: 800; margin: .875em 0 .375em; }
.tvql.tq-hop h3:first-child { margin-top: 0; }
.tvql .tq-ghep { margin-bottom: .75em; padding: .625em .75em; background: var(--tq-nen); border-radius: .75em; }
.tvql .tq-qv { display: grid; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); gap: .25em .75em; max-height: 14em; overflow: auto; padding: .25em 0; }
.tvql .tq-dlg-now { margin: 0; font-size: .875em; color: var(--tq-phu); }
.tvql .tq-dlg-now b { color: var(--tq-chu); }
.tvql .tq-dlg-lbl { margin-top: .875em; font-size: .9375em; font-weight: 800; }
.tvql .tq-dscrs { margin-top: .5em; display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.tvql .tq-dscr { display: flex; align-items: center; gap: .5em; text-align: left; border: 1px solid var(--tq-vien); background: var(--tq-the); border-radius: .75em; padding: .375em .625em; font-size: .875em; font-weight: 700; min-height: 2.75em; line-height: 1.25; cursor: pointer; }
.tvql .tq-dscr.on { border-color: var(--tq-so); box-shadow: inset 0 0 0 1px var(--tq-so); }
.tvql .tq-dscr .nm { flex: 1 1 auto; min-width: 0; }
.tvql .tq-dscr .chg { flex: 0 0 auto; font-style: normal; font-size: .8em; font-weight: 800; color: var(--tq-brand-ink); background: var(--tq-brand-soft); border-radius: 999px; padding: 0 .4375em; white-space: nowrap; }
.tvql .tq-dlg-hint { margin-top: .375em; font-size: .8125em; color: var(--tq-do); font-weight: 600; }
.tvql .tq-dlg-sum { margin: .875em 0 0; padding-top: .75em; border-top: 1px solid var(--tq-rac); font-size: .9375em; }
.tvql.tq-menu .tq-mn { padding: .375em 0; border-top: 1px solid var(--tq-rac); }
.tvql.tq-menu .tq-mn-btn { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: .5em; padding: .5em .75em; font-weight: 800; font-size: .9375em; min-height: 2.5em; cursor: pointer; }
.tvql.tq-menu .tq-mn-btn:hover { background: var(--tq-nen); }
.tvql.tq-menu .tq-mn-btn.bad { color: var(--tq-do); }
.tvql.tq-menu .tq-mn small { display: block; padding: 0 .75em; font-size: .8125em; color: var(--tq-phu); }
.tvql .tq-cd-sec + .tq-cd-sec { margin-top: 1em; padding-top: .75em; border-top: 1px solid var(--tq-rac); }
.tvql .tq-cks { display: flex; flex-direction: column; gap: .25em; margin: .375em 0 .5em; }
.tvql .tq-pin-row, .tvql .tq-nen-row { display: flex; align-items: center; gap: .5em .75em; flex-wrap: wrap; padding: .375em 0; border-top: 1px solid var(--tq-rac); }
.tvql .tq-pin-ten { flex: 1 1 10em; min-width: 0; }
.tvql .tq-nen-row > span { flex: 1 1 10em; min-width: 0; }
.tvql .tq-pin-tt { font-size: .875em; color: var(--tq-phu); }
.tvql .tq-pin-tt.ok { color: var(--tq-ok); font-weight: 700; }
.tvql .tq-pin-nut { display: inline-flex; gap: .375em; }
.tvql .tq-nen { min-height: 2.25em; border: 1px solid var(--tq-vien); border-radius: .5em; padding: 0 .5em; background: var(--tq-the); font-size: .9375em; }

/* Thông báo kèm Hoàn tác (đặt ở cuối trang, ngoài khung trang) */
.tvql.tq-toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 81; display: flex; align-items: center; gap: .875em; background: var(--tq-chu); color: #fff; padding: .625em .75em .625em 1.125em; border-radius: .75em; font-weight: 600; font-size: 15px; width: max-content; max-width: min(44em, calc(100% - 2em)); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.tvql.tq-toast .tq-undo { flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .55); background: transparent; color: var(--tq-brand-soft); border-radius: .5em; padding: .375em .875em; font-weight: 800; min-height: 2.25em; white-space: nowrap; cursor: pointer; }

/* Điện thoại: một cột, danh sách thành thẻ, vùng bấm từ 44 px */
@media (max-width: 899px) {
  .tvql .tq-t-pc, .tvql .tq-scope, .tvql .tq-row.tq-th { display: none; }
  .tvql .tq-t-dt { display: inline; }
  .tvql .tq-layout, .tvql .tq-layout.hai { grid-template-columns: minmax(0, 1fr); gap: .75em; }
  .tvql .tq-phai { display: contents; }
  .tvql .tq-duyet { order: 1; }
  .tvql .tq-list { order: 2; }
  .tvql .tq-form { order: 3; }
  .tvql .tq-log { order: 4; }
  .tvql .tq-note { order: 5; }
  .tvql .tq-card { padding: 1em; }
  .tvql button, .tvql select, .tvql input:not([type=checkbox]), .tvql .tq-chip, .tvql .tq-opt, .tvql .tq-date { min-height: 44px; }
  .tvql .tq-fsz button { min-width: 2.75em; padding: 0 .625em; }
  .tvql .tq-chip { padding-top: 0; padding-bottom: 0; }
  .tvql .tq-chips { gap: .5em; }
  .tvql .tq-set { flex-wrap: wrap; row-gap: .5em; padding: .625em .75em; }
  .tvql .tq-set .tq-scrs { margin-left: 2em; }
  .tvql .tq-scrs { gap: .5em; }
  .tvql .tq-custom .tq-scr, .tvql .tq-c-btn .tq-scr { width: 44px; height: 44px; font-size: 1em; border-radius: .625em; }
  .tvql .tq-key { grid-template-columns: 1fr; }
  .tvql .tq-aside, .tvql .tq-link { min-height: 44px; display: inline-flex; align-items: center; }
  .tvql .tq-apply-row { flex-wrap: wrap; }
  .tvql .tq-btn-chinh { min-height: 48px; }
  .tvql .tq-quick .tq-q-btn { min-height: 4.5em; }
  .tvql .tq-q-title { font-size: 1.5em; }
  .tvql .tq-banner { flex-wrap: wrap; }
  .tvql .tq-list { background: transparent; border: 0; padding: 0; }
  .tvql .tq-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tv bo" "st st" "btn act"; row-gap: .625em; column-gap: .5em; padding: .75em .875em; min-height: 0; margin-top: .75em; background: var(--tq-the); border: 1px solid var(--tq-vien); border-radius: .875em; }
  .tvql .tq-row.lost { box-shadow: inset .25em 0 0 var(--tq-do); }
  .tvql .tq-row.ngung { background: var(--tq-nen); }
  .tvql .tq-c-st { align-items: flex-start; }
  .tvql .tq-c-st .tq-dot { margin-top: .4375em; }
  .tvql .tq-more { width: 44px; height: 44px; font-size: 1.25em; }
  .tvql .tq-chon { width: 1.75em; height: 1.75em; }
  .tvql .tq-tbl.mot .tq-grp { display: none; }
  .tvql .tq-grp { margin-top: .75em; border-radius: .625em; border: 0; }
  .tvql .tq-log-row { grid-template-columns: minmax(0, 1fr); gap: .125em; padding: .5em 0; }
  .tvql .tq-dscrs { grid-template-columns: minmax(0, 1fr); }
  .tvql .tq-dscr { min-height: 48px; }
  .tvql.tq-menu .tq-mn-btn { min-height: 44px; }
  .tvql.tq-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .tvql.tq-toast .tq-undo { min-height: 44px; }
}
/* TD-114 (8.5.1): danh sách tổ – xem màn TV trên phần mềm */
.tvql .tq-to-xem .tq-chips { margin: .5em 0; }
.tvql .tq-xem-cuon { overflow-x: auto; }
.tvql .tq-xem { width: 100%; border-collapse: collapse; font-size: .9375em; }
.tvql .tq-xem th { text-align: left; font-size: .8125em; color: var(--tq-phu); font-weight: 700; padding: .5em .625em; border-bottom: 1px solid var(--tq-vien); white-space: nowrap; }
.tvql .tq-xem td { padding: .5em .625em; border-bottom: 1px solid var(--tq-vien); vertical-align: top; }
.tvql .tq-xem td.tq-xem-nut { text-align: right; white-space: nowrap; }
.tvql .tq-xem a.tq-btn-out { display: inline-block; text-decoration: none; color: var(--tq-brand-ink); }
.tvql .tq-xem-tt { font-weight: 700; } .tvql .tq-xem-tt.dang_chieu { color: #1B6B45; } .tvql .tq-xem-tt.mat_ket_noi { color: #A1261A; } .tvql .tq-xem-tt.chua_ket_noi { color: var(--tq-phu); }
