/*
 * HT Lịch Việt – giao diện công cụ lịch. Chỉ nạp ở trang có công cụ.
 *
 * Theme con đang ép màu/độ đậm bằng "#main p { ... !important }", nên các
 * selector dưới đây dùng :is(#main, body) để có độ ưu tiên ngang #main
 * mà vẫn chạy khi công cụ nằm ngoài #main.
 */

:is(#main, body) .htl-tet,
:is(#main, body) .htl-dl,
:is(#main, body) .htl-shortcuts,
:is(#main, body) .htl-plan,
:is(#main, body) .htl-faq {
	box-sizing: border-box;
}
:is(#main, body) .htl-ico {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

/* ================= KHUNG ĐẾM NGƯỢC ================= */
:is(#main, body) .htl-tet {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	margin: 0 0 18px;
	padding: 30px 24px 26px;
	border-radius: 16px;
	text-align: center;
	color: #fff;
	background:
		radial-gradient(circle at 50% -10%, rgba(255, 210, 80, .30), transparent 55%),
		radial-gradient(circle at 0% 100%, rgba(120, 0, 0, .45), transparent 50%),
		linear-gradient(160deg, #e3120b 0%, #c00000 55%, #9e0000 100%);
	box-shadow: 0 10px 28px rgba(150, 0, 0, .25);
}
/* Viền hoa văn mảnh bên trong */
:is(#main, body) .htl-tet::after {
	content: "";
	position: absolute;
	inset: 8px;
	z-index: -1;
	border: 1px dashed rgba(255, 196, 0, .45);
	border-radius: 11px;
	pointer-events: none;
}

/* Hoạ tiết trang trí (SVG tự vẽ, không chặn click) */
:is(#main, body) .htl-tet__deco {
	position: absolute;
	z-index: -1;
	pointer-events: none;
	background: no-repeat center / contain;
}
:is(#main, body) .htl-tet__deco--den { top: 0; left: 3%; width: 110px; height: 184px; background-image: url(img/den-long.svg); }
:is(#main, body) .htl-tet__deco--phao { top: 6px; right: 2%; width: 128px; height: 172px; background-image: url(img/phao.svg); }
:is(#main, body) .htl-tet__deco--hoa1 { bottom: 16%; left: 6%; width: 64px; height: 64px; background-image: url(img/phao-hoa.svg); }
:is(#main, body) .htl-tet__deco--hoa2 { top: 34%; right: 12%; width: 42px; height: 42px; opacity: .7; background-image: url(img/phao-hoa.svg); }

/* Chữ chung trong khung */
:is(#main, body) .htl-tet p {
	margin: 0 0 8px;
	color: #fff !important;
	font-weight: 400 !important;
	line-height: 1.5;
}
:is(#main, body) .htl-tet strong,
:is(#main, body) .htl-tet b {
	color: #ffc400 !important;
	font-weight: 700 !important;
}

:is(#main, body) .htl-tet p.htl-tet__kicker {
	display: inline-block;
	margin-bottom: 10px;
	padding: 4px 14px;
	border-radius: 999px;
	background: rgba(255, 196, 0, .16);
	color: #ffe08a !important;
	font-size: 13px;
	font-weight: 700 !important;
	letter-spacing: 1px;
	text-transform: uppercase;
}
/* Câu trả lời chính – thứ Google và người đọc cần nhất */
:is(#main, body) .htl-tet p.htl-tet__answer {
	max-width: 820px;
	margin: 0 auto 14px;
	font-size: clamp(19px, 2.6vw, 26px);
	font-weight: 700 !important;
	line-height: 1.3;
}
:is(#main, body) .htl-tet__answer strong {
	white-space: nowrap;
	font-size: 1.15em;
}

/* Thông tin nhanh dạng "chip" */
:is(#main, body) .htl-tet__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 auto 18px;
	padding: 0;
	list-style: none;
}
:is(#main, body) .htl-tet__chips li.htl-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .2);
	color: #fff !important;
	font-size: 14px;
	line-height: 1.35;
	text-align: left;
}
:is(#main, body) .htl-chip .htl-ico { width: 18px; height: 18px; color: #ffc400; }
:is(#main, body) .htl-chip a { color: #fff !important; text-decoration: none; }
:is(#main, body) .htl-chip a:hover { text-decoration: underline; }

/* Nhãn "Chỉ còn" trên đồng hồ 4 ô */
:is(#main, body) .htl-tet p.htl-tet__live {
	margin: 6px 0 10px;
	color: #ffe08a !important;
	font-size: 17px;
	font-weight: 700 !important;
	letter-spacing: 1px;
	text-transform: uppercase;
}

/* Mốc của đồng hồ (dưới 4 ô): đến mùng 1 – dương lịch – âm lịch */
:is(#main, body) .htl-tet__moc { margin: 14px auto 6px; max-width: 680px; }
:is(#main, body) .htl-tet p.htl-tet__moc-title {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 700 !important;
}
:is(#main, body) .htl-tet p.htl-tet__moc-duong {
	margin: 0 0 2px;
	color: #ffe08a !important;
	font-size: 16px;
	font-weight: 700 !important;
}
:is(#main, body) .htl-tet p.htl-tet__moc-am {
	margin: 0;
	font-size: 15px;
	opacity: .92;
}

/* Đồng hồ 4 ô */
:is(#main, body) .htl-tet__timer {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	max-width: 720px;
	margin: 0 auto 16px;
}
:is(#main, body) .htl-box {
	position: relative;
	overflow: hidden;
	padding: 12px 8px 14px;
	border-radius: 14px;
	background: #fff8ec;
	box-shadow: inset 0 -4px 0 rgba(160, 0, 0, .15), 0 4px 0 rgba(90, 0, 0, .25);
	text-align: center;
}
/* Hình minh hoạ góc ô */
:is(#main, body) .htl-box::after {
	content: "";
	position: absolute;
	right: -8px;
	bottom: -8px;
	width: 48px;
	height: 48px;
	opacity: .9;
	background: no-repeat center / contain;
	pointer-events: none;
}
:is(#main, body) .htl-box--d::after { background-image: url(img/lich.svg); }
:is(#main, body) .htl-box--h::after { background-image: url(img/den-long.svg); width: 34px; height: 56px; bottom: -14px; }
:is(#main, body) .htl-box--m::after { background-image: url(img/hoa-mai.svg); }
:is(#main, body) .htl-box--s::after { background-image: url(img/phao-hoa.svg); filter: drop-shadow(0 0 1px #b36b00); }
:is(#main, body) .htl-box__lb {
	display: block;
	color: #a30000;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}
:is(#main, body) .htl-tet .htl-box b {
	position: relative;
	z-index: 1;
	display: block;
	color: #c00000 !important;
	font-size: clamp(34px, 6.4vw, 58px);
	font-weight: 800 !important;
	line-height: 1.1;
	font-variant-numeric: tabular-nums; /* chữ số đều nhau, không nhảy layout */
}

:is(#main, body) .htl-tet p.htl-tet__wish {
	margin: 4px 0 14px;
	color: #ffe08a !important;
	font-size: clamp(16px, 2.4vw, 20px);
	font-style: italic;
	font-weight: 700 !important;
	letter-spacing: .5px;
}
:is(#main, body) .htl-tet p.htl-tet__greet {
	color: #ffc400 !important;
	font-size: clamp(24px, 5vw, 40px);
	font-weight: 800 !important;
}

/* Nút chia sẻ */
:is(#main, body) .htl-share {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 9px 18px;
	border: 0;
	border-radius: 999px;
	background: #ffc400;
	color: #7a0000;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	box-shadow: 0 3px 0 #b88a00;
}
:is(#main, body) .htl-share:hover { background: #ffd23d; }
:is(#main, body) .htl-share:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
:is(#main, body) .htl-tet__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
:is(#main, body) .htl-share--alt { background: rgba(255, 255, 255, .14); color: #fff !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); text-decoration: none !important; }
:is(#main, body) .htl-share--alt:hover { background: rgba(255, 255, 255, .24); }
:is(#main, body) .htl-share[hidden] { display: none; }

/* ================= LỐI TẮT CÔNG CỤ ================= */
:is(#main, body) .htl-shortcuts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin: 0 0 18px;
}
:is(#main, body) .htl-sc {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #f0d6d0;
	border-radius: 12px;
	background: #fff;
	color: #1a1a1a !important;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}
:is(#main, body) .htl-sc .htl-ico {
	width: 34px;
	height: 34px;
	padding: 7px;
	border-radius: 10px;
	background: #fdecea;
	color: #c00000;
	box-sizing: border-box;
}
:is(#main, body) .htl-sc:hover { border-color: #c00000; transform: translateY(-1px); }

/* ================= KHỐI LÀM NHÀ KỊP TẾT (màu thương hiệu Hometalk) ================= */
:is(#main, body) .htl-plan {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 16px 18px;
	margin: 0 0 24px;
	padding: 18px 20px;
	border-radius: 14px;
	background: #151515;
	color: #fff;
	border-left: 6px solid #ffe234;
}
:is(#main, body) .htl-plan p { margin: 0; color: #fff !important; font-weight: 400 !important; line-height: 1.5; }
:is(#main, body) .htl-plan__icon .htl-ico {
	width: 52px;
	height: 52px;
	padding: 11px;
	border-radius: 14px;
	background: #ffe234;
	color: #151515;
	box-sizing: border-box;
}
:is(#main, body) .htl-plan p.htl-plan__kicker { color: #ffe234 !important; font-size: 13px; font-weight: 700 !important; letter-spacing: 1px; text-transform: uppercase; }
:is(#main, body) .htl-plan p.htl-plan__head { margin: 2px 0 4px; font-size: clamp(17px, 2.4vw, 21px); font-weight: 700 !important; }
:is(#main, body) .htl-plan p.htl-plan__text a { color: #ffe234 !important; text-decoration: underline; text-underline-offset: 2px; font-weight: 600 !important; }
:is(#main, body) .htl-plan p.htl-plan__text a:hover { color: #fff07a !important; }
:is(#main, body) .htl-plan p.htl-plan__note { margin-top: 6px; color: #bdbdbd !important; font-size: 13px; }
:is(#main, body) .htl-plan--late p.htl-plan__head { color: #ffb4a8 !important; }
:is(#main, body) .htl-plan__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border-radius: 10px;
	background: #ffe234;
	color: #151515 !important;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}
:is(#main, body) .htl-plan__cta:hover { background: #fff07a; }

/* ================= BẢNG ================= */
:is(#main, body) .htl-h { margin-top: 28px; }
:is(#main, body) .htl-note { color: #444; }
:is(#main, body) .htl-table-wrap {
	overflow-x: auto;
	margin: 0 0 24px;
	border: 1px solid #f0d6d0;
	border-radius: 12px;
}
:is(#main, body) .htl-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 15px; }
:is(#main, body) .htl-table th,
:is(#main, body) .htl-table td {
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid #f3e3df;
	text-align: left;
	vertical-align: middle;
}
:is(#main, body) .htl-table thead th { background: #c00000; color: #fff !important; font-weight: 700 !important; white-space: nowrap; }
:is(#main, body) .htl-table tbody tr:nth-child(even) { background: #fff9f5; }
:is(#main, body) .htl-table tbody tr:last-child th,
:is(#main, body) .htl-table tbody tr:last-child td { border-bottom: 0; }
:is(#main, body) .htl-table tbody th { font-weight: 700 !important; white-space: nowrap; }
:is(#main, body) .htl-table td:last-child { white-space: nowrap; }
:is(#main, body) .htl-table tbody tr.is-main { background: #fff1c2; }
:is(#main, body) .htl-table tbody tr.is-main th { color: #b00000 !important; }
:is(#main, body) .htl-table tbody tr.is-past { opacity: .55; }

/* ================= HỎI ĐÁP ================= */
:is(#main, body) .htl-faq { margin: 0 0 24px; }
:is(#main, body) .htl-faq__item {
	margin: 0 0 8px;
	border: 1px solid #f0d6d0;
	border-radius: 12px;
	background: #fff;
}
:is(#main, body) .htl-faq__item summary {
	position: relative;
	padding: 12px 44px 12px 16px;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}
:is(#main, body) .htl-faq__item summary::-webkit-details-marker { display: none; }
:is(#main, body) .htl-faq__item summary::after {
	content: "+";
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	color: #c00000;
	font-size: 22px;
	font-weight: 700;
}
:is(#main, body) .htl-faq__item[open] summary::after { content: "–"; }
:is(#main, body) .htl-faq__item p { margin: 0; padding: 0 16px 14px; }

/* ================= MOBILE ================= */
@media (max-width: 640px) {
	:is(#main, body) .htl-tet { padding: 24px 12px 20px; border-radius: 14px; }
	:is(#main, body) .htl-tet p.htl-tet__kicker,
	:is(#main, body) .htl-tet p.htl-tet__answer { padding: 0 26px; }
	:is(#main, body) .htl-tet__deco--den { left: -2px; width: 38px; height: 64px; opacity: .6; }
	:is(#main, body) .htl-tet__deco--phao { top: 2px; right: -2px; width: 42px; height: 58px; opacity: .6; }
	:is(#main, body) .htl-tet__deco--hoa1,
	:is(#main, body) .htl-tet__deco--hoa2 { display: none; }
	:is(#main, body) .htl-tet__chips li.htl-chip { width: 100%; justify-content: flex-start; border-radius: 12px; }
	:is(#main, body) .htl-tet__timer { gap: 6px; }
	:is(#main, body) .htl-box { padding: 8px 4px 10px; border-radius: 10px; }
	:is(#main, body) .htl-box__lb { font-size: 11px; letter-spacing: .5px; }
	:is(#main, body) .htl-box::after { width: 30px; height: 30px; right: -6px; bottom: -6px; opacity: .55; }
	:is(#main, body) .htl-box--h::after { width: 22px; height: 36px; bottom: -10px; }

	:is(#main, body) .htl-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	:is(#main, body) .htl-sc { padding: 10px; font-size: 14px; }

	:is(#main, body) .htl-plan { grid-template-columns: 1fr; padding: 16px; }
	:is(#main, body) .htl-plan__icon { display: none; }
	:is(#main, body) .htl-plan__cta { justify-content: center; white-space: normal; }

	/* Bảng thành thẻ, nhãn cột lấy từ data-label */
	:is(#main, body) .htl-table-wrap { overflow: visible; border: 0; border-radius: 0; }
	:is(#main, body) .htl-table thead { display: none; }
	:is(#main, body) .htl-table,
	:is(#main, body) .htl-table tbody,
	:is(#main, body) .htl-table tr,
	:is(#main, body) .htl-table th,
	:is(#main, body) .htl-table td { display: block; width: 100%; box-sizing: border-box; }
	:is(#main, body) .htl-table tbody tr,
	:is(#main, body) .htl-table tbody tr:nth-child(even) {
		margin: 0 0 10px;
		border: 1px solid #f0d6d0;
		border-radius: 10px;
		background: #fff;
		overflow: hidden;
	}
	:is(#main, body) .htl-table tbody tr.is-main { background: #fff1c2; }
	:is(#main, body) .htl-table tbody th { padding: 9px 12px; background: #fbeae6; border-bottom: 1px solid #f0d6d0; }
	:is(#main, body) .htl-table tbody tr.is-main th { background: #ffe08a; }
	:is(#main, body) .htl-table td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		padding: 7px 12px;
		border-bottom: 1px dashed #f3e3df;
		text-align: right;
		white-space: normal;
	}
	:is(#main, body) .htl-table td:last-child { border-bottom: 0; white-space: normal; }
	:is(#main, body) .htl-table td::before { content: attr(data-label); color: #8a5a50; font-weight: 600; text-align: left; }
}

/* ================= LỊCH NGÀY – KHUNG NHỎ ================= */
:is(#main, body) .htl-day {
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto 24px;
	overflow: hidden;
	border: 1px solid #f0d6d0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(120, 0, 0, .08);
}
:is(#main, body) .htl-day__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	background: #c00000;
	color: #fff;
	font-weight: 700;
}
:is(#main, body) .htl-day__head span { display: inline-flex; align-items: center; gap: 8px; }
:is(#main, body) .htl-day__head .htl-ico { color: #ffc400; }
:is(#main, body) .htl-day__main {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
:is(#main, body) .htl-day__col {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 14px 10px 16px;
	text-align: center;
}
:is(#main, body) .htl-day__col--lunar { background: #fff8ec; border-left: 1px dashed #f0d6d0; }
:is(#main, body) .htl-day__lb { color: #8a5a50; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
:is(#main, body) .htl-day__num {
	color: #c00000;
	font-size: clamp(56px, 11vw, 84px);
	font-weight: 800;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
}
:is(#main, body) .htl-day__col--lunar .htl-day__num { color: #b36b00; }
:is(#main, body) .htl-day__sub { color: #333; font-size: 15px; font-weight: 600; }
:is(#main, body) .htl-day__info {
	margin: 0;
	padding: 12px 16px;
	border-top: 1px solid #f3e3df;
	list-style: none;
}
:is(#main, body) .htl-day__info li {
	margin: 0 0 8px;
	color: #222 !important;
	font-size: 15px;
	line-height: 1.5;
}
:is(#main, body) .htl-day__info li:last-child { margin-bottom: 0; }
:is(#main, body) .htl-day__info b { color: #8a1c10 !important; }
:is(#main, body) .htl-tag {
	display: inline-block;
	padding: 1px 10px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
}
:is(#main, body) .htl-tag.is-good { background: #e6f6ea; color: #157a32; }
:is(#main, body) .htl-tag.is-bad { background: #f3f0f0; color: #555; }
:is(#main, body) .htl-day__gio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
:is(#main, body) .htl-gio {
	padding: 2px 9px;
	border: 1px solid #ffd98a;
	border-radius: 8px;
	background: #fff8e1;
	color: #7a4a00;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}
:is(#main, body) .htl-gio small { color: #a07a3a; font-weight: 500; }
:is(#main, body) .htl-day__links {
	display: flex;
	gap: 10px;
	padding: 12px 16px 16px;
	border-top: 1px solid #f3e3df;
}
:is(#main, body) .htl-btn {
	flex: 1;
	padding: 10px 14px;
	border-radius: 10px;
	background: #c00000;
	color: #fff !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}
:is(#main, body) .htl-btn:hover { background: #a30000; }
:is(#main, body) .htl-btn--ghost { background: #fff; color: #c00000 !important; border: 1px solid #c00000; }
:is(#main, body) .htl-btn--ghost:hover { background: #fdecea; }
@media (max-width: 640px) {
	:is(#main, body) .htl-day__head { font-size: 14px; padding: 9px 12px; }
	:is(#main, body) .htl-day__info { padding: 12px; }
	:is(#main, body) .htl-day__links { padding: 12px; }
}

/* ================= ĐIỀU HƯỚNG NGÀY / THÁNG ================= */
:is(#main, body) .htl-nav,
:is(#main, body) .htl-month__form {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
}
:is(#main, body) .htl-nav__form { display: flex; gap: 6px; margin: 0; }
:is(#main, body) .htl-nav input[type="date"],
:is(#main, body) .htl-month__form select {
	width: auto;
	height: 40px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid #e3c6bf;
	border-radius: 10px;
	background: #fff;
	font-size: 15px;
	box-shadow: none;
}
:is(#main, body) .htl-nav button,
:is(#main, body) .htl-month__form button {
	height: 40px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: #c00000;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 40px;
	text-transform: none;
	cursor: pointer;
}
:is(#main, body) .htl-nav__btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid #e3c6bf;
	border-radius: 10px;
	background: #fff;
	color: #c00000 !important;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
:is(#main, body) .htl-nav__btn:hover { background: #fdecea; }
:is(#main, body) .htl-nav__btn--today { background: #fff1c2; border-color: #ffd98a; color: #7a4a00 !important; }

/* ================= TRANG LỊCH NGÀY ================= */
:is(#main, body) .htl-table--kv th { width: 34%; background: #fff9f5; }
:is(#main, body) .htl-hours {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 0 0 24px;
}
:is(#main, body) .htl-hours__col { padding: 12px 14px; border-radius: 12px; }
:is(#main, body) .htl-hours__col.is-good { background: #e9f7ed; border: 1px solid #bfe5c8; }
:is(#main, body) .htl-hours__col.is-bad { background: #f5f3f3; border: 1px solid #e2dddd; }
:is(#main, body) .htl-hours p.htl-hours__title { margin: 0 0 6px; font-weight: 800 !important; }
:is(#main, body) .htl-hours__col.is-good p.htl-hours__title { color: #157a32 !important; }
:is(#main, body) .htl-hours__col.is-bad p.htl-hours__title { color: #555 !important; }
:is(#main, body) .htl-hours ul { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
:is(#main, body) .htl-hours li { margin: 0; }

/* Bảng 12 giờ */
:is(#main, body) .htl-table--hours tbody tr.is-good { background: #eef9f1; }
:is(#main, body) .htl-table--hours tbody tr.is-good th { color: #157a32 !important; }
:is(#main, body) .htl-table--hours tbody tr.is-bad { background: #fff; }
:is(#main, body) p.htl-note--small { color: #666 !important; font-size: 13px; }

/* ================= LỊCH THÁNG ================= */
:is(#main, body) .htl-month { margin: 0 0 24px; }
:is(#main, body) .htl-month__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
}
:is(#main, body) .htl-month__title { flex: 1; margin: 0; text-align: center; font-size: clamp(20px, 3vw, 28px); }
:is(#main, body) p.htl-month__sub { margin: 0 0 12px; color: #8a5a50 !important; text-align: center; }
:is(#main, body) .htl-month__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0 0 14px;
}
:is(#main, body) .htl-month__chips a {
	min-width: 44px;
	padding: 6px 8px;
	border: 1px solid #f0d6d0;
	border-radius: 8px;
	background: #fff;
	color: #333 !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}
:is(#main, body) .htl-month__chips a:hover { border-color: #c00000; }
:is(#main, body) .htl-month__chips a.is-active { background: #c00000; border-color: #c00000; color: #fff !important; }

:is(#main, body) .htl-cal {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	padding: 8px;
	border: 1px solid #f0d6d0;
	border-radius: 14px;
	background: #fff;
}
:is(#main, body) .htl-cal__wd {
	padding: 6px 0;
	border-radius: 8px;
	background: #c00000;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-align: center;
}
:is(#main, body) .htl-cal__wd.is-sun { background: #8f0000; }
:is(#main, body) .htl-cal__cell {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 82px;
	padding: 6px 8px;
	border: 1px solid #f3e3df;
	border-radius: 10px;
	background: #fff;
	color: #222 !important;
	text-decoration: none;
	transition: border-color .15s, background .15s;
}
:is(#main, body) a.htl-cal__cell:hover { border-color: #c00000; background: #fff7f5; }
:is(#main, body) .htl-cal__cell.is-empty { border: 0; background: transparent; }
:is(#main, body) .htl-cal__d { font-size: 22px; font-weight: 800; line-height: 1; }
:is(#main, body) .htl-cal__cell.is-sun .htl-cal__d { color: #c00000; }
:is(#main, body) .htl-cal__l { align-self: flex-end; color: #8a7a70; font-size: 13px; }
:is(#main, body) .htl-cal__l.is-first { color: #c00000; font-weight: 800; }
:is(#main, body) .htl-cal__ev {
	overflow: hidden;
	margin-top: 2px;
	color: #b00000;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Chấm xanh = ngày hoàng đạo */
:is(#main, body) .htl-cal__cell.is-good::after {
	content: "";
	position: absolute;
	top: 8px;
	right: 8px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #1e9e45;
}
:is(#main, body) .htl-cal__cell.has-event { background: #fff4f2; }
:is(#main, body) .htl-cal__cell.is-today { background: #fff1c2; border: 2px solid #ffb800; }

:is(#main, body) p.htl-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 10px 0 18px;
	color: #555 !important;
	font-size: 13px;
}
:is(#main, body) .htl-legend span { display: inline-flex; align-items: center; gap: 6px; }
:is(#main, body) .htl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
:is(#main, body) .htl-dot.is-good { background: #1e9e45; }
:is(#main, body) .htl-dot.is-today { background: #ffb800; }
:is(#main, body) .htl-dot.is-ev { background: #f3b4aa; }

:is(#main, body) .htl-month__lists {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px 20px;
}
:is(#main, body) .htl-month__lists ul { margin: 0; padding-left: 18px; }
:is(#main, body) .htl-h3 { margin: 0 0 6px; font-size: 17px; }

@media (max-width: 640px) {
	:is(#main, body) .htl-nav__btn span { display: none; }
	:is(#main, body) .htl-hours,
	:is(#main, body) .htl-hours ul { grid-template-columns: 1fr; }
	:is(#main, body) .htl-hours ul { grid-template-columns: 1fr 1fr; }
	:is(#main, body) .htl-cal { gap: 2px; padding: 4px; }
	:is(#main, body) .htl-cal__wd { font-size: 11px; padding: 4px 0; border-radius: 6px; }
	:is(#main, body) .htl-cal__cell { min-height: 54px; padding: 4px 5px; border-radius: 7px; }
	:is(#main, body) .htl-cal__d { font-size: 16px; }
	:is(#main, body) .htl-cal__l { font-size: 11px; }
	:is(#main, body) .htl-cal__ev { display: none; }
	:is(#main, body) .htl-cal__cell.is-good::after { top: 5px; right: 5px; width: 5px; height: 5px; }
	:is(#main, body) .htl-month__chips { display: grid; grid-template-columns: repeat(6, 1fr); }
	:is(#main, body) .htl-month__chips a { min-width: 0; padding: 6px 2px; }
}

/* ================= CÔNG CỤ: TUỔI LÀM NHÀ · HƯỚNG NHÀ · XUẤT HÀNH ================= */
:is(#main, body) .htl-tool { margin: 0 0 24px; }
:is(#main, body) .htl-form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin: 0 0 8px;
	padding: 16px;
	border: 1px solid #f0d6d0;
	border-radius: 14px;
	background: #fff9f5;
}
:is(#main, body) .htl-form__field { display: flex; flex: 1 1 200px; flex-direction: column; gap: 4px; margin: 0; font-weight: 700; color: #6b2a1f; }
:is(#main, body) .htl-form__field span { font-size: 14px; }
:is(#main, body) .htl-form select,
:is(#main, body) .htl-form input[type="date"] {
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid #e3c6bf;
	border-radius: 10px;
	background: #fff;
	font-size: 15px;
	box-shadow: none;
}
:is(#main, body) .htl-form button {
	flex: 0 0 auto;
	height: 42px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 10px;
	background: #c00000;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 42px;
	text-transform: none;
	cursor: pointer;
}
:is(#main, body) .htl-form button:hover { background: #a30000; }

:is(#main, body) .htl-result {
	margin: 16px 0 8px;
	padding: 16px 18px 6px;
	border: 1px solid #f0d6d0;
	border-left: 6px solid #1e9e45;
	border-radius: 14px;
	background: #fff;
}
:is(#main, body) .htl-result.is-bad { border-left-color: #d9480f; }
:is(#main, body) .htl-result__title { margin: 0 0 4px; font-size: clamp(18px, 2.6vw, 22px); }
:is(#main, body) p.htl-result__sub { margin: 0 0 12px; color: #6b5a55 !important; }
:is(#main, body) p.htl-result__verdict {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f4faf6;
	font-weight: 700 !important;
}
:is(#main, body) .htl-result.is-bad p.htl-result__verdict { background: #fff4ee; }
:is(#main, body) p.htl-result__next { margin: 0 0 12px; }
:is(#main, body) .htl-tag.is-warn { background: #fff0e6; color: #b23c00; }
:is(#main, body) .htl-table tbody tr.is-good { background: #f4faf6; }
:is(#main, body) .htl-table th a { color: #c00000 !important; text-decoration: none; }
:is(#main, body) .htl-table th a:hover { text-decoration: underline; }

:is(#main, body) .htl-years {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}
:is(#main, body) .htl-years li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid #f0d6d0;
	border-radius: 10px;
	background: #fff;
}
:is(#main, body) .htl-years a { color: #c00000 !important; font-weight: 700; text-decoration: none; }
:is(#main, body) .htl-years small { color: #8a7a70; }
@media (max-width: 640px) {
	:is(#main, body) .htl-form { padding: 12px; }
	:is(#main, body) .htl-form button { width: 100%; }
}

/* Người dùng bật giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
	:is(#main, body) .htl-sc,
	:is(#main, body) .htl-cal__cell { transition: none; }
}

/* Màn hình rất hẹp (≤360px): kicker không bị xuống 2 dòng */
@media (max-width: 360px) {
	:is(#main, body) .htl-tet p.htl-tet__kicker { font-size: 11.5px; letter-spacing: .3px; padding: 4px 10px; }
	:is(#main, body) .htl-tet p.htl-tet__live { font-size: 15px; }
	:is(#main, body) .htl-tet p.htl-tet__moc-title { font-size: 16px; }
	:is(#main, body) .htl-tet p.htl-tet__moc-duong { font-size: 15px; }
	:is(#main, body) .htl-tet p.htl-tet__moc-am { font-size: 14px; }
}

:is(#main, body) .htl-tet .htl-nowrap { white-space: nowrap; }

/* ================= ĐẾM NGƯỢC TẾT DƯƠNG LỊCH ([ht_lich type="tet-duong"]) =================
 * Nền đỏ tươi cùng tông khung Tết Nguyên đán, gradient chuyển đỏ sáng → đỏ đậm, ánh vàng góc trên.
 */
:is(#main, body) .htl-dl {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	margin: 0 auto 18px;
	max-width: 900px;
	padding: 30px 22px 24px;
	border-radius: 18px;
	text-align: center;
	color: #fff;
	background:
		radial-gradient(circle at 50% -15%, rgba(255, 210, 80, .32), transparent 55%),
		radial-gradient(circle at 100% 100%, rgba(110, 0, 0, .45), transparent 50%),
		linear-gradient(135deg, #ff3b1f 0%, #e3120b 35%, #c00000 70%, #9e0000 100%);
	box-shadow: 0 12px 30px rgba(160, 0, 0, .28);
}
/* Viền nét đứt vàng bên trong (giống khung Tết Nguyên đán) */
:is(#main, body) .htl-dl::after {
	content: "";
	position: absolute;
	inset: 8px;
	z-index: -1;
	border: 1px dashed rgba(255, 196, 0, .45);
	border-radius: 13px;
	pointer-events: none;
}
:is(#main, body) .htl-dl::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: -90px;
	left: -90px;
	width: 260px;
	height: 260px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
	pointer-events: none;
}
:is(#main, body) .htl-dl p {
	margin: 0;
	color: #fff !important;
	font-weight: 400 !important;
	line-height: 1.45;
}
:is(#main, body) .htl-dl b,
:is(#main, body) .htl-dl strong { color: #ffd54a !important; font-weight: 700 !important; }

:is(#main, body) .htl-dl p.htl-dl__kicker {
	display: inline-block;
	margin-bottom: 14px;
	padding: 4px 14px;
	border-radius: 999px;
	background: rgba(255, 196, 0, .16);
	color: #ffe08a !important;
	font-size: 13px;
	font-weight: 700 !important;
	letter-spacing: 1px;
	text-transform: uppercase;
}
:is(#main, body) .htl-dl p.htl-dl__greet { margin-bottom: 10px; color: #ffd54a !important; font-size: 22px; font-weight: 800 !important; }
:is(#main, body) .htl-dl p.htl-dl__today { max-width: 760px; margin: 0 auto; font-size: clamp(19px, 2.6vw, 26px); font-weight: 700 !important; line-height: 1.35; }
:is(#main, body) .htl-dl p.htl-dl__today strong { white-space: nowrap; font-size: 1.1em; }
:is(#main, body) .htl-dl p.htl-dl__lunar { margin-top: 8px; color: #ffe08a !important; font-size: 16px; font-weight: 500 !important; }
:is(#main, body) .htl-dl__to-sub { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; opacity: .9; }
:is(#main, body) .htl-dl__line { display: block; width: 90px; height: 2px; margin: 18px auto; border-radius: 2px; background: #ffd54a; opacity: .8; }

:is(#main, body) .htl-dl p.htl-dl__only { font-size: 18px; }
:is(#main, body) .htl-dl p.htl-dl__days {
	margin: 2px 0 4px;
	color: #ffd54a !important;
	font-size: clamp(44px, 8vw, 72px);
	font-weight: 800 !important;
	line-height: 1.1;
	letter-spacing: 1px;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}
:is(#main, body) .htl-dl p.htl-dl__hms {
	font-size: clamp(20px, 3.4vw, 30px);
	font-weight: 700 !important;
	font-variant-numeric: tabular-nums;
}
:is(#main, body) .htl-dl p.htl-dl__to { margin-top: 6px; font-size: clamp(17px, 2.4vw, 22px); font-weight: 700 !important; }

/* Hộp thông tin ngày 01/01 */
:is(#main, body) .htl-dl__info {
	margin: 20px auto 0;
	padding: 16px 14px;
	border: 1px solid rgba(255, 213, 74, .45);
	border-radius: 14px;
	background: rgba(255, 255, 255, .09);
}
:is(#main, body) .htl-dl p.htl-dl__info-main { font-size: 16px; }
:is(#main, body) .htl-dl p.htl-dl__info-am { margin-top: 4px; color: #ffd54a !important; font-size: 16px; font-weight: 700 !important; }
:is(#main, body) .htl-dl p.htl-dl__info-note { margin-top: 8px; font-size: 13px; opacity: .85; }

@media (max-width: 640px) {
	:is(#main, body) .htl-dl { padding: 24px 12px 18px; border-radius: 14px; }
	:is(#main, body) .htl-dl p.htl-dl__kicker { font-size: 12px; letter-spacing: .5px; }
	:is(#main, body) .htl-dl p.htl-dl__lunar { font-size: 14px; }
	:is(#main, body) .htl-dl p.htl-dl__info-main,
	:is(#main, body) .htl-dl p.htl-dl__info-am { font-size: 15px; }
}
