/* Design system CFS (token + khối dùng chung). Gốc: wireframe A đã chọn 08/11. ô chọn ngày chung → 4 ô số → [xu hướng + so sánh | việc cần làm] → bảng chi tiết tab Ngày/Camp/QC. Token giữ đúng bản wireframe (demo ABERA 360: Inter, một màu nhấn chàm, khối viền 1px bo 10px). Biểu đồ SVG tự vẽ, một trục mỗi khung, 3 khung chung trục ngày. */
/* Màu theo nen2/web/DESIGN.md mục 5 (Tú "duyệt plan" 12/11, đợt 1). Đổi màu: sửa dev/mau/tuong_phan.py, chạy cho ra 0 cặp hỏng, rồi mới sửa ở đây. */
:root {
  --bg: #f7f8f8; --surface: #ffffff; --sunken: #f1f2f3; --line: #e4e5e7; --line-strong: #858a94;
  --ink: #1a1b1e; --body: #3c3f45; --muted: #63676e;
  --accent: #5e6ad2; --accent-text: #4f5bc4; --on-accent: #ffffff; --active: #eceefb;
  --ok: #17764c; --ok-bg: #e4f4ec; --warn: #8f5207; --warn-bg: #fbf1e0; --bad: #b92e2e; --bad-bg: #fcecec;
  --info: #4f5bc4; --info-bg: #eceefb; --neutral: #63676e; --neutral-bg: #f0f1f2;
  --dot-ok: #1f8a5b; --dot-warn: #b56a0c; --dot-bad: #c93636; --dot-info: #5e6ad2; --dot-neutral: #858a94;
  --bar: #5e6ad2; --bar-soft: #c9cdf2; --bar-off: #d5d7db;
  --phu-an: #e6e8eb;   /* nền đặc lúc bấm (DESIGN 7.6) */
  --font: "Inter", "Segoe UI", "Noto Sans Thai", system-ui, sans-serif;
  /* Thang cỡ chữ, khoảng cách, bo góc, bóng (mục 5.3, 5.4). Màn cũ chưa dùng; màn mới chỉ dùng các bậc này. */
  --fs-1: 12px; --fs-2: 13px; --fs-3: 14px; --fs-4: 16px; --fs-5: 20px; --fs-6: 24px;
  --kc-1: 4px; --kc-2: 8px; --kc-3: 12px; --kc-4: 16px; --kc-5: 24px; --kc-6: 32px;
  --bo-1: 4px; --bo-2: 6px; --bo-3: 10px; --bo-tron: 999px;
  --shadow-1: 0 8px 24px rgb(0 0 0 / .12); --shadow-2: 0 16px 48px rgb(0 0 0 / .2);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #08090a; --surface: #101113; --sunken: #16171a; --line: #23252a; --line-strong: #676c75;
  --ink: #f7f8f8; --body: #d0d6e0; --muted: #8a8f98;
  --accent: #828fff; --accent-text: #8f9bff; --on-accent: #08090a; --active: #1b1d33;
  --ok: #4cb782; --ok-bg: #12291f; --warn: #f2a93b; --warn-bg: #2b2110; --bad: #f06a6a; --bad-bg: #2c1618;
  --info: #8f9bff; --info-bg: #1b1d33; --neutral: #8a8f98; --neutral-bg: #1a1c20;
  --dot-ok: #4cb782; --dot-warn: #f2a93b; --dot-bad: #eb5757; --dot-info: #828fff; --dot-neutral: #676c75;
  --shadow-1: 0 8px 24px rgb(0 0 0 / .5); --shadow-2: 0 16px 48px rgb(0 0 0 / .6);
  --bar: #6f7ae0; --bar-soft: #2e3260; --bar-off: #3a3d45; --phu-an: #202227; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #08090a; --surface: #101113; --sunken: #16171a; --line: #23252a; --line-strong: #676c75;
  --ink: #f7f8f8; --body: #d0d6e0; --muted: #8a8f98;
  --accent: #828fff; --accent-text: #8f9bff; --on-accent: #08090a; --active: #1b1d33;
  --ok: #4cb782; --ok-bg: #12291f; --warn: #f2a93b; --warn-bg: #2b2110; --bad: #f06a6a; --bad-bg: #2c1618;
  --info: #8f9bff; --info-bg: #1b1d33; --neutral: #8a8f98; --neutral-bg: #1a1c20;
  --dot-ok: #4cb782; --dot-warn: #f2a93b; --dot-bad: #eb5757; --dot-info: #828fff; --dot-neutral: #676c75;
  --shadow-1: 0 8px 24px rgb(0 0 0 / .5); --shadow-2: 0 16px 48px rgb(0 0 0 / .6);
  --bar: #6f7ae0; --bar-soft: #2e3260; --bar-off: #3a3d45; --phu-an: #202227; color-scheme: dark }
* { box-sizing: border-box }
* { scrollbar-width: thin; scrollbar-color: var(--bar-off) transparent }
::-webkit-scrollbar { width: 8px; height: 8px } ::-webkit-scrollbar-thumb { background: var(--bar-off); border-radius: 4px } ::-webkit-scrollbar-track { background: transparent }
body { background: var(--bg); color: var(--body); font: 400 14px/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 600; text-wrap: balance; letter-spacing: -.01em }
p { margin: 0 }
button, select { font: inherit; color: inherit; cursor: pointer }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.wrap { max-width: 1320px; margin: 0 auto; padding-block: 16px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); container: st / inline-size }

