/* Thư viện nút số — theo bảng màu và kiểu thẻ sẵn có của thich3c.com */

.tvns,
.tvns-summary {
	--tv-teal: #018484;
	--tv-teal-dark: #016a6a;
	--tv-navy: #002050;
	--tv-muted: #5b6b85;
	--tv-amber: #ffbf3f;
	--tv-line: #e4e8f3;
	--tv-soft: #f6f8fc;
}

.tvns-page .content-area {
	padding-bottom: 50px;
}

.tvns {
	color: var(--tv-navy);
}

.tvns *,
.tvns *::before,
.tvns *::after {
	box-sizing: border-box;
}

/* Phần mở đầu */

.tvns-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 48px;
	flex-wrap: wrap;
	margin: 0 0 22px;
}

.tvns-lead {
	flex: 1 1 520px;
	max-width: 720px;
	margin: 0;
	font-size: 17px;
	line-height: 1.65;
}

.tvns-count {
	display: flex;
	gap: 26px;
	font-size: 14px;
	color: var(--tv-muted);
	white-space: nowrap;
}

.tvns-count strong {
	display: block;
	font-family: Inter, sans-serif;
	font-size: 26px;
	line-height: 1.1;
	font-weight: 700;
	color: var(--tv-navy);
	font-variant-numeric: tabular-nums;
}

.tvns-count .tvns-learned b {
	font-weight: 700;
	color: var(--tv-teal);
}

.tvns-count .tvns-learned i {
	font-style: normal;
	color: #a9b3c6;
}

/* Thanh lọc */

.tvns-bar {
	display: flex;
	align-items: center;
	gap: 12px 16px;
	flex-wrap: wrap;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--tv-line);
}

.tvns-search {
	flex: 1 1 280px;
}

.tvns .tvns-search input,
.tvns .tvns-select select {
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	font: inherit;
	font-size: 15px;
	color: var(--tv-navy);
	background-color: #fff;
	border: 1px solid #cfd6e4;
	border-radius: 0;
	box-shadow: none;
}

.tvns .tvns-select select {
	min-width: 190px;
	padding-right: 34px;
}

.tvns .tvns-search input:focus,
.tvns .tvns-select select:focus {
	border-color: var(--tv-teal);
	outline: 2px solid rgba(1, 132, 132, 0.18);
	outline-offset: 0;
}

.tvns-check,
.tvns-mark {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
}

.tvns-check input,
.tvns-mark input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--tv-teal);
}

/* Nhóm */

.tvns-groups {
	display: flex;
	gap: 0;
	margin: 0 0 26px;
	overflow-x: auto;
	background: #fff;
	border: 1px solid var(--tv-line);
	border-top: 0;
	scrollbar-width: thin;
}

.tvns .tvns-groups button {
	flex: 0 0 auto;
	margin: 0;
	padding: 13px 18px 11px;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--tv-navy);
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	white-space: nowrap;
}

.tvns .tvns-groups button span {
	margin-left: 4px;
	font-size: 13px;
	font-weight: 400;
	color: #8a96ab;
	font-variant-numeric: tabular-nums;
}

.tvns .tvns-groups button:hover {
	color: var(--tv-teal);
	background: none;
}

.tvns .tvns-groups button.is-on {
	color: var(--tv-teal);
	border-bottom-color: var(--tv-teal);
}

.tvns .tvns-groups button:focus-visible,
.tvns .tvns-calc-btn:focus-visible,
.tvns a:focus-visible {
	outline: 2px solid var(--tv-teal);
	outline-offset: -2px;
}

/* Lưới thẻ */

.tvns-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	align-items: stretch;
}

.tvns-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	background: #fff;
	border: 1px solid var(--tv-line);
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.tvns-card[hidden] {
	display: none;
}

.tvns-thumb {
	display: block;
	aspect-ratio: 2 / 1;
	background: #dfe6e6;
	overflow: hidden;
}

.tvns-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tvns-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 20px 22px 18px;
}

.tvns-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.tvns-tag {
	padding: 4px 10px;
	font-size: 13px;
	line-height: 1.4;
	color: #fff;
	background: var(--tv-teal);
}

.tvns .tvns-title {
	margin: 12px 0 0;
	font-family: Inter, sans-serif;
	font-size: 19px;
	line-height: 1.35;
	font-weight: 700;
}

.tvns .tvns-title a {
	color: var(--tv-navy);
	text-decoration: none;
}

.tvns .tvns-title a:hover {
	color: var(--tv-teal);
}

.tvns-note {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--tv-muted);
}

.tvns-formula {
	margin: 16px 0 0;
	padding: 10px 14px 12px;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	background: var(--tv-soft);
	border-left: 3px solid var(--tv-amber);
}

