/* [NBT-CSS] Bản tin sáng – thẻ tối, ưu tiên điện thoại. */
.nbt {
	--nbt-bg: #0e1526;
	--nbt-card: #151e33;
	--nbt-tile: #1c2741;
	--nbt-line: #2a3654;
	--nbt-text: #eef2fa;
	--nbt-muted: #98a3bb;
	--nbt-up: #34d399;
	--nbt-down: #fb7185;
	--nbt-blue: #2563eb;
	--nbt-purple: #6d3fdb;
	--nbt-green: #15965a;
	--nbt-accent: #6d8cff;
	background: var(--nbt-bg);
	color: var(--nbt-text);
	border-radius: 18px;
	padding: 14px;
	display: grid;
	gap: 14px;
	font-size: 15px;
	line-height: 1.45;
	font-variant-numeric: tabular-nums;
	max-width: 760px;
	margin: 0 auto 1.5em;
	box-sizing: border-box;
	overflow: hidden;
	container-type: inline-size;
}
.nbt *, .nbt *::before, .nbt *::after { box-sizing: border-box; }
.nbt p { margin: 0; }
.nbt h2, .nbt h3 { margin: 0; color: var(--nbt-text); letter-spacing: -0.01em; }
.nbt .up { color: var(--nbt-up); }
.nbt .down { color: var(--nbt-down); }
.nbt .flat { color: var(--nbt-muted); }
.nbt .nbt-muted { color: var(--nbt-muted); }
.nbt-empty { padding: 20px; text-align: center; color: var(--nbt-muted); }