.mau-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 12px }
.mau-chip { font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 8px; background: var(--surface); min-width: 0 }
.mau-chip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px }

.man { display: grid; gap: 16px; min-width: 0 }
.dau-man { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; justify-content: space-between }
.dau-man h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.02em }
.nguon { font-size: 12px; color: var(--muted); max-width: 75ch }
.khoi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 12px; min-width: 0; align-content: start }
.khoi-dau { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between }
.khoi-dau h2 { font-size: 15px }
.nho { font-size: 12px; color: var(--muted) }
/* Nhãn «chưa gồm Google» cạnh Ads% (Tú 1B 12/11, gỡ khi số Google vào – c3m_dinh_dang.js ADS_CHUA_GOOGLE) */
.nhan-ads { display: block; font-size: var(--fs-1); font-weight: 400; color: var(--muted); white-space: nowrap }
p.nho { max-width: 75ch }
/* Biểu đồ dùng chung (js/bieu_do.js) */
[data-bd] { display: block; width: 100%; min-width: 0 }
[data-bd]:empty { display: none }
svg.bd { display: block; overflow: visible; max-width: 100% }
svg.bd text { font-family: var(--font); font-size: 12px; fill: var(--muted) }
svg.bd text.dam { fill: var(--ink); font-weight: 600 }
svg.bd text.xau { fill: var(--bad) }
.bd-truc { stroke: var(--line); stroke-width: 1 }
.bd-nguong { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 5 4 }
.bd-duong { fill: none; stroke: var(--bar); stroke-width: 2 }
.bd-duong.phu { stroke: var(--dot-warn) }
.bd-duong.mo { stroke: var(--line-strong); stroke-width: 1.5 }
.bd-cot { fill: var(--bar) } .bd-cot.bad { fill: var(--dot-bad) } .bd-cot.ok { fill: var(--dot-ok) } .bd-cot.warn { fill: var(--dot-warn) }
.chu-giai i.o-mau { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--bar) }
.chu-giai i.o-mau.ok { background: var(--dot-ok) } .chu-giai i.o-mau.warn { background: var(--dot-warn) } .chu-giai i.o-mau.bad { background: var(--dot-bad) }
/* Dãy ô chỉ số nhỏ (mỗi ô: tên, số, trung bình để so) */
.o-day { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 12px 0 }
.o-day > div { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0 }
.o-day .t, .o-day .m { font-size: 12px; color: var(--muted) }
.o-day .v { font-size: var(--fs-5); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums }
/* Dòng mở rộng ngay dưới một dòng bảng */
tr.mo-rong > td { background: var(--sunken); padding: 16px; white-space: normal; text-align: left }
tr.dang-mo > td { background: var(--sunken) }
.bd-cham { fill: var(--bar); fill-opacity: .75; stroke: var(--surface); cursor: pointer }
.bd-cham.bad { fill: var(--dot-bad) } .bd-cham.ok { fill: var(--dot-ok) } .bd-cham.warn { fill: var(--dot-warn) } .bd-cham.chon { fill-opacity: 1; stroke: var(--ink); stroke-width: 2 }
.bd-cham:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.bd-vung { fill: var(--sunken) }
.so4 .o svg.bd { margin-top: 4px }
.khoi-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px }
.khoi-2 > div { min-width: 0 } .khoi-2 h3 { margin: 0 0 2px; font-size: var(--fs-3); color: var(--ink) }
.nut-chu { all: unset; cursor: pointer; color: var(--accent-text); font-weight: 600 }
@media (hover: hover) { .nut-chu:hover { text-decoration: underline } }
.nut-chu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--bo-1) }
/* Tên cột bấm được để xếp tăng / giảm */
th .xep { all: unset; cursor: pointer; font: inherit; color: inherit; padding: 4px 0; white-space: nowrap }
th[aria-sort="ascending"] .xep, th[aria-sort="descending"] .xep { color: var(--ink) } @media (hover: hover) { th .xep:hover { color: var(--ink) } }
th .xep-dau { margin-left: 4px; opacity: .45 } th[aria-sort="ascending"] .xep-dau, th[aria-sort="descending"] .xep-dau { opacity: 1; color: var(--accent-text) }
th .xep:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--bo-1) }
/* Ô chọn có nhãn (loại ngày, bộ lọc): mọi màn dùng, kể cả Tổng quan */
.loc { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0 }
.loc > span { font-size: 12px; color: var(--muted) }
.mc-loc { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin-bottom: 12px }
/* Bục ba hạng đầu và thẻ chi tiết một dòng (màn chờ nguồn, js/man_cho.js) */
.mc-buc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 }
.mc-buc button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink) }
@media (hover: hover) { .mc-buc button:hover { border-color: var(--accent) } }
.mc-buc button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.mc-buc .h, .mc-buc .p { font-size: 12px; color: var(--muted) }
.mc-buc b { font-size: 15px }
.mc-buc .d { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums }
.mc-ct { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; padding: 8px 0; white-space: normal; position: sticky; left: 12px }
.mc-ten { display: inline-flex; align-items: center }
.mc-ct h3 { font-size: 14px; margin: 0 0 8px }
.mc-ct p { margin: 0 0 6px; max-width: 75ch }
.mc-thanh { display: grid; grid-template-columns: 96px minmax(0, 1fr) 84px; gap: 8px; align-items: center; margin-bottom: 6px }
.mc-thanh meter { width: 100%; height: 10px }
.mc-thanh b { text-align: right; font-variant-numeric: tabular-nums }
@media (max-width: 640px) {
  .mc-buc, .mc-ct { grid-template-columns: minmax(0, 1fr) }
  .mc-buc { gap: 8px }
  .mc-buc button { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 8px 12px }
  .mc-buc .d { grid-column: 2; grid-row: 1 / span 2; align-self: center }
  .mc-buc .p { grid-column: 1 / -1 }
}
select { height: 36px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0 28px 0 10px; background: var(--surface); color: var(--ink); font-size: 13px }
@media (hover: hover) { select:hover { border-color: var(--muted) } }

