/* ==========================================================
   Lịch Vạn Sự - giao diện màu cam, cảm hứng tờ lịch bloc
   ========================================================== */
:root {
  --cam: #e8590c;
  --cam-dam: #c2410c;
  --cam-nhat: #fff1e4;
  --cam-vien: #fbd5b5;
  --giay: #fffdf9;
  --nen: #fbf7f2;
  --muc: #3b1405;
  --muc-2: #6b4433;
  --muc-3: #9a7b6c;
  --ngoc: #0f7b5f;
  --ngoc-nhat: #e3f4ee;
  --do: #c81e1e;
  --vang: #e9a400;
  --duong-ke: #efe3d7;
  --bong: 0 1px 0 rgba(59, 20, 5, .04), 0 12px 32px -18px rgba(120, 45, 5, .35);
  --r-lon: 18px;
  --r: 12px;
  --r-nho: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --so: "Oswald", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --rong: 1200px;
  --o: #fff;
  --o-2: #f6f0ea;
}
/* Chế độ tối */
:root[data-theme="dark"] {
  --cam: #fb7c34; --cam-dam: #fd9a5c; --cam-nhat: #3a2318; --cam-vien: #5a3826;
  --giay: #221814; --nen: #17100d; --muc: #f6e7dc; --muc-2: #d8bfb0; --muc-3: #a88d7e;
  --ngoc: #4fd1ad; --ngoc-nhat: #133129; --do: #ff7b7b; --duong-ke: #3a2a22;
  --o: #2a1e19; --o-2: #33241d;
  --bong: 0 1px 0 rgba(0,0,0,.2), 0 12px 32px -18px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme="dark"] .site-header { background: #2b170d; box-shadow: 0 2px 0 #4a2614; }
:root[data-theme="dark"] .site-footer { background: #0f0a08; }
:root[data-theme="dark"] .bloc-gay { background: #0f0a08; }
:root[data-theme="dark"] .bloc-to::after { background: #2a1e19; box-shadow: 0 5px 0 -1px #33241d; }
:root[data-theme="dark"] .tag.bt, :root[data-theme="dark"] .badge-hd.xau { background: var(--o-2); }
:root[data-theme="dark"] .tag.xau, :root[data-theme="dark"] .alert { background: #3a1717; }
:root[data-theme="dark"] .w-preview { background: #1d1410; }
:root[data-theme="dark"] .code textarea { background: #0f0a08; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muc);
  background: var(--nen);
}
img { max-width: 100%; height: auto; }
a { color: var(--cam-dam); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus-visible { text-decoration: underline; }
a:hover { color: var(--cam); }
:focus-visible { outline: 3px solid var(--vang); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--rong); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muc-3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--muc); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { background: var(--cam); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 0 var(--cam-dam); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.logo:hover { color: #fff; }
.logo-mark { width: 34px; height: 36px; flex: none; }
.logo small { display: block; font-weight: 500; font-size: .7rem; opacity: .85; margin-top: -3px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .18); color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 2px solid rgba(255,255,255,.6); color: #fff; border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--cam-dam); flex-direction: column; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { border-radius: 10px; padding: 12px; }
}

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: .85rem; color: var(--muc-3); margin: 18px 0 6px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--cam-vien); }
.crumbs a { color: var(--muc-2); text-decoration: none; }
.crumbs a:hover { color: var(--cam); text-decoration: underline; }

/* ---------- Layout ---------- */
main { padding-bottom: 56px; }
.page-head { margin: 8px 0 22px; }
.page-head p { color: var(--muc-2); max-width: 70ch; margin: 0; }
.grid-hero { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-main { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 960px) {
  .grid-hero, .grid-main, .grid-2 { grid-template-columns: 1fr; }
}
.panel { background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r-lon); padding: 22px; box-shadow: var(--bong); }
.panel + .panel { margin-top: 22px; }
.panel h2 { display: flex; align-items: center; gap: 10px; }
.panel h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--cam); flex: none; }
.section { margin-top: 28px; }

/* ---------- Tờ lịch bloc (điểm nhấn) ---------- */
.bloc { position: relative; filter: drop-shadow(0 18px 24px rgba(120, 45, 5, .18)); }
.bloc-gay {
  height: 30px; background: var(--muc); border-radius: 14px 14px 0 0; position: relative;
  display: flex; justify-content: center; gap: 70px; align-items: center;
}
.bloc-gay span { width: 14px; height: 14px; border-radius: 50%; background: var(--nen); box-shadow: inset 0 2px 3px rgba(0,0,0,.45); }
.bloc-to {
  background: var(--giay); border-radius: 0 0 6px 6px; padding: 18px 22px 22px; text-align: center;
  border-top: 2px dashed var(--duong-ke);
  position: relative;
}
.bloc-to::after { /* các tờ lịch bên dưới */
  content: ""; position: absolute; left: 6px; right: 6px; bottom: -6px; height: 6px;
  background: #f4ebe1; border-radius: 0 0 6px 6px; z-index: -1;
  box-shadow: 0 5px 0 -1px #ecdfd2;
}
.bloc-thang { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--muc-2); font-size: .95rem; }
.bloc-thang a { text-decoration: none; color: var(--muc-2); }
.bloc-so {
  font-family: var(--so); font-weight: 700; font-size: clamp(8rem, 30vw, 11.5rem); line-height: .86;
  color: var(--cam); margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: lining-nums;
}
.bloc.chu-nhat .bloc-so, .bloc.ngay-le .bloc-so { color: var(--do); }
.bloc-thu { font-size: 1.25rem; font-weight: 800; color: var(--muc); }
.bloc-le { display: inline-block; margin-top: 6px; background: var(--do); color: #fff; border-radius: 999px; padding: 2px 12px; font-size: .82rem; font-weight: 600; }
.bloc-am {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; text-align: left;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--duong-ke);
}
.bloc-am-so { font-family: var(--so); font-size: 3.6rem; line-height: 1; color: var(--muc); font-weight: 600; text-align: center; min-width: 76px; }
.bloc-am-so small { display: block; font-family: var(--font); font-size: .78rem; color: var(--muc-3); font-weight: 600; }
.bloc-am dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .9rem; }
.bloc-am dt { color: var(--muc-3); }
.bloc-am dd { margin: 0; font-weight: 700; }
.bloc-nav { display: flex; justify-content: space-between; margin-top: 16px; gap: 10px; }
.bloc-chuyen { animation: lat-to .45s ease-out; transform-origin: top center; }
@keyframes lat-to { from { transform: rotateX(-14deg); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bloc-chuyen { animation: none; } html { scroll-behavior: auto; } }

.badge-hd { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: .85rem; }
.badge-hd.tot { background: var(--ngoc-nhat); color: var(--ngoc); }
.badge-hd.xau { background: #f1eae6; color: var(--muc-2); }

/* ---------- Nút & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: 9px 18px; border: 2px solid transparent; transition: background .15s, color .15s;
}
.btn-cam { background: var(--cam); color: #fff; }
.btn-cam:hover { background: var(--cam-dam); color: #fff; }
.btn-vien { background: transparent; border-color: var(--cam-vien); color: var(--cam-dam); }
.btn-vien:hover { background: var(--cam-nhat); color: var(--cam-dam); }
.btn-nho { padding: 5px 12px; font-size: .85rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muc-2); }
.field select, .field input {
  font: inherit; font-size: 1rem; color: var(--muc); background: var(--o);
  border: 1.5px solid var(--cam-vien); border-radius: 10px; padding: 9px 12px; min-width: 88px;
}
.field input[type=color] { padding: 4px; height: 44px; min-width: 64px; cursor: pointer; }
.field select:focus, .field input:focus { border-color: var(--cam); outline: none; box-shadow: 0 0 0 3px var(--cam-nhat); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding-bottom: 10px; }
.alert { padding: 12px 16px; border-radius: var(--r); background: #fdecec; color: var(--do); font-weight: 600; margin-top: 14px; }

/* ---------- Lưới lịch tháng ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; }
.cal-head .cal-tools { display: flex; gap: 6px; align-items: center; }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { font-size: .78rem; font-weight: 700; color: var(--muc-3); padding: 4px 0; }
.cal th:last-child { color: var(--do); }
.cal td { padding: 0; vertical-align: top; }
.cal a.o {
  display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 66px;
  padding: 6px 7px; border-radius: 10px; text-decoration: none; color: var(--muc);
  background: var(--o); border: 1px solid var(--duong-ke); position: relative; transition: border-color .12s, background .12s;
}
.cal a.o:hover { border-color: var(--cam); background: var(--cam-nhat); }
.cal .o .dl { font-family: var(--so); font-size: 1.45rem; font-weight: 500; line-height: 1; }
.cal .o .al { font-size: .76rem; color: var(--muc-3); text-align: right; font-weight: 600; }
.cal .o .al.mung1 { color: var(--cam-dam); font-weight: 800; }
.cal .o.cn .dl, .cal .o.le .dl { color: var(--do); }
.cal .o.tot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ngoc); }
.cal .o.ngoai { opacity: .38; }
.cal .o.hom-nay { background: var(--cam); border-color: var(--cam); color: #fff; }
.cal .o.hom-nay .dl, .cal .o.hom-nay .al { color: #fff; }
.cal .o.hom-nay.tot::after { background: #fff; }
.cal .o.chon { outline: 2.5px solid var(--cam); outline-offset: -1px; }
.cal .o .tk { font-size: .66rem; color: var(--ngoc); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muc-3); margin-top: 10px; }
.cal-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cal-legend .l-tot::before { background: var(--ngoc); }
.cal-legend .l-cn::before { background: var(--do); }
.cal-legend .l-nay::before { background: var(--cam); }
@media (max-width: 520px) {
  .cal { border-spacing: 2px; }
  .cal a.o { min-height: 52px; padding: 4px; border-radius: 8px; }
  .cal .o .dl { font-size: 1.15rem; }
  .cal .o .al { font-size: .68rem; }
  .cal .o .tk { display: none; }
  .cal .o.tot::after { top: auto; bottom: 6px; right: auto; left: 5px; width: 6px; height: 6px; }
  .panel { padding: 16px; }
}
.cal-mini a.o { min-height: 44px; }
.cal-mini .o .dl { font-size: 1.05rem; }
.cal-mini .o .tk { display: none; }

/* ---------- Giờ hoàng đạo ---------- */
.gio { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.gio div { border-radius: 10px; padding: 8px 4px; text-align: center; background: var(--o-2); color: var(--muc-3); }
.gio div.tot { background: var(--ngoc-nhat); color: var(--ngoc); }
.gio b { display: block; font-size: 1rem; }
.gio small { font-size: .72rem; font-weight: 600; }
@media (max-width: 520px) { .gio { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Bảng thông tin ---------- */
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--duong-ke); vertical-align: top; font-size: .95rem; }
.kv th { color: var(--muc-3); font-weight: 600; width: 38%; padding-right: 12px; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: .8rem; font-weight: 700; margin: 2px 4px 2px 0; }
.tag.tot { background: var(--ngoc-nhat); color: var(--ngoc); }
.tag.xau { background: #fbe7e7; color: var(--do); }
.tag.bt { background: #f4ece5; color: var(--muc-2); }
.list-sao { list-style: none; padding: 0; margin: 0; }
.list-sao li { padding: 8px 0; border-bottom: 1px dashed var(--duong-ke); }
.list-sao li:last-child { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--duong-ke); text-align: left; }
.table thead th { background: var(--cam-nhat); color: var(--cam-dam); font-weight: 700; }
.table tbody tr:hover { background: var(--o)af5; }
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--duong-ke); background: var(--o); }

/* ---------- Danh sách ngày lễ / ngày tốt ---------- */
.le-list { list-style: none; margin: 0; padding: 0; }
.le-list li { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--duong-ke); }
.le-list li:last-child { border: 0; }
.le-ngay { text-align: center; border-radius: 10px; background: var(--cam-nhat); color: var(--cam-dam); padding: 4px 0; line-height: 1.1; }
.le-ngay b { display: block; font-family: var(--so); font-size: 1.45rem; font-weight: 600; }
.le-ngay small { font-size: .7rem; font-weight: 700; }
.le-ten { font-weight: 700; }
.le-ten small { display: block; font-weight: 500; color: var(--muc-3); font-size: .82rem; }
.con-lai { font-size: .82rem; font-weight: 700; color: var(--muc-2); white-space: nowrap; }
.con-lai.gan { color: var(--do); }

.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.day-card { display: block; text-decoration: none; color: var(--muc); background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px 16px; }
.day-card:hover { border-color: var(--cam); color: var(--muc); }
.day-card .dc-top { display: flex; align-items: baseline; gap: 10px; }
.day-card .dc-so { font-family: var(--so); font-size: 2.2rem; color: var(--cam); line-height: 1; }
.day-card .dc-diem { margin-left: auto; font-weight: 800; color: var(--ngoc); }

/* ---------- Năm ---------- */
.year-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.year-months .panel { padding: 16px; margin: 0; }
.year-months h3 a { text-decoration: none; color: var(--muc); }
.year-months h3 a:hover { color: var(--cam); }
.year-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.year-strip a { display: block; text-decoration: none; color: var(--muc); background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 12px 14px; }
.year-strip a:hover { border-color: var(--cam); }
.year-strip a.nay { border: 2px solid var(--cam); background: var(--cam-nhat); }
.year-strip .ys-nam { font-family: var(--so); font-size: 1.7rem; color: var(--cam); line-height: 1.1; }
.year-strip small { display: block; color: var(--muc-3); font-size: .8rem; }

/* ---------- Đếm ngược ---------- */
.dem { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.dem div { min-width: 96px; background: var(--muc); color: #fff; border-radius: var(--r); padding: 14px 10px 10px; text-align: center; }
.dem b { display: block; font-family: var(--so); font-size: 3rem; line-height: 1; color: #ffd8b8; font-weight: 600; }
.dem span { font-size: .85rem; opacity: .85; }

/* ---------- Bài viết ---------- */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.post { background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; }
.post h3 a, .post .post-h a { color: var(--muc); text-decoration: none; }
.post .post-h { font-size: 1.05rem; }
.post h3 a:hover { color: var(--cam); }
.post p { color: var(--muc-2); font-size: .92rem; flex: 1; }
.post .cat { font-size: .8rem; font-weight: 700; color: var(--cam-dam); text-decoration: none; margin-bottom: 6px; }
.prose { max-width: 72ch; font-size: 1.04rem; line-height: 1.75; }
.prose h2 { margin-top: 1.6em; }
.prose blockquote { margin: 1.2em 0; padding: 14px 20px; background: var(--cam-nhat); border-left: 4px solid var(--cam); border-radius: 0 var(--r) var(--r) 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--duong-ke); padding: 8px 10px; text-align: left; }
.prose th { background: var(--cam-nhat); }

/* ---------- Widget builder ---------- */
.w-builder { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .w-builder { grid-template-columns: 1fr; } }
.w-types { display: grid; gap: 8px; }
.w-type { display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; background: var(--o); border: 1.5px solid var(--duong-ke); border-radius: var(--r); padding: 12px; cursor: pointer; color: var(--muc); }
.w-type[aria-pressed="true"] { border-color: var(--cam); background: var(--cam-nhat); }
.w-type b { display: block; }
.w-type small { color: var(--muc-3); }
.w-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.w-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--o); box-shadow: 0 0 0 1.5px var(--duong-ke); cursor: pointer; }
.w-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--muc); }
.w-preview { background: repeating-conic-gradient(#f6efe8 0 25%, #fbf7f2 0 50%) 0 0 / 22px 22px; border-radius: var(--r-lon); padding: 28px; display: flex; justify-content: center; min-height: 340px; border: 1px solid var(--duong-ke); }
.w-preview iframe { border: 0; max-width: 100%; background: transparent; }
.code { position: relative; margin-top: 14px; }
.code textarea { width: 100%; min-height: 130px; padding-top: 52px !important; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #fde7d4; background: var(--muc); border: 0; border-radius: var(--r); padding: 14px; resize: vertical; }
.code .btn { position: absolute; right: 10px; top: 10px; }
.tabs { display: flex; gap: 6px; margin-top: 18px; }
.tabs button { font: inherit; font-weight: 700; font-size: .88rem; border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--muc-2); }
.tabs button[aria-selected="true"] { background: var(--cam-nhat); color: var(--cam-dam); }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; text-align: center; padding: 7px 12px; border-radius: 10px; text-decoration: none; border: 1px solid var(--duong-ke); background: var(--o); color: var(--muc); font-weight: 600; }
.pager .active { background: var(--cam); border-color: var(--cam); color: #fff; }
.pager .disabled { opacity: .4; }

/* ---------- Footer ---------- */
.site-footer { background: var(--muc); color: #e8d6cb; padding: 40px 0 24px; font-size: .92rem; }
.site-footer a { color: #ffd8b8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h3, .foot-grid .foot-h { color: #fff; font-size: 1rem; font-weight: 700; margin: 0 0 .5em; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #bfa597; font-size: .85rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* Quick links trên trang chủ */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.quick a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--muc); background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px; font-weight: 700; }
.quick a:hover { border-color: var(--cam); color: var(--cam-dam); }
.quick svg { width: 30px; height: 30px; flex: none; color: var(--cam); }
.quick small { display: block; font-weight: 500; color: var(--muc-3); font-size: .8rem; }
@media (max-width: 960px) { .quick { grid-template-columns: 1fr 1fr; } }

@media print {
  .site-header, .site-footer, .bloc-nav, .quick, .no-print { display: none !important; }
  body { background: #fff; }
}

/* Vị trí quảng cáo */
.ad-slot { margin: 18px 0; text-align: center; overflow: hidden; }
.ad-slot.ad-top { margin-top: 16px; }
aside .ad-slot { margin: 0 0 22px; }

/* ---------- Công cụ ---------- */
.theme-toggle { background: transparent; border: 2px solid rgba(255,255,255,.55); color: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.theme-toggle:hover { background: rgba(255,255,255,.15); }
.theme-toggle svg { width: 18px; height: 18px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tool-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muc); background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px 16px; }
a.tool-card:hover { border-color: var(--cam); color: var(--muc); }
.tool-card span { font-size: .86rem; color: var(--muc-3); }
.tool-card .lucky-num { font-family: var(--so); font-size: 1.9rem; color: var(--cam); line-height: 1.1; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week-day { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muc); background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 12px; }
.week-day:hover { border-color: var(--cam); color: var(--muc); }
.week-day.nay { border: 2px solid var(--cam); background: var(--cam-nhat); }
.wd-thu { font-weight: 700; font-size: .85rem; color: var(--muc-2); }
.wd-so { font-family: var(--so); font-size: 2.6rem; line-height: 1; color: var(--cam); }
.week-day.cn .wd-so { color: var(--do); }
.wd-thang { font-size: .8rem; color: var(--muc-3); }
.wd-am { font-size: .9rem; }
.wd-cc { font-size: .85rem; color: var(--muc-2); }
.week-day small { font-size: .74rem; }
@media (max-width: 960px) { .week { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .week { grid-template-columns: 1fr; } }
.dc-list { display: grid; gap: 10px; }
.dc { background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r); }
.dc summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.dc summary::-webkit-details-marker { display: none; }
.dc summary::after { content: "+"; font-weight: 800; color: var(--cam); font-size: 1.3rem; margin-left: 4px; }
.dc[open] summary::after { content: "\2212"; }
.dc-ten { flex: 1; }
.dc-ten small { display: block; color: var(--muc-3); font-size: .82rem; }
.dc-diem { font-family: var(--so); font-size: 1.35rem; color: var(--cam); }
.dc-body { padding: 0 16px 14px; border-top: 1px dashed var(--duong-ke); }
.dc-body p { margin: 12px 0 0; }
.stars { color: var(--duong-ke); letter-spacing: 1px; margin-left: 6px; }
.stars i { font-style: normal; }
.stars i.on { color: var(--vang); }
.score-big { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--cam-nhat); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.score-big b { font-family: var(--so); font-size: 2.6rem; color: var(--cam); line-height: 1.1; }
.score-big span { font-weight: 700; color: var(--muc-2); }
.score-big.xau b { color: var(--do); }
.score-big.tot b { color: var(--ngoc); }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillar { background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.pillar small { color: var(--muc-3); font-weight: 700; }
.pillar b { font-size: 1.25rem; color: var(--cam-dam); }
.pillar span { font-size: .8rem; color: var(--muc-3); }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr 1fr; } }
.dream-list { display: grid; gap: 10px; }
.dream { background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px 16px; }
.dream h3, .dream .dream-h { font-size: 1.05rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dream p { margin: 0 0 4px; }
.world { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.clock { background: var(--o); border: 1px solid var(--duong-ke); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; }
.clock.vn { border: 2px solid var(--cam); background: var(--cam-nhat); }
.clock-time { font-family: var(--so); font-size: 2.3rem; color: var(--cam); line-height: 1.15; font-variant-numeric: tabular-nums; }
.clock small { color: var(--muc-3); }
.share { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.share span { font-size: .85rem; font-weight: 700; color: var(--muc-3); margin-right: 4px; }
.share a, .share button { font: inherit; font-size: .82rem; font-weight: 700; text-decoration: none; border-radius: 999px; padding: 6px 12px; border: 1.5px solid var(--duong-ke); background: var(--o); color: var(--muc-2); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--cam); color: var(--cam-dam); }
.hop-tuoi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.hop-tuoi button { font: inherit; border: 1.5px solid var(--duong-ke); background: var(--o); color: var(--muc); border-radius: 10px; padding: 8px 4px; cursor: pointer; font-weight: 700; font-size: .9rem; }
.hop-tuoi button[aria-pressed="true"] { border-color: var(--cam); background: var(--cam); color: #fff; }
.hop-kq { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--cam-nhat); }
.hop-kq.tot { background: var(--ngoc-nhat); }
.hop-kq.xau { background: #fbe7e7; }
:root[data-theme="dark"] .hop-kq.xau { background: #3a1717; }
@media (max-width: 520px) { .hop-tuoi { grid-template-columns: repeat(4, 1fr); } }
:root[data-theme="dark"] .bloc-gay span { background: #4a352b; }

/* ---------- Hôm nay dành cho bạn (trang chủ) ---------- */
.today-h { font-size: 1.45rem; margin-bottom: 14px; }
.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.today-grid h3 { font-size: 1.08rem; margin-bottom: 10px; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .today-grid { grid-template-columns: 1fr; } }
.rate { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--o-2); }
.rate b { font-size: 1.35rem; }
.rate span { font-weight: 700; color: var(--muc-3); font-size: .88rem; }
.rate-tot { background: var(--ngoc-nhat); } .rate-tot b { color: var(--ngoc); }
.rate-bt { background: var(--cam-nhat); } .rate-bt b { color: var(--cam-dam); }
.rate-xau { background: #fbe7e7; } .rate-xau b { color: var(--do); }
:root[data-theme="dark"] .rate-xau { background: #3a1717; }
.rate-list { list-style: none; margin: 0; padding: 0; }
.rate-list li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px dashed var(--duong-ke); }
.rate-list span { font-size: .8rem; color: var(--muc-3); font-weight: 600; }
.rate-list b { font-size: .93rem; }
.tl { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 30px; }
.tl-h { background: var(--o-2); border-radius: 3px; position: relative; }
.tl-h.tot { background: var(--ngoc); opacity: .8; }
.tl-h.now { outline: 2.5px solid var(--cam); outline-offset: 1px; z-index: 1; }
.tl-h.now::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: var(--cam); }
.tl-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muc-3); margin: 10px 0 12px; }
.now-box { border-radius: 12px; padding: 12px 14px; background: var(--o-2); margin-bottom: 10px; }
.now-box.tot { background: var(--ngoc-nhat); }
.now-box b { font-size: 1.05rem; }
.now-box .cd { font-family: var(--so); font-size: 1.5rem; color: var(--cam); font-variant-numeric: tabular-nums; }
.gio-list { font-size: .88rem; line-height: 1.9; margin: 0 0 8px; }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acts button { font: inherit; font-weight: 700; font-size: .88rem; border: 1.5px solid var(--duong-ke); background: var(--o); color: var(--muc); border-radius: 10px; padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.acts button small { font-size: .72rem; font-weight: 700; }
.acts .act-tot small { color: var(--ngoc); } .acts .act-bt small { color: var(--cam-dam); } .acts .act-xau small { color: var(--do); }
.acts button[aria-pressed="true"] { border-color: var(--cam); background: var(--cam-nhat); }
.act-kq, .hop-kq { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--o-2); font-size: .92rem; }
.act-kq ul, .hop-kq ul { margin: 6px 0 0; padding-left: 18px; }
.act-kq.tot, .hop-kq.tot { background: var(--ngoc-nhat); }
.act-kq.bt, .hop-kq.bt { background: var(--cam-nhat); }
.act-kq.xau, .hop-kq.xau { background: #fbe7e7; }
:root[data-theme="dark"] .act-kq.xau { background: #3a1717; }
.do-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.do-list li { padding: 8px 12px 8px 34px; border-radius: 10px; position: relative; font-size: .93rem; }
.do-list li::before { position: absolute; left: 12px; top: 8px; font-weight: 800; }
.do-list.ok li { background: var(--ngoc-nhat); } .do-list.ok li::before { content: "✓"; color: var(--ngoc); }
.do-list.no li { background: #fbe7e7; } .do-list.no li::before { content: "✕"; color: var(--do); }
:root[data-theme="dark"] .do-list.no li { background: #3a1717; }

.cal-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
[data-month-panel].loading { opacity: .55; transition: opacity .15s; }

/* ---------- Footer sáng (phong cách nền kem cam chuyển trắng) ---------- */
.site-footer { background: linear-gradient(180deg, #fef5eb 0%, #fffdf9 100%); color: #4a3a33; border-top: 1px solid #fbe3cc; }
.site-footer a { color: #4a3a33; }
.site-footer a:hover { color: var(--cam); text-decoration: underline; }
.foot-grid .foot-h { font-size: 1.1rem; font-weight: 800; background: linear-gradient(270deg, #f79922 0%, #ff6b00 100%); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.foot-grid p { color: #5c4a42; }
.foot-bottom { border-top-color: #f6dcc4; color: #8a7266; }
:root[data-theme="dark"] .site-footer { background: #0f0a08; color: #e8d6cb; border-top-color: #2a1e19; }
:root[data-theme="dark"] .site-footer a, :root[data-theme="dark"] .foot-grid p { color: #e8d6cb; }
:root[data-theme="dark"] .foot-bottom { border-top-color: rgba(255,255,255,.12); color: #bfa597; }

/* Liên kết dạng nút, thẻ, ô lịch: không gạch chân kể cả khi rê chuột */
.btn:hover, .tag:hover, .tool-card:hover, .day-card:hover, .week-day:hover, .year-strip a:hover, .cal a.o:hover,
.quick a:hover, .logo:hover, .nav a:hover, .le-ngay:hover, .post .cat:hover, .post h3 a:hover, .post .post-h a:hover,
.year-months h3 a:hover, .pager a:hover, .share a:hover, .w-type:hover, .bloc-thang a:hover, .cal-head h2 a:hover { text-decoration: none; }

/* ==========================================================
   Nâng cấp trải nghiệm 2026-10 (mobile-first)
   ========================================================== */
/* Bố cục hero: điện thoại xếp theo thứ tự ưu tiên, máy tính 2 cột */
.hero { gap: 18px; }
.hero-l, .hero-r { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero .page-head { margin: 0; }
.hero .h-cal { margin: 0; }
@media (max-width: 960px) {
  .hero { display: flex; flex-direction: column; }
  .hero-l, .hero-r { display: contents; }
  .h-head { order: 1; } .h-bloc { order: 2; } .h-short { order: 3; } .h-xn { order: 4; } .h-cal { order: 5; }
  .h-head h1 { font-size: 1.35rem; margin-bottom: .3em; }
  .h-head p { font-size: .92rem; }
}
@media (min-width: 961px) { .hero { gap: 28px; } }

/* Tờ lịch: dương - âm - thứ nổi bật */
.bloc-thang { align-items: center; }
.bloc-nay { background: var(--cam); color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; }
.bloc-thu span { display: inline-block; background: var(--cam-nhat); color: var(--cam-dam); border-radius: 999px; padding: 4px 18px; font-size: 1.15rem; font-weight: 800; letter-spacing: .01em; }
.bloc.chu-nhat .bloc-thu span, .bloc.ngay-le .bloc-thu span { background: #fbe7e7; color: var(--do); }
:root[data-theme="dark"] .bloc.chu-nhat .bloc-thu span, :root[data-theme="dark"] .bloc.ngay-le .bloc-thu span { background: #3a1717; }
.bloc-les { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.bloc-les .bloc-le { margin: 0; }
.bloc-am-so em { display: block; font-family: var(--font); font-style: normal; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cam-dam); margin-bottom: 4px; }
.bloc-am-so { color: var(--muc); }
.bloc-hd { margin: 14px 0 0; }
@media (max-width: 520px) {
  .bloc-to { padding: 14px 16px 16px; }
  .bloc-so { font-size: clamp(6.5rem, 34vw, 9rem); }
  .bloc-am { gap: 10px; }
  .bloc-am-so { font-size: 3rem; min-width: 64px; }
  .bloc-am dl { font-size: .86rem; }
}

/* Nút Hôm qua / Hôm nay / Ngày mai: điều khiển phân đoạn, vùng bấm lớn */
.bloc-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; margin-top: 16px; border: 1.5px solid var(--cam-vien); border-radius: 14px; overflow: hidden; background: var(--o); }
.bloc-nav .seg { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 6px 4px; font-weight: 700; font-size: .95rem; color: var(--cam-dam); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.bloc-nav .seg + .seg { border-left: 1.5px solid var(--cam-vien); }
.bloc-nav .seg:hover { background: var(--cam-nhat); text-decoration: none; }
.bloc-nav .seg:active { background: var(--cam-vien); }
.bloc-nav .seg-nay { background: var(--cam); color: #fff; }
.bloc-nav .seg-nay:hover { background: var(--cam-dam); color: #fff; }
.bloc-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bloc-jump { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.bloc-jump label { font-size: .85rem; font-weight: 700; color: var(--muc-3); white-space: nowrap; }
.bloc-jump input { flex: 1; min-width: 0; min-height: 44px; font: inherit; font-size: 1rem; color: var(--muc); background: var(--o); border: 1.5px solid var(--duong-ke); border-radius: 12px; padding: 6px 10px; }
.bloc-jump input:focus { outline: none; border-color: var(--cam); box-shadow: 0 0 0 3px var(--cam-nhat); }
.bloc-jump .btn { min-height: 44px; }
.js .bloc-jump .btn { display: none; }

/* Xem nhanh dưới tờ lịch */
.xn { background: var(--giay); border: 1px solid var(--duong-ke); border-radius: var(--r-lon); box-shadow: var(--bong); padding: 10px; }
.xn-tabs { display: none; }
.js .xn-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--o-2); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.xn-tabs button { position: relative; font: inherit; font-size: .88rem; font-weight: 700; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muc-2); cursor: pointer; padding: 4px; }
.xn-tabs button[aria-selected="true"] { background: var(--o); color: var(--cam-dam); box-shadow: 0 1px 3px rgba(60, 20, 5, .12); }
.xn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--do); margin-left: 5px; vertical-align: 2px; }
.xn-p { padding: 2px 4px 6px; }
.xn-p + .xn-p { border-top: 1px dashed var(--duong-ke); margin-top: 8px; padding-top: 10px; }
.js .xn-p + .xn-p { border: 0; margin: 0; padding-top: 2px; }
.js .xn-p[hidden] { display: none; }
.xn-gio { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.xn-gio li { background: var(--ngoc-nhat); color: var(--ngoc); border-radius: 10px; padding: 7px 4px; text-align: center; line-height: 1.25; }
.xn-gio li.now { outline: 2.5px solid var(--cam); outline-offset: -2px; }
.xn-gio b { display: block; font-size: 1rem; }
.xn-gio span { font-size: .74rem; font-weight: 600; }
.xn-more { display: inline-flex; align-items: center; min-height: 40px; font-weight: 700; font-size: .9rem; }
.xn-note { margin: 2px 0 6px; font-size: .92rem; }
.xn-le-nay { margin: 0 0 6px; }
.xn-le { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.xn-le a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; background: var(--o-2); color: var(--muc); text-decoration: none; font-weight: 600; font-size: .92rem; }
.xn-le a:hover { background: var(--cam-nhat); text-decoration: none; }
.xn-le small { color: var(--cam-dam); font-weight: 700; white-space: nowrap; font-size: .78rem; }
.xn-kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .92rem; }
.xn-kv dt { color: var(--muc-3); font-weight: 600; }
.xn-kv dd { margin: 0; font-weight: 700; }
.xn-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--duong-ke); }
.xn-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; font: inherit; font-weight: 700; font-size: .92rem; border-radius: 12px; border: 1.5px solid var(--cam-vien); background: var(--o); color: var(--cam-dam); cursor: pointer; padding: 6px 10px; }
.xn-btn:hover { background: var(--cam-nhat); }
.xn-btn.ok { background: var(--ngoc-nhat); border-color: var(--ngoc); color: var(--ngoc); }
.xn-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.xn-share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.xn-share a, .xn-share button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; font: inherit; font-size: .86rem; font-weight: 700; border-radius: 10px; border: 1.5px solid var(--duong-ke); background: var(--o); color: var(--muc-2); text-decoration: none; padding: 4px 12px; cursor: pointer; }
.xn-share a:hover, .xn-share button:hover { border-color: var(--cam); color: var(--cam-dam); text-decoration: none; }
.xn-share[hidden] { display: none; }

/* Lối tắt tiện ích chính */
.shortcuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.shortcuts a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 2px 8px; border-radius: 14px; color: var(--muc); text-decoration: none; background: var(--giay); border: 1px solid var(--duong-ke); min-height: 44px; -webkit-tap-highlight-color: transparent; }
.shortcuts a:hover, .shortcuts a[aria-current] { border-color: var(--cam); text-decoration: none; }
.shortcuts a:active { transform: scale(.97); }
.shortcuts i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--cam-nhat); color: var(--cam); }
.shortcuts svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shortcuts b { font-size: .78rem; line-height: 1.2; font-weight: 800; }
.shortcuts small { display: none; color: var(--muc-3); font-size: .74rem; font-weight: 600; line-height: 1.25; }
.shortcuts a:last-child i { background: var(--cam); color: #fff; }
@media (min-width: 521px) {
  .shortcuts { gap: 10px; }
  .shortcuts b { font-size: .9rem; }
  .shortcuts small { display: block; }
  .shortcuts a { padding: 14px 6px 12px; }
}

/* Khung lịch tháng */
.mp-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 6px; margin-bottom: 10px; }
.mp-arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--cam-vien); color: var(--cam-dam); background: var(--o); -webkit-tap-highlight-color: transparent; }
span.mp-arrow { border: 0; background: none; }
a.mp-arrow:hover { background: var(--cam-nhat); text-decoration: none; }
a.mp-arrow:active { background: var(--cam-vien); }
.mp-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mp-title { text-align: center; min-width: 0; }
.mp-h { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.mp-h::before { display: none !important; }
.mp-h a { color: var(--muc); text-decoration: none; }
.mp-h a:hover { color: var(--cam-dam); text-decoration: none; }
.mp-h span { color: var(--cam-dam); }
.mp-title small { display: block; color: var(--muc-3); font-weight: 600; font-size: .8rem; }
.mp-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.mp-bar select { font: inherit; font-size: .95rem; font-weight: 700; color: var(--muc); background: var(--o); border: 1.5px solid var(--duong-ke); border-radius: 12px; min-height: 44px; padding: 4px 8px; min-width: 0; width: 100%; cursor: pointer; }
.mp-bar select:focus { outline: none; border-color: var(--cam); box-shadow: 0 0 0 3px var(--cam-nhat); }
.mp-year { display: flex; align-items: stretch; border: 1.5px solid var(--duong-ke); border-radius: 12px; overflow: hidden; background: var(--o); }
.mp-year select { border: 0; border-radius: 0; width: auto; padding: 4px 2px; text-align: center; }
.mp-year select:focus { box-shadow: none; }
.mp-year a { display: grid; place-items: center; width: 40px; min-height: 44px; font-size: 1.2rem; font-weight: 800; color: var(--cam-dam); text-decoration: none; }
.mp-year a:hover { background: var(--cam-nhat); text-decoration: none; }
.mp-go { display: none; }
.no-js .mp-go, html:not(.js) .mp-go { display: inline-flex; align-items: center; min-height: 44px; font: inherit; font-weight: 700; border: 0; border-radius: 12px; background: var(--cam); color: #fff; padding: 0 14px; }
.mp-now { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 12px; font-weight: 700; font-size: .9rem; color: var(--cam-dam); border: 1.5px solid var(--cam-vien); text-decoration: none; white-space: nowrap; }
.mp-now:hover { background: var(--cam-nhat); text-decoration: none; }
.mp-now.on { background: var(--cam); border-color: var(--cam); color: #fff; }
@media (max-width: 460px) {
  .mp-bar { grid-template-columns: 1fr 1fr; }
  .mp-now { grid-column: 1 / -1; }
  .mp-now.on { display: none; }
  .mp-year { justify-content: space-between; }
  .mp-year select { flex: 1; }
}

/* Ô ngày: gọn, chấm màu thay chữ trên điện thoại */
.cal:not(.cal-mini) .o.tot::after { content: none; }
.cal a.o { -webkit-tap-highlight-color: transparent; }
.cal a.o:active { transform: scale(.96); }
.cal .o .al.ram { color: var(--cam-dam); font-weight: 800; }
.cal .o .ln { font-size: .66rem; color: var(--do); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.cal .o .mk { position: absolute; top: 7px; right: 7px; display: flex; gap: 3px; }
.cal .o .mk i { width: 7px; height: 7px; border-radius: 50%; }
.cal .o .mk-tot { background: var(--ngoc); }
.cal .o .mk-le { background: var(--do); }
.cal .o.le { background: #fff4f2; border-color: #f6cfc8; }
:root[data-theme="dark"] .cal .o.le { background: #331b19; border-color: #5a2b26; }
.cal .o.hom-nay .mk i { box-shadow: 0 0 0 1.5px #fff; }
.cal .o.hom-nay .ln { color: #fff; }
.cal .o.hom-nay .al.mung1, .cal .o.hom-nay .al.ram { color: #fff; }
.cal-legend .l-le::before { background: var(--do); }
.cal-legend .l-m1::before { background: transparent; border: 2px solid var(--cam-dam); width: 7px; height: 7px; }
@media (max-width: 520px) {
  .cal a.o { min-height: 54px; padding: 5px 4px 4px; }
  .cal .o .ln { display: none; }
  .cal .o .mk { top: auto; bottom: 5px; left: 5px; right: auto; }
  .cal .o .mk i { width: 6px; height: 6px; }
  .cal-legend { gap: 10px 14px; }
}
.cal.swiping { transition: transform .18s ease-out, opacity .18s; }
.mp-le { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--duong-ke); display: grid; gap: 6px; }
.mp-le a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border-radius: 10px; background: #fff4f2; color: var(--muc); text-decoration: none; font-weight: 600; font-size: .9rem; }
:root[data-theme="dark"] .mp-le a { background: #331b19; }
.mp-le a:hover { text-decoration: none; color: var(--do); }
.mp-le b { flex: none; min-width: 46px; color: var(--do); font-family: var(--so); font-weight: 600; font-size: 1rem; }
@media (min-width: 700px) { .mp-le { grid-template-columns: 1fr 1fr; } }

/* Thanh điều hướng dưới màn hình (điện thoại) */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--giay); border-top: 1px solid var(--duong-ke); box-shadow: 0 -6px 20px -12px rgba(60, 20, 5, .35); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: var(--muc-3); font-size: .7rem; font-weight: 700; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar a:hover { text-decoration: none; color: var(--cam-dam); }
  .tabbar a[aria-current] { color: var(--cam); }
  .tabbar a[aria-current] svg { background: var(--cam-nhat); }
  .tabbar svg { width: 44px; height: 28px; padding: 2px 10px; border-radius: 999px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}
@media print { .tabbar, .xn, .shortcuts, .bloc-nav, .bloc-jump, .mp-bar, .mp-arrow { display: none !important; } }

/* Thông báo nhỏ */
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--muc); color: var(--giay); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 761px) { .toast { bottom: 28px; } }
.mp .mp-h { display: block; }
@media (min-width: 461px) { .mp-bar { grid-template-columns: minmax(140px, 200px) auto 1fr; } .mp-now, .mp-go { justify-self: end; } }

/* Ô hôm nay luôn nổi bật nhất (kể cả khi trùng ngày lễ, Chủ nhật, ngày đang chọn) */
.cal .o.hom-nay, .cal .o.hom-nay.le, .cal .o.hom-nay.chon, .cal .o.hom-nay:hover {
  background: linear-gradient(160deg, var(--cam) 0%, var(--cam-dam) 100%);
  border-color: var(--cam-dam); color: #fff; opacity: 1;
  box-shadow: 0 6px 16px -6px rgba(194, 65, 12, .7); outline: 0;
}
.cal .o.hom-nay .dl, .cal .o.hom-nay .al, .cal .o.hom-nay .ln, .cal .o.hom-nay .tk,
.cal .o.hom-nay.cn .dl, .cal .o.hom-nay.le .dl, .cal .o.hom-nay .al.mung1, .cal .o.hom-nay .al.ram { color: #fff; }
.cal .o.hom-nay .dl { font-weight: 700; }
.cal .o.hom-nay .mk-le { background: #ffe066; }
.cal .o.hom-nay .mk-tot { background: #b8f5dd; }
.cal .o.hom-nay .mk i { box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
:root[data-theme="dark"] .cal .o.hom-nay, :root[data-theme="dark"] .cal .o.hom-nay.le { background: linear-gradient(160deg, #fb7c34 0%, #e8590c 100%); border-color: #fd9a5c; }

/* Điện thoại: các khối trong hero giãn đủ chiều ngang (tránh tờ lịch co lệch trái) */
@media (max-width: 960px) {
  .hero { align-items: stretch; }
  .hero > *, .hero-l > *, .hero-r > * { width: 100%; min-width: 0; }
}
.bloc { width: 100%; }
.bloc-thu { margin-top: 10px; }