/* Đầu bản tin */
.nbt-head { background: var(--nbt-card); border-radius: 14px; padding: 18px 18px 16px; }
.nbt-head h2 { font-size: 1.45em; font-weight: 800; line-height: 1.2; }
.nbt-head h2 span { color: var(--nbt-accent); }
.nbt-date {
	display: inline-block; margin: 12px 0 10px; padding: 5px 14px; border-radius: 9px;
	background: #6a3fe0; color: #fff; font-weight: 800; font-size: 1.1em; letter-spacing: 0.02em;
}
.nbt-lead { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--nbt-line); display: grid; gap: 8px; }
.nbt-ai { color: #d6dcf0; font-size: 0.95em; }

/* Khối */
.nbt-sec { background: var(--nbt-card); border-radius: 14px; overflow: hidden; border: 1px solid var(--nbt-line); }
.nbt-sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 11px 16px; color: #fff; }
.nbt-sh h3 { font-size: 1.05em; font-weight: 800; color: #fff; }
.nbt-sh span { font-size: 0.86em; opacity: 0.9; }
.nbt-blue .nbt-sh { background: var(--nbt-blue); }
.nbt-purple .nbt-sh { background: var(--nbt-purple); }
.nbt-green .nbt-sh { background: var(--nbt-green); }
.nbt-sb { padding: 14px; display: grid; gap: 12px; }

/* Ô số lớn */
.nbt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nbt-tile { background: var(--nbt-tile); border-radius: 11px; padding: 10px 12px; min-width: 0; }
.nbt-tl { color: var(--nbt-muted); font-size: 0.82em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbt-tv { font-size: 1.32em; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbt-ts { font-size: 0.86em; font-weight: 700; }

/* Dòng nhỏ */
.nbt-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.nbt-row {
	display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
	padding: 7px 0; border-bottom: 1px dashed var(--nbt-line); font-size: 0.9em; min-width: 0;
}
.nbt-rl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbt-rv { font-weight: 700; text-align: right; }
.nbt-rc { font-weight: 700; text-align: right; min-width: 4.4em; }
.nbt-chip { background: currentColor; border-radius: 6px; padding: 1px 6px; }
.nbt-chip.up { background: var(--nbt-up); color: #062b1c; }
.nbt-chip.down { background: var(--nbt-down); color: #3b0711; }
.nbt-chip.flat { background: var(--nbt-line); color: var(--nbt-text); }

.nbt-dots { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.92em; }
.nbt-dots li { position: relative; padding-left: 18px; }
.nbt-dots li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; }
.nbt-blue-dot li::before { background: var(--nbt-blue); }
.nbt-green-dot li::before { background: var(--nbt-green); }

/* VN-Index */
.nbt-vn { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.nbt-big { font-size: 2.1em; font-weight: 800; line-height: 1.05; }
.nbt-bigc { font-weight: 800; font-size: 1em; margin-top: 4px; white-space: nowrap; }
.nbt-vn-chart { background: var(--nbt-tile); border-radius: 11px; padding: 4px 4px 0; min-width: 0; }
.nbt-spark { width: 100%; height: auto; display: block; }
.nbt-spark line { stroke-width: 2.4; stroke-linecap: round; }
.nbt-spark line.up { stroke: var(--nbt-up); }
.nbt-spark line.down { stroke: var(--nbt-down); }
.nbt-spark circle.up { fill: var(--nbt-up); }
.nbt-spark circle.down { fill: var(--nbt-down); }
.nbt-spark circle.flat { fill: var(--nbt-muted); }
.nbt-spark text { fill: var(--nbt-muted); font-size: 10.5px; }
.nbt-vn30 { font-size: 1em; color: var(--nbt-muted); }
.nbt-vn30 strong { color: var(--nbt-text); font-size: 1.1em; }
.nbt-vn30 span { font-weight: 800; margin-left: 8px; }

/* Khối ngoại */
.nbt-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.nbt-bh { color: var(--nbt-muted); font-weight: 700; font-size: 0.88em; margin-bottom: 4px; }
.nbt-bar { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; }
.nbt-bar b { font-weight: 800; }
.nbt-bar i { display: block; height: 9px; border-radius: 6px; min-width: 6px; }
.nbt-bar i.up { background: var(--nbt-up); }
.nbt-bar i.down { background: var(--nbt-down); }
.nbt-bar span { font-weight: 800; }
.nbt-levels { display: grid; gap: 4px; }
.nbt-events { background: var(--nbt-tile); border-radius: 11px; padding: 10px 12px; font-size: 0.94em; }

.nbt-stale { color: #fbbf24; margin-left: 4px; font-weight: 900; cursor: help; }

.nbt-foot { color: var(--nbt-muted); font-size: 0.78em; display: grid; gap: 4px; padding: 0 4px 2px; }
.nbt-foot strong { color: var(--nbt-text); }

@media (min-width: 900px) {
	.nbt { padding: 18px; font-size: 16px; }
}
@container (min-width: 600px) {
	.nbt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.nbt-grid.nbt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-big { font-size: 2.6em; }
}
@media (max-width: 420px) {
	.nbt { padding: 10px; border-radius: 14px; }
}
@container (max-width: 440px) {
	.nbt-rows { grid-template-columns: minmax(0, 1fr); }
	.nbt-bars { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.nbt-vn { grid-template-columns: minmax(0, 1fr); }
	.nbt-tv { font-size: 1.18em; }
}

/* ---- 1.1.0 ---- */
/* Chống CSS của theme đè lên bản tin (tiêu đề, đoạn, danh sách). */
.nbt.nbt h2, .nbt.nbt h3, .nbt.nbt p, .nbt.nbt ul, .nbt.nbt li { margin: 0; padding: 0; }
.nbt.nbt .nbt-dots li, .nbt.nbt .nbt-hl li { padding-left: 18px; }
.nbt.nbt ul { list-style: none; }
.nbt.nbt a { color: #c9d6ff; text-decoration: none; }
.nbt.nbt a:hover { text-decoration: underline; }
/* Trên điện thoại: bản tin tràn hết khung bài viết (bỏ 2 lớp viền). */
@media (max-width: 600px) {
	.entry .entry-content > .nbt { margin-left: -22px; margin-right: -22px; border-radius: 0; }
}

.nbt-teal .nbt-sh { background: #0e8a80; }
.nbt-slate .nbt-sh { background: #3a4766; }

.nbt-hl { margin-top: 12px; background: var(--nbt-tile); border-radius: 11px; padding: 10px 12px; }
.nbt-hl-t { font-weight: 800; font-size: 0.86em; color: #fbbf24; margin-bottom: 4px; letter-spacing: 0.02em; text-transform: uppercase; }
.nbt-hl ul { display: grid; gap: 5px; font-size: 0.92em; }
.nbt-hl li { position: relative; }
.nbt-hl li::before { content: ""; position: absolute; left: 3px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; }

.nbt-rows.nbt-rows-1 { grid-template-columns: minmax(0, 1fr); }
.nbt-watch { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.nbt-wc { background: var(--nbt-tile); border-radius: 11px; padding: 10px 12px; min-width: 0; display: grid; gap: 6px; }
.nbt-wc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.nbt-wc header b { font-size: 1.25em; font-weight: 800; }
.nbt-wc header small { display: block; color: var(--nbt-muted); font-size: 0.8em; }
.nbt-wc-px { text-align: right; display: grid; }
.nbt-wc-v { font-size: 1.25em; font-weight: 800; }
.nbt-wc-px span:last-child { font-weight: 700; font-size: 0.9em; }
.nbt-wc .nbt-row { padding: 5px 0; }
.nbt-wc-news { border-top: 1px solid var(--nbt-line); padding-top: 6px; }

.nbt-news { display: grid; gap: 9px; }
.nbt-news li { display: grid; gap: 2px; line-height: 1.35; }
.nbt-news a { font-weight: 600; }
.nbt-news span { color: var(--nbt-muted); font-size: 0.78em; }

/* ---- 1.1.2: khối rút gọn (trang chủ / [ban_tin_tom_tat]) ---- */
.nbt.nbt-compact { max-width: none; gap: 12px; }
.nbt-home { padding-top: 8px; }
.nbt-c-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.nbt.nbt .nbt-c-head h2 { font-size: 1.4em; font-weight: 800; }
.nbt-c-head h2 span { color: var(--nbt-accent); }
.nbt-c-head p { font-size: 0.85em; }
.nbt.nbt a.nbt-c-btn { background: #6a3fe0; color: #fff; font-weight: 700; padding: 9px 16px; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.nbt.nbt a.nbt-c-btn:hover { background: #7c55ec; text-decoration: none; }
.nbt-c-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.nbt-c-vn { background: var(--nbt-card); border-radius: 12px; padding: 12px 14px; display: grid; align-content: center; }
.nbt-c-vn > span { font-size: 0.82em; }
.nbt-c-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nbt-mini { background: var(--nbt-card); border-radius: 10px; padding: 8px 10px; display: grid; min-width: 0; }
.nbt-mini span { color: var(--nbt-muted); font-size: 0.78em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbt-mini b { font-size: 1.05em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbt-mini i { font-style: normal; font-weight: 700; font-size: 0.82em; }
.nbt-c-foot { color: var(--nbt-muted); font-size: 0.75em; }
@container (min-width: 720px) {
	.nbt-c-body { grid-template-columns: minmax(200px, 0.8fr) 2.2fr; }
	.nbt-c-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.nbt-home .wrap > .nbt { border-radius: 14px; }
}

/* ================= 1.2.0: link nguồn, mốc so sánh, bố cục co giãn ================= */
.nbt { max-width: 1280px; container: nbt / inline-size; }
.nbt-sb { container: nbtsec / inline-size; }

/* Link nguồn: cả thẻ bấm được, có dấu ↗ nhỏ khi rê chuột. */
.nbt.nbt a.nbt-a { color: inherit; text-decoration: none; }
.nbt a.nbt-tile, .nbt a.nbt-mini, .nbt a.nbt-c-vn, .nbt a.nbt-vn-num { display: grid; transition: background 0.15s, box-shadow 0.15s; }
.nbt a.nbt-tile:hover, .nbt a.nbt-mini:hover, .nbt a.nbt-c-vn:hover { box-shadow: inset 0 0 0 1px var(--nbt-accent); }
.nbt a.nbt-row:hover, .nbt a.nbt-xrow:hover { background: rgba(109, 140, 255, 0.08); }
.nbt a.nbt-tile .nbt-tl::after, .nbt a.nbt-mini > span::after, .nbt a.nbt-row .nbt-rl::after, .nbt a.nbt-xrow .nbt-rl::after { content: " ↗"; opacity: 0.45; font-size: 0.85em; }
.nbt.nbt a.nbt-sym:hover b { text-decoration: underline; }
.nbt .nbt-vn-num { display: grid; align-content: start; }

/* Dòng ghi chú mốc so sánh. */
.nbt.nbt .nbt-basis { color: var(--nbt-muted); font-size: 0.76em; line-height: 1.45; border-top: 1px dashed var(--nbt-line); padding-top: 8px; }
.nbt.nbt .nbt-basis a { color: #c9d6ff; }
.nbt .nbt-cap { color: var(--nbt-muted); font-size: 0.74em; }
.nbt-wc-px em { font-style: normal; font-weight: 500; color: var(--nbt-muted); font-size: 0.82em; }

/* Chỉ số bổ sung. */
.nbt-xrows { display: grid; grid-template-columns: minmax(0, 1fr); }
.nbt-xrow { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; column-gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--nbt-line); font-size: 0.9em; align-items: baseline; }
.nbt-xrow .nbt-rl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbt-xrow .nbt-rv { font-weight: 700; text-align: right; }
.nbt-xrow .nbt-xc { grid-column: 1 / -1; font-size: 0.82em; color: var(--nbt-muted); }
.nbt-xrow .nbt-xc.up { color: var(--nbt-up); }
.nbt-xrow .nbt-xc.down { color: var(--nbt-down); }
.nbt.nbt .nbt-events ul { list-style: none; display: grid; gap: 4px; margin-top: 4px; }
.nbt.nbt .nbt-events li { padding-left: 14px; position: relative; }
.nbt.nbt .nbt-events li::before { content: "›"; position: absolute; left: 2px; color: var(--nbt-accent); }

/* Đầu bản tin. */
.nbt-head-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.nbt-head-top .nbt-date { margin-bottom: 0; }
.nbt-head-note { margin-top: 8px !important; font-size: 0.86em; }
.nbt-head-body { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--nbt-line); }
.nbt-head-body .nbt-lead { margin: 0; padding: 0; border: 0; }
.nbt-head-body .nbt-hl { margin-top: 0; }

/* Các khối: điện thoại 1 cột; máy tính bảng ngang/laptop 2 cột; màn lớn 3 cột. */
.nbt-cols { display: grid; gap: 14px; }
.nbt-cols > .nbt-sec { break-inside: avoid; }
@container nbt (min-width: 900px) {
	.nbt-cols { display: block; columns: 2; column-gap: 14px; }
	.nbt-cols > .nbt-sec { display: block; margin: 0 0 14px; }
	.nbt-head-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
	.nbt.nbt .nbt-head h2 { font-size: 1.7em; }
}
@container nbt (min-width: 1240px) {
	.nbt-cols { columns: 3; }
}

/* Lưới trong từng khối co giãn theo bề rộng khối (không theo màn hình). */
@container nbtsec (max-width: 379px) {
	.nbt-rows { grid-template-columns: minmax(0, 1fr); }
	.nbt-bars { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.nbt-vn { grid-template-columns: minmax(0, 1fr); }
	.nbt-tv { font-size: 1.15em; }
}
@container nbtsec (min-width: 380px) {
	.nbt-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container nbtsec (min-width: 520px) {
	.nbt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.nbt-grid.nbt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-xrows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
	.nbt-big { font-size: 2.4em; }
}
@container nbtsec (min-width: 800px) {
	.nbt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.nbt-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.nbt-rows.nbt-rows-1 { grid-template-columns: minmax(0, 1fr) !important; }

/* Trang bản tin: bỏ giới hạn 760px của theme để bản tin dùng hết bề rộng màn hình lớn. */
.entry:has(> .entry-content > .nbt:not(.nbt-compact)) { max-width: none !important; width: 100% !important; }
@media (min-width: 1200px) {
	.content-area:has(.entry-content > .nbt:not(.nbt-compact)) { max-width: none; }
}
/* Hàng chữ dài (LS liên ngân hàng, cà phê…): chỉ chia 2 cột khi khối đủ rộng. */
@container nbtsec (min-width: 380px) and (max-width: 559px) {
	.nbt-rows { grid-template-columns: minmax(0, 1fr); }
}
.nbt { max-width: 1600px; }
@container nbt (min-width: 1240px) { .nbt-cols { columns: 2; } }
@container nbt (min-width: 1500px) { .nbt-cols { columns: 3; } }
/* Nhãn dài được xuống dòng thay vì bị cắt "…". */
.nbt .nbt-row .nbt-rl, .nbt .nbt-xrow .nbt-rl { white-space: normal; overflow: visible; line-height: 1.3; }
.nbt .nbt-vn-chart .nbt-spark { max-height: 150px; }
/* Theme Nvanty: .content-area là lưới cột cố định 760px → mở thành 1 cột rộng cho trang bản tin. */
.content-area:has(> .entry > .entry-content > .nbt:not(.nbt-compact)) { grid-template-columns: minmax(0, 1fr) !important; }
/* Nhãn ô số liệu xuống dòng trên màn hình hẹp thay vì bị cắt. */
.nbt .nbt-tile .nbt-tl, .nbt .nbt-mini > span { white-space: normal; overflow: visible; line-height: 1.3; }
/* 1.2.2: trang bản tin – bỏ khung trắng bao ngoài, ẩn tiêu đề trang trùng lặp (vẫn giữ cho công cụ tìm kiếm). */
.entry:has(> .entry-content > .nbt:not(.nbt-compact)) { background: transparent !important; border: 0 !important; padding: 0 !important; }
.entry:has(> .entry-content > .nbt:not(.nbt-compact)) .entry-content > .nbt { margin-left: 0; margin-right: 0; border-radius: 16px; }
body:has(.entry-content > .nbt:not(.nbt-compact)) .page-head { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* Khối hẹp (điện thoại): dòng có đủ nhãn + giá trị + thay đổi thì đưa phần thay đổi xuống hàng dưới. */
@container nbtsec (max-width: 379px) {
	.nbt-row:not(:has(> .nbt-rv:empty)):has(> .nbt-rc) { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
	.nbt-row:not(:has(> .nbt-rv:empty)) > .nbt-rc { grid-column: 1 / -1; justify-self: end; font-size: 0.92em; }
}