/* Ô chọn ngày (giữ nguyên bản wireframe) */
.ngay { position: relative; display: grid; gap: 6px; min-width: 0 }
.chips-cuon { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0 }
.ck { min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--body); border-radius: 8px; padding: 4px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0 }
@media (hover: hover) { .ck:hover { border-color: var(--muted); color: var(--ink) } }
.ck[aria-pressed="true"] { border-color: var(--accent); background: var(--active); color: var(--ink); font-weight: 600 }
.ck svg { width: 15px; height: 15px }
.ngay-tom { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; color: var(--ink) }
.ngay-tom b { font-weight: 600 }
.gioi-han { font-size: 12px; color: var(--muted); max-width: 75ch }
.pop { position: absolute; z-index: 20; top: 44px; left: 0; width: 620px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgb(0 0 0 / .16); padding: 14px; display: grid; gap: 10px }
.pop-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--neutral-bg); flex-wrap: wrap }
.seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .08) }
.pop-nav { display: flex; gap: 4px }
.nut-ic { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink) }
.nut-ic:disabled { opacity: .4; cursor: default }
.nut-ic svg { width: 16px; height: 16px }
.thang2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px }
.thang h3 { font-size: 13px; text-align: center; margin-bottom: 6px }
.luoi { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px }
.thu { font-size: 12px; color: var(--muted); text-align: center; height: 24px; line-height: 24px }
.o-ngay { position: relative; height: 36px; display: grid; place-items: center }
.o-ngay.giua { background: var(--active) }
.o-ngay.trai { background: linear-gradient(to right, transparent 50%, var(--active) 50%) }
.o-ngay.phai { background: linear-gradient(to left, transparent 50%, var(--active) 50%) }
.o-ngay button { position: relative; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 13px }
@media (hover: hover) { .o-ngay button:hover { background: var(--neutral-bg) } }
.o-ngay.dau button { background: var(--accent); color: var(--on-accent); font-weight: 600 }
.o-ngay button.nay { font-weight: 700; text-decoration: underline; text-underline-offset: 3px }
.o-ngay button.tam::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--warn) }
.o-ngay button[aria-disabled="true"] { color: var(--muted); opacity: .45; cursor: not-allowed; background: none }
.pop-hint { font-size: 13px; color: var(--ink); min-height: 20px }
.pop-hint.loi { color: var(--bad) }
.pop-chan { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px }
.pop-chan .nho { flex: 1 1 200px }
.btn { min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 4px 14px; font-size: 13px; font-weight: 500; white-space: nowrap }
@media (hover: hover) { .btn:hover { border-color: var(--muted) } }
.btn.chinh { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }

/* Hàng số */
.so4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden }
.o { padding: 14px 16px; display: grid; gap: 3px; align-content: start; border-left: 1px solid var(--line); min-width: 0 }
.o:first-child { border-left: 0 }
.o .t { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
.o .v { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; gap: 8px }
.o .v.nho-v { font-size: 16px; color: var(--muted); font-weight: 500 }
.o .meta, .o .m { font-size: 12px; color: var(--muted) }
.den { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--neutral) }
.den.ok { background: var(--ok) } .den.warn { background: var(--warn) } .den.bad { background: var(--bad) }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; white-space: nowrap; line-height: 18px; background: var(--surface) }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--neutral) }
.chip.tam::before { background: var(--warn) }
.chip.win { color: var(--ok); border-color: var(--ok) } .chip.win::before { background: var(--ok) }

/* Lưới giữa: xu hướng + so sánh bên trái, việc cần làm bên phải */
.giua-luoi { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "tr" "bc"; gap: 16px; align-items: start }   /* Hộp việc đã lên trên, ngay dưới 4 ô số (12/11) */
.a-tr { grid-area: tr } .a-bc { grid-area: bc }