.tvns-formula span {
	display: block;
	margin-bottom: 2px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tv-muted);
}

.tvns-spec {
	margin: 14px 0 16px;
	padding: 0;
	font-size: 14px;
	line-height: 1.5;
}

.tvns-spec div {
	display: grid;
	grid-template-columns: 78px 1fr;
	gap: 10px;
	padding: 7px 0;
	border-top: 1px solid var(--tv-line);
}

.tvns-spec div:first-child {
	border-top: 0;
}

.tvns-spec dt {
	margin: 0;
	font-weight: 400;
	color: var(--tv-muted);
}

.tvns-spec dd {
	margin: 0;
	font-weight: 500;
}

/* Tính nhanh */

.tvns-calc {
	margin: 14px 0 0;
	padding: 14px;
	border: 1px solid var(--tv-line);
	background: #fff;
}

.tvns-calc[hidden] {
	display: none;
}

.tvns-calc-row {
	display: grid;
	grid-template-columns: 1fr 96px;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.tvns-calc-row label {
	margin: 0;
	font-size: 14px;
}

.tvns .tvns-calc-row input {
	width: 100%;
	height: 38px;
	margin: 0;
	padding: 0 10px;
	font: inherit;
	font-size: 15px;
	text-align: right;
	color: var(--tv-navy);
	background: #fff;
	border: 1px solid #cfd6e4;
	border-radius: 0;
	box-shadow: none;
	font-variant-numeric: tabular-nums;
}

.tvns .tvns-calc-row input:focus {
	border-color: var(--tv-teal);
	outline: 2px solid rgba(1, 132, 132, 0.18);
}

.tvns-calc-out {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 2px solid var(--tv-navy);
	font-size: 14px;
	font-weight: 600;
}

.tvns-calc-out output {
	font-family: Inter, sans-serif;
	font-size: 24px;
	line-height: 1;
	font-weight: 700;
	color: var(--tv-teal);
	font-variant-numeric: tabular-nums;
}

/* Chân thẻ */

.tvns-foot {
	display: flex;
	align-items: center;
	gap: 8px 12px;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--tv-line);
}

.tvns .tvns-more {
	font-size: 14px;
	font-weight: 600;
	color: var(--tv-teal);
	text-decoration: none;
}

.tvns .tvns-more:hover {
	color: var(--tv-teal-dark);
	text-decoration: underline;
}

.tvns .tvns-calc-btn {
	margin: 0;
	padding: 5px 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--tv-navy);
	background: #fff;
	border: 1px solid #cfd6e4;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.tvns .tvns-calc-btn:hover,
.tvns .tvns-calc-btn[aria-expanded="true"] {
	color: var(--tv-teal);
	border-color: var(--tv-teal);
	background: #fff;
}

.tvns-mark {
	margin-left: auto;
	color: var(--tv-muted);
}

.tvns-card.is-done .tvns-mark {
	color: var(--tv-teal);
	font-weight: 500;
}

.tvns-empty {
	margin: 10px 0 0;
	padding: 40px 20px;
	text-align: center;
	font-size: 16px;
	color: var(--tv-muted);
	background: #fff;
	border: 1px solid var(--tv-line);
}

.tvns-intro {
	margin-bottom: 24px;
}

/* Khung tóm tắt ở đầu bài viết */

.tvns-summary {
	margin: 0 0 28px;
	padding: 0;
	color: var(--tv-navy);
	background: var(--tv-soft);
	border-left: 3px solid var(--tv-amber);
}

.tvns-summary-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px 0;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tv-muted);
}

.tvns-summary-head span {
	letter-spacing: 0;
	text-transform: none;
	font-size: 14px;
}

.tvns-summary-head a {
	color: var(--tv-teal);
}

.tvns-summary dl {
	margin: 0;
	padding: 6px 18px 12px;
}

.tvns-summary dl div {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 12px;
	padding: 7px 0;
	border-top: 1px solid var(--tv-line);
	font-size: 16px;
	line-height: 1.5;
}

.tvns-summary dl div:first-child {
	border-top: 0;
}

.tvns-summary dt {
	margin: 0;
	font-weight: 400;
	color: var(--tv-muted);
}

.tvns-summary dd {
	margin: 0;
	font-weight: 600;
}

@media (max-width: 1100px) {
	.tvns-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}
}

@media (max-width: 680px) {
	.tvns-lead {
		font-size: 16px;
	}

	.tvns-count {
		gap: 20px;
	}

	.tvns-bar {
		padding: 12px;
	}

	.tvns-select,
	.tvns .tvns-select select {
		width: 100%;
	}

	.tvns-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.tvns-body {
		padding: 18px 16px 16px;
	}

	.tvns-summary dl div {
		grid-template-columns: 84px 1fr;
		font-size: 15px;
	}
}