/* Biểu đồ xu hướng */
.tr-wrap { position: relative; min-width: 0 }
.tr-wrap svg { display: block; width: 100%; height: auto; touch-action: pan-y }
.tr-wrap svg:focus-visible { outline-offset: 4px; border-radius: 4px }
.ax { fill: var(--muted); font-size: 12px }
.lb { fill: var(--ink); font-size: 12px; font-weight: 600 }
.lb .s { fill: var(--muted); font-weight: 400 }
.gr { stroke: var(--line); stroke-width: 1 }
.gr.goc { stroke: var(--bar-off) }
.ng { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 2 3 }
.ngt { fill: var(--bad); font-size: 12px }
.band { fill: var(--active) }
.ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round }
.ln.tam { stroke-dasharray: 4 4 }
.ln.ngoai { stroke: var(--bar-off) }
.dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2 }
.dot.tam { fill: var(--surface); stroke: var(--accent) }
.xh { stroke: var(--muted); stroke-width: 1 }
.hit { fill: transparent; cursor: crosshair }
.chu-giai { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted) }
.chu-giai span { display: inline-flex; align-items: center; gap: 6px }
.chu-giai svg { width: 22px; height: 8px; flex: none }

/* Thanh so sánh */
.bc-ds { display: grid; gap: 4px }
.br { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 88px; gap: 4px 12px; align-items: center; padding: 6px 8px; margin-inline: -8px; border-radius: 8px; cursor: default }
.br:focus-visible { background: var(--sunken) } @media (hover: hover) { .br:hover { background: var(--sunken) } }
.br-ten { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 500; overflow-wrap: anywhere }
.br-ten small { display: block; font-size: 12px; color: var(--muted); font-weight: 400 }
.br-tr { position: relative; height: 12px; border-radius: 0 4px 4px 0; background: var(--neutral-bg) }
.br-tr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--bar) }
.br-tr i.xau { background: var(--bad) }
.br-tr s { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--bad) }
.br-v { text-align: right; color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap }
.br-v small { display: block; font-weight: 400; font-size: 12px; color: var(--muted) }
.br.tat .br-ten, .br.tat .br-v { color: var(--muted) }

/* Tooltip dùng chung */
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--body); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); padding: 8px 10px; font-size: 12px; min-width: 180px; max-width: min(260px, calc(100vw - 16px)); display: grid; gap: 3px }
#tip .tp-d { color: var(--ink); font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
#tip .tp-r { display: flex; justify-content: space-between; gap: 12px }
#tip .tp-r b { color: var(--ink); font-weight: 600 }
#tip .tp-r b.to { font-size: 15px }
#tip .tp-m { color: var(--muted); text-align: right; margin-top: -3px }
#tip .tp-n { color: var(--muted) }

/* Việc cần làm */
.viec { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line) }
.viec:first-of-type { border-top: 0; padding-top: 0 }
.viec b { color: var(--ink); font-weight: 600 }
.viec .vi { font-size: 13px }
.viec .bc { font-size: 12px; color: var(--muted) }
.viec .hang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 4px }
.viec .tien { font-size: 13px; color: var(--ink) }

/* Tab + bảng */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 8px 12px; margin-bottom: -1px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; min-height: 40px }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600 }
.cuon { overflow-x: auto; min-width: 0 }
table { border-collapse: collapse; width: 100%; font-size: 13px }
th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap }
td.ten { white-space: normal; min-width: 150px; max-width: 280px }
tr:last-child td { border-bottom: 0 }
.ph { text-align: right }
td b { color: var(--ink); font-weight: 600 }
.d2 { display: block; font-size: 12px; color: var(--muted) }
tr.tong td { background: var(--sunken); font-weight: 600; color: var(--ink) }
tr.bam { cursor: pointer }
@media (hover: hover) { tr.bam:hover td { background: var(--sunken) } }
tr.mo-c td { color: var(--muted) }
.xau { color: var(--bad) }

/* Trạng thái */
.skel { display: block; background: var(--neutral-bg); border-radius: 6px; animation: nhap 1.2s ease-in-out infinite }
@keyframes nhap { 50% { opacity: .55 } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none } }
.rong { display: grid; justify-items: start; gap: 8px; padding: 24px 16px; border: 1px dashed var(--line); border-radius: 8px; background: var(--sunken) }
.rong h3 { font-size: 14px }
.rong p { max-width: 60ch; font-size: 13px }
.rong.loi { border-color: var(--bad); background: var(--bad-bg) }
.rong.loi h3 { color: var(--bad) }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--ink); color: var(--surface); font-size: 13px; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .25); transition: opacity 160ms ease-out }
.toast:empty { opacity: 0; pointer-events: none }   /* vùng role=status rỗng vẫn nằm trong trang, chỉ trong suốt */

@container st (max-width: 980px) {
  .giua-luoi { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tr" "bc" }
}
@container st (max-width: 760px) {
  .chips-cuon { flex-wrap: nowrap; overflow-x: auto; margin-inline: -4px; padding: 2px 4px 4px; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent) }
  .chips-cuon::-webkit-scrollbar { display: none }
  .ck { min-height: 44px }
  .pop { top: 52px; left: 0; right: 0; width: auto; padding: 12px }
  .thang2 { grid-template-columns: minmax(0, 1fr) }
  .thang2 .thang:first-child { display: none }
  .o-ngay { height: 44px }
  .o-ngay button { width: 40px; height: 40px }
  .so4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .o { border-left: 0; border-top: 1px solid var(--line); padding: 12px }
  .o:nth-child(even) { border-left: 1px solid var(--line) }
  .o:nth-child(-n+2) { border-top: 0 }
  .o .v { font-size: 22px }
  .khoi { padding: 14px }
  .dau-man h1 { font-size: 21px }
  .btn { min-height: 44px }
  .br { grid-template-columns: minmax(0, 1fr) auto; padding: 8px }
  .br-tr { grid-column: 1 / -1; grid-row: 2 }
}

/* Menu giữa các màn + khối thêm của Content / Ads / Tài khoản */
/* Khung (DESIGN.md 3.1): thanh trái hai tầng = dải khu 52px + danh sách màn 204px; dưới 960px thành thanh đáy + ngăn kéo lên. Chung.menu() vẽ, mọi màn gọi như cũ. */
body { margin: 0 }
/* Trong nav: dải khu (.khu-ray) + tên khu + các liên kết theo thứ tự MENU; liên kết ngoài khu đang mở mang hidden (Chung.menu). */
.menu { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 256px; display: flex; flex-direction: column; gap: 2px; padding: 14px 8px 14px 60px; overflow-y: auto; background: var(--bg); font-size: var(--fs-2) }
.khu-ray { position: absolute; left: 0; top: 0; bottom: 0; width: 52px; display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; border-right: 1px solid var(--line) }
.khu-ray button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted) }
@media (hover: hover) { .khu-ray button:hover { background: var(--sunken); color: var(--ink) } }
.khu-ray button[aria-pressed="true"] { background: var(--active); color: var(--accent-text) }
.khu-ray button.day::after { content: ""; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent) }
.khu-ray svg { width: 20px; height: 20px }
.khu-ray span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
/* UI-MENU-CHU: nhãn nổi tên khu – ẩn mặc định (điện thoại đã có chữ dưới hình), máy tính hiện khi trỏ chuột / focus bàn phím */
.khu-ray .nhan-noi { display: none }
.khu-ten { font-size: var(--fs-1); font-weight: 600; color: var(--muted); padding: 0 8px 8px }
.menu a { min-height: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 5px 8px; border-radius: 6px; color: var(--body); text-decoration: none; font-weight: 500 }
.menu a[hidden] { display: none }
@media (hover: hover) { .menu a:hover { background: var(--sunken); color: var(--ink) } }
.menu a[aria-current="page"] { background: var(--active); color: var(--ink); font-weight: 600 }
.mau-bar .cong-cu { margin-left: auto; display: flex; gap: 6px }
.mau-bar .btn { min-height: 28px; padding: 2px 10px; font-size: var(--fs-1) }
kbd { font: inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px }
.rong.cho { border-style: solid; border-color: var(--info); background: var(--info-bg) }
.rong.cho h3 { color: var(--info) }
.cho-gon { margin: 4px 0; font-size: 13px; color: var(--muted) }
.cho-gon b { color: var(--info); font-weight: 600 }
#hop-lenh { width: min(520px, calc(100vw - 32px)); margin-top: 12vh; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--body); box-shadow: var(--shadow-2) }
#hop-lenh::backdrop { background: rgb(0 0 0 / .35) }
#hop-lenh input { width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px }
.lenh-ds { display: grid; gap: 2px; margin: 8px 0; max-height: 50vh; overflow-y: auto }
.lenh-ds a { min-height: 36px; display: flex; align-items: center; padding: 0 10px; border-radius: 6px; color: var(--body); text-decoration: none }
.lenh-ds a.chon { background: var(--active); color: var(--ink) } @media (hover: hover) { .lenh-ds a:hover { background: var(--active); color: var(--ink) } }
@media (min-width: 960px) {
  .wrap { max-width: none; margin: 8px 8px 8px 256px; min-height: calc(100vh - 16px); padding: 12px 20px 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px }
  :root[data-thu] .wrap { margin-left: 52px }
  /* Thu gọn («[»): chỉ thu khi KHÔNG trỏ chuột / focus bàn phím vào thanh – trỏ vào thì thanh trở lại 256px (tên khu + tầng 2) phủ lên nội dung, lề .wrap giữ 52px (UI-MENU-CHU).
     Bấm chuột không giữ thanh bung (:focus-visible, không :focus-within); màn chạm: chạm vào thanh thì bung.
     Rời chuột: thu sau 0,2 giây (transition-delay; ẩn bằng visibility vì display không trễ được) để lướt qua mép không nháy; trỏ vào: bung ngay. */
  @media (hover: hover) {
    :root[data-thu] .menu:not(:hover):not(:has(:focus-visible)) { width: 52px; padding: 0; overflow: hidden; transition: width 0s .2s, padding 0s .2s }
    :root[data-thu] .menu:not(:hover):not(:has(:focus-visible)) > :not(.khu-ray) { visibility: hidden; transition: visibility 0s .2s }
    :root[data-thu] .menu:hover { box-shadow: var(--shadow-2) }
    .khu-ray button:hover .nhan-noi { display: block }
    .menu:has(.khu-ray button:hover) { overflow: visible }
  }
  @media (hover: none) {
    :root[data-thu] .menu:not(:focus-within) { width: 52px; padding: 0 }
    :root[data-thu] .menu:not(:focus-within) > :not(.khu-ray) { display: none }
  }
  :root[data-thu] .menu:has(:focus-visible) { box-shadow: var(--shadow-2) }
  /* Nhãn nổi tên khu (tầng 1): hiện khi trỏ chuột (trên) hoặc focus bàn phím, nằm NGOÀI mép phải thanh 256px (nút cách mép trái 6px → 258px) ngang hàng nút,
     không che mục nào của thanh; lúc nhãn hiện, thanh bỏ overflow để nhãn không bị cắt */
  .menu:has(.khu-ray button:focus-visible) { overflow: visible }
  .khu-ray .nhan-noi { position: absolute; left: 258px; top: 50%; transform: translateY(-50%); width: auto; height: auto; overflow: visible; clip-path: none; white-space: nowrap; padding: var(--kc-1) var(--kc-2); border-radius: var(--bo-2); background: var(--ink); color: var(--surface); font-size: var(--fs-1); font-weight: 600; box-shadow: var(--shadow-1); pointer-events: none }
  .khu-ray button:focus-visible .nhan-noi { display: block }
}
@media (max-width: 959px) {
  .menu { inset: auto 0 0 0; width: auto; max-height: 70vh; gap: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--line) }
  .menu > :not(.khu-ray) { display: none }
  .menu.mo { background: var(--surface); box-shadow: var(--shadow-1) }
  .menu.mo > .khu-ten { display: block; padding: 12px 20px 8px }
  .menu.mo > a:not([hidden]) { display: flex; margin: 0 12px }
  .khu-ray { position: sticky; order: 2; top: auto; bottom: 0; width: auto; flex: none; flex-direction: row; border-right: 0; padding: 4px; background: var(--bg) }
  .menu.mo .khu-ray { margin-top: 12px; border-top: 1px solid var(--line) }
  .khu-ray button { flex: 1; width: auto; height: 48px; align-content: center; gap: 2px; font-size: var(--fs-1) }
  .khu-ray button.day::after { left: 30%; right: 30%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px }
  .khu-ray span { position: static; width: auto; height: auto; clip-path: none }
  .menu a { min-height: 44px }
  .wrap { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px)) }
  .mau-bar .cong-cu [data-khung="lenh"] kbd { display: none }
  .mau-bar .btn { min-height: 44px }
  select, input[type="text"], input[type="search"], input[type="date"], input[type="month"], input[type="email"], input[type="number"], .seg button { height: 44px }
  .tabs button, .mo-nut { min-height: 44px } .mo-nut { width: 32px }   /* chỗ bấm trên điện thoại cao tối thiểu 44 px */
  .the .nut-chu, td .nut-chu { display: inline-flex; align-items: center; min-height: 44px }
}
.chip.loi { color: var(--bad); border-color: var(--bad) } .chip.loi::before { background: var(--bad) }
.ghi-chu { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--ink) }
.bang-dai { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px }
.bang-dai thead th { position: sticky; top: 0; background: var(--surface); z-index: 1 }
td.mo, th.mo { width: 28px; padding-right: 0 }
.mo-nut { border: 0; background: none; width: 24px; height: 24px; color: var(--muted); border-radius: 6px }
@media (hover: hover) { .mo-nut:hover { background: var(--neutral-bg); color: var(--ink) } }
tr.con td { background: var(--sunken) }
tr.con td:first-child { padding-left: 28px }
.tk { display: grid; gap: 8px; max-width: 520px }
.tk label { font-size: 12px; color: var(--muted) }
.tk input { height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--ink); font: inherit }

/* HE-P7: dòng nguồn dưới ô số của Hôm nay */
.o .ng-o { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere }

/* Ô nhập trên điện thoại / máy bảng (UX-menu-vai, bài học E4): chữ dưới 16px thì trình duyệt điện thoại tự phóng to cả trang khi chạm vào ô.
   MỘT khối cho mọi màn (màn nào cũng nạp ds.css). Điều kiện: khung ≤ 960px (mốc co giãn của DESIGN.md 3.1) HOẶC màn chạm (pointer: coarse – iPhone xoay ngang, iPad rộng hơn 960px vẫn bị phóng).
   !important vì css từng màn nạp sau và đặt 13px / cao 36–40px bằng bộ chọn cụ thể hơn (c3m.css, cai_dat.css, nha_may.css, tai_khoan.css, video_chung.css, .tk input ở trên).
   Mục chạm tối thiểu 44px (DESIGN.md mục 10) cho ô nhập chữ, ô chọn, nút chính; min-height thắng height cố định nên ô chỉ cao lên, không vỡ hàng. Không áp cho checkbox / radio.
   Máy tính dùng chuột, khung > 960px: giữ nguyên. */
@media (max-width: 960px), (pointer: coarse) {
  input, select, textarea { font-size: 16px !important }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), select, textarea, .btn.chinh { min-height: 44px !important }
}
/* Menu: giữ chỗ một hàng ngay từ đầu để phần dưới không giật khi danh sách màn tải xong */
.menu { min-height: 38px }

/* ===== Rút gọn (UX-GON-MAN, Tú duyệt 13/11 «1A 2A 3A») – thành phần của js/gon.js, mọi màu lấy token ở đầu file =====
   Đầu màn: tên màn + nút «?» trên một hàng, ngay dưới là MỘT dòng nguồn. */
.gon-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0 }
.gon-hoi { position: relative; display: inline-flex; vertical-align: middle; font-size: var(--fs-2); font-weight: 400; letter-spacing: 0; white-space: normal }
.gon-hoi-nut { position: relative; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: none; color: var(--muted); font-size: var(--fs-1); font-weight: 600; line-height: 1 }
.gon-hoi-nut::after { content: ""; position: absolute; inset: -12px }   /* QA U11: hộp đệm 20px + 2 × 12 = 44px (viền 1px nằm ngoài ::after) */
.gon-hoi-nut[aria-expanded="true"] { color: var(--ink); border-color: var(--ink) } @media (hover: hover) { .gon-hoi-nut:hover { color: var(--ink); border-color: var(--ink) } }
.gon-hoi-nut:focus-visible, .gon-mo:focus-visible, .gon-ky-nut:focus-visible, .gon-nhom-gon button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.gon-nd { position: absolute; z-index: 6; left: 0; top: 28px; width: min(320px, 80vw); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--bo-3); background: var(--surface); box-shadow: var(--shadow-1); color: var(--body); text-align: left; line-height: 1.45 }
.gon-nd[hidden] { display: none }
/* Dòng mở: cột phụ hiện ngay dưới dòng, dạng «nhãn: số» */
tr.gon-dong { cursor: pointer }
@media (hover: hover) { tr.gon-dong:hover > td { background: var(--sunken) } }
tr.gon-dong.dang-mo > td { background: var(--active); border-bottom-color: transparent }
.gon-o-dau { display: flex; align-items: flex-start; gap: 4px; min-width: 0 }
.gon-o-dau > span { min-width: 0 }
.gon-mo { flex: none; position: relative; width: 20px; height: 20px; padding: 0; margin-left: -4px; border: 0; border-radius: var(--bo-1); background: none; color: var(--muted); font-size: var(--fs-1); line-height: 1 }
.gon-mo::after { content: ""; position: absolute; inset: -12px -6px }
.gon-mo[aria-expanded="true"] { color: var(--ink) } @media (hover: hover) { tr.gon-dong:hover .gon-mo { color: var(--ink) } }
tr.gon-ct[hidden] { display: none }
tr.gon-ct > td { padding: 0; background: var(--sunken); white-space: normal; text-align: left }
.gon-ds { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; padding: 10px 14px 12px 30px }
.gon-ds > div { display: flex; gap: 6px; align-items: baseline; min-width: 0 }
.gon-ds dt { color: var(--muted); font-size: var(--fs-2) }
.gon-ds dt::after { content: ":" }
.gon-ds dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.gon-them { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 0 14px 12px 30px }
td .gon-ten2 { display: block; font-size: var(--fs-1); color: var(--muted); font-weight: 400 }
.gon-cuon { overflow-x: auto; min-width: 0 }
/* Đèn = chấm + chữ; nhãn nhỏ cạnh số */
.gon-den { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); white-space: nowrap }
.gon-den::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-neutral) }
.gon-den.ok::before { background: var(--dot-ok) }
.gon-den.warn { color: var(--warn) } .gon-den.warn::before { background: var(--dot-warn) }
.gon-den.bad { color: var(--bad) } .gon-den.bad::before { background: var(--dot-bad) }
.gon-den.info::before { background: var(--dot-info) }
.gon-it { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--bo-tron); font-size: var(--fs-1); color: var(--muted); line-height: 17px; font-weight: 500; white-space: nowrap }
/* Bảng chia nhóm + nhóm gập thành nút */
tbody.gon-nhom > tr.gon-nhom-dau > th { padding: 14px 10px 6px; border-bottom: 1px solid var(--line-strong); background: none; font-size: var(--fs-2); font-weight: 600; color: var(--ink); text-align: left; white-space: normal }
tbody.gon-nhom > tr.gon-nhom-dau .nho { margin-left: 8px; font-weight: 400 }
.gon-nhom-gon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.gon-nhom-gon button { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--bo-tron); background: var(--surface); color: var(--body); font-size: var(--fs-2) }
@media (hover: hover) { .gon-nhom-gon button:hover { border-color: var(--muted) } }
.gon-nhom-gon button[aria-pressed="true"], .gon-nhom-gon button[aria-expanded="true"] { background: var(--active); border-color: var(--accent); color: var(--ink) }
.gon-nhom-gon b { color: var(--ink) }
.gon-chan { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-2); color: var(--muted) }
.gon-loc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0 }
/* Nút kỳ thả: một nút, bấm mới hiện ô chọn ngày chung + «Tính theo» */
.gon-ky { position: relative; display: inline-block; min-width: 0 }
.gon-ky-nut { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: var(--fs-2); font-weight: 500; white-space: nowrap }
.gon-ky-nut[aria-expanded="true"] { border-color: var(--muted) } @media (hover: hover) { .gon-ky-nut:hover { border-color: var(--muted) } }
.gon-ky-nut > span[aria-hidden] { color: var(--muted) }
.gon-ky-o { position: absolute; z-index: 15; right: 0; top: 42px; width: min(660px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line); border-radius: var(--bo-3); background: var(--surface); box-shadow: var(--shadow-1); display: grid; gap: 10px; text-align: left }
.gon-ky-o[hidden] { display: none }
.gon-ky-tt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px }
/* Lên camp (4.5): CSS của màn đặt ở đây vì css/c3m.css đang do làn khác sửa. Nút «Lập phiếu» sát mép phải; chân màn có nút mở khối Ghi Meta. */
.lc-bang td.ph { text-align: right; width: 1% }
.lc-bang td.ph .btn { min-height: 32px; padding-block: 0 }
.lc-chan { justify-content: flex-start; margin-top: 12px }
#meta-ghi[hidden] { display: none }
#meta-ghi { margin-top: 12px; scroll-margin-top: 12px }
@media (max-width: 640px) {
  .lc-bang tr.gon-dong.dang-mo { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--active) }
  .lc-bang tr.gon-dong.dang-mo > td { background: none }
  .lc-bang tr.gon-ct:not([hidden]) { margin-bottom: 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--sunken) }
  .lc-bang tr.gon-ct > td { padding: 0; background: none }
  .lc-bang td.ph { width: 100%; padding-top: 6px }
  .lc-bang td.ph .btn { width: 100%; min-height: 44px }
  .lc-chan .btn { min-height: 44px }
}
@media (max-width: 959px) {
  .gon-ky { position: static }
  .gon-ky-o { left: 16px; right: 16px; top: auto; width: auto; margin-top: 6px }
  .gon-ky-nut, .gon-nhom-gon button { min-height: 44px }
  .gon-ds { padding-left: 14px; gap: 6px 16px }
  .gon-them { padding-left: 14px }
}

/* ===== UX-360 (16/11, DESIGN 7.12 – theo trang gốc): thẻ đầu trang, ô tab có mô tả, hình tình trạng. Chỉ token ở đầu file. Màn dùng: .the-dau – Video chung, Sáng nay, Camp của tôi; .o-tab + .tt-hinh (Gon.hinh) – Video chung. ===== */
.the-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0 }
.the-dau .bieu { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; color: var(--accent-text); background: var(--active) }
.the-dau .bieu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round }
.the-dau .chu { flex: 1 1 320px; min-width: 0; display: grid; gap: 2px }
.the-dau h1 { margin: 0; font-size: var(--fs-4); font-weight: 600; letter-spacing: -.012em; line-height: 1.3 }
.the-dau .mo-ta { margin: 0; font-size: var(--fs-2); color: var(--muted); max-width: 75ch }
.the-dau .nguon { margin: 2px 0 0 }
.tt-hinh { width: 16px; height: 16px; flex: none; vertical-align: -3px }
.tt-hinh.ok { color: var(--ok) } .tt-hinh.warn { color: var(--warn) } .tt-hinh.bad { color: var(--bad) } .tt-hinh.info { color: var(--info) } .tt-hinh.neutral { color: var(--neutral) }
.gon-den.co-hinh::before { display: none }
.o-tab { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px }
.o-tab button { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; min-height: 52px; padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer }
@media (hover: hover) { .o-tab button:hover { border-color: var(--muted) } }
.o-tab button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.o-tab button[aria-pressed="true"] { border-color: var(--accent); background: var(--active) }
.o-tab button > span:first-of-type { font-weight: 500; color: var(--ink) }
.o-tab b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums }
.o-tab small { grid-column: 2 / -1; font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
@media (max-width: 640px) {
  .the-dau .bieu, .the-dau .mo-ta { display: none }
  .o-tab { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
  .o-tab button { padding: 10px 12px }
  .o-tab small { white-space: normal; overflow: visible }   /* 390px: câu «ai làm gì» xuống dòng, không cắt */
}

/* ASTRYX trạng thái bấm (Tú duyệt 17/11, lát A): nhấn = phủ nhẹ + thu 2%, ≤ 180ms; nút đang gửi giữ bề rộng, con trỏ chờ. */
button:not(:disabled):not(.chinh):not(.nguy):not([aria-pressed="true"]):not(.o-ngay.dau button):active, .btn:not([aria-disabled="true"]):not(.chinh):not(.nguy):not([aria-pressed="true"]):active { box-shadow: inset 0 0 0 999px var(--phu-an); transition: box-shadow 120ms ease-out }
.btn.chinh:not([aria-disabled="true"]):active { box-shadow: inset 0 0 0 2px var(--on-accent) }   /* DESIGN 7.6 (D2): nút chính giữ nền, lúc chạm viền trong 2px */
.btn.nguy:not([aria-disabled="true"]):active { box-shadow: inset 0 0 0 2px var(--bad) }   /* DESIGN 7.6 (D2): nút nguy hiểm viền trong 2px --bad */
[aria-busy="true"] { cursor: progress }
@media (prefers-reduced-motion: reduce) { .toast { transition: none } }

/* ASTRYX forced-colors (chế độ tương phản cao Windows): trạng thái chọn dựa vào nền sẽ mất → viền màu hệ thống; chấm / biểu đồ giữ màu. */
@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight }
  .toast, dialog, .khoi { border: 1px solid CanvasText }
  .ck[aria-pressed="true"], .seg button[aria-pressed="true"], .khu-ray button[aria-pressed="true"], .gon-nhom-gon button[aria-pressed="true"], .o-tab button[aria-pressed="true"], .menu a[aria-current="page"], .lenh-ds a.chon { outline: 2px solid Highlight; outline-offset: -2px }
  .tabs button[aria-selected="true"] { border-bottom-color: Highlight }
  .den, .chip::before, .mau-chip::before, .gon-den::before, .o-ngay button.tam::after, svg.bd, .tr-wrap svg { forced-color-adjust: none }
  button:disabled, [aria-disabled="true"] { color: GrayText; border-color: GrayText }
}
