/* Lá số tử vi — trang con của Ngày Lành (ADR 0053). Nạp SAU ngay-lanh.css và
   dùng đúng biến màu của nó.

   Hướng "Ngày Lành" (chủ studio chọn 10/11/2026, ADR 0055), cùng với app #9:
   cả tờ nằm trên thẻ xanh mực bi như thẻ đầu của app, 12 cung là ô trắng nổi,
   chữ "Mệnh" khoanh bút đỏ như cách app khoanh ngày tốt, giữa tờ là mặt trời
   trống đồng Đông Sơn trắng mờ có vành răng lược và chim. Bản trước (tờ kẻ ô
   nét mực trên giấy) bị chê khô như bảng biểu.

   NGŨ HÀNH là một ô vuông màu nhỏ trước tên chính tinh, không tô cả chữ: mười
   lăm sao một ô mà mỗi chữ một màu thì thành hoa giấy. Tứ hóa không dùng đỏ
   (đỏ ở Ngày Lành là "ngày tốt") và không dùng vàng đất (vàng là "lưu ý"). */

:root {
  --chon: var(--nut-nen);
  --chon-nhat: #EEF2FF;
  --vang-sang: #FFD84D;
  --vang-chu: #FFE58A;
  --muc-o: #46434E;
  --xam-chu: #8C8994;
  --muc-xau: #75727C;
}

.h-kim { --hanh: #8A93A3; }
.h-moc { --hanh: #2E9E5B; }
.h-thuy { --hanh: #2C47B0; }
.h-hoa { --hanh: #D9341F; }
.h-tho { --hanh: #D29A2B; }

/* Chip bật/tắt dùng aria-pressed: xanh mực bi như chip chọn của Ngày Lành. */
.lua-chon[aria-pressed='true'] { border-color: var(--nut-nen); background: #E4E9FA; color: var(--nut-nen); box-shadow: inset 0 0 0 .5px var(--nut-nen); }

/* ---------- biểu mẫu ---------- */

.bieu-mau-la-so { padding: 24px 26px; display: flex; flex-direction: column; gap: 24px; }
.hang-truong { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.o-truong { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.o-ten { flex: 1 1 300px; max-width: 460px; }
.nhan-truong { padding: 0; font-size: 15px; font-weight: 700; color: var(--muc); }
.nhan-truong .mo { font-weight: 400; }

.o-vao {
  min-height: 50px; width: 100%; padding: 0 14px; border-radius: var(--bo-nut);
  border: 1px solid var(--vien-dam); background: var(--nen-phu);
  font-size: 17px; font-weight: 600; color: var(--muc);
}
.o-vao::placeholder { color: var(--muc-mo); font-weight: 400; }
.o-vao:focus { outline: none; border-color: var(--nut-nen); box-shadow: 0 0 0 3px #E4E9FA; }
.o-chon {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5B66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}

.hang-ngay { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.ba-o { display: flex; align-items: center; gap: 6px; }
.ba-o label { display: block; }
.ba-o .o-vao { width: 76px; text-align: center; padding: 0 6px; }
.ba-o .o-nam { width: 100px; }
.ba-o .gach { color: var(--muc-mo); font-size: 20px; }
.hop-nhuan { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; font-weight: 600; color: var(--muc-phu); cursor: pointer; }
.hop-nhuan input { width: 20px; height: 20px; accent-color: var(--nut-nen); }

.hang-gio { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.hang-gio .o-chon { flex: 0 1 400px; }
.nut-chu {
  background: none; border: 0; padding: 10px 2px; min-height: 44px;
  color: var(--nut-nen); font-size: 15.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.khoi-gio-phut { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; align-items: end; }
.khoi-gio-phut .nut-chu { justify-self: start; }
.o-truong-nho { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; color: var(--muc-phu); }
.o-truong-nho .mo { font-weight: 400; }

.o-vang-nho, .canh-bao {
  background: var(--vang-nhat); border: 1px solid var(--vang-vien); border-radius: var(--bo-nut);
  padding: 11px 14px; font-size: 15px; line-height: 1.55; color: #5E4813;
}
.canh-bao { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.canh-bao p { flex: 1 1 320px; }
.canh-bao .nut { min-height: 42px; }
#canh-bao { display: flex; flex-direction: column; gap: 10px; }
#canh-bao:empty { display: none; }

.hang-nut { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.nut-lap { min-height: 54px; padding: 0 36px; font-size: 17px; }
.rieng-tu { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muc-mo); }
.rieng-tu svg { width: 16px; height: 16px; }
.goi-y-nho:empty { display: none; }

.tom-tat-la-so {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 22px;
  background: var(--the); border-radius: var(--bo-the); box-shadow: var(--bong-the);
}
.tom-tat-la-so .chu { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tom-tat-la-so b { font-size: 19px; }
.tom-tat-la-so span { font-size: 15px; color: var(--muc-mo); }

/* ---------- thanh công cụ trên lá số ---------- */

.ket-qua-la-so { display: flex; flex-direction: column; gap: 14px; }
.thanh-cong-cu { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nam-xem {
  display: flex; align-items: center; gap: 4px; padding: 4px; margin-right: auto;
  background: var(--the); border-radius: 999px; box-shadow: var(--bong-the);
}
.nam-xem .chu { display: flex; flex-direction: column; align-items: center; min-width: 190px; padding: 0 8px; line-height: 1.25; }
.nam-xem .nhan { font-size: 11px; letter-spacing: .8px; }
.nam-xem b { font-size: 16px; }
.nut-vuong-nho {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--nen-phu);
  font-size: 22px; line-height: 1; color: var(--muc);
}
.nut-vuong-nho:hover { background: var(--vien); }
.nut-vuong-nho:disabled { opacity: .35; cursor: default; }
.thanh-cong-cu .lua-chon { min-height: 44px; }
.nut-in { min-height: 44px; }

/* ---------- tờ lá số ---------- */

.the-la-so { display: flex; flex-direction: column; }

.luoi {
  --khe: 6px;
  position: relative; display: grid; gap: var(--khe); padding: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  background: var(--nut-nen); border-radius: 24px;
  box-shadow: 0 2px 4px rgba(44, 71, 176, .18), 0 16px 34px rgba(44, 71, 176, .28);
}

.o-cung {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 228px;
  padding: 11px 11px 9px 12px; margin: 0; border: 0; border-radius: 15px; text-align: left; cursor: pointer;
  background: var(--the); color: var(--muc); font: inherit;
}
.o-cung:hover { background: #FAFAFD; }
.o-cung.tam-phuong { background: var(--chon-nhat); }
.o-cung[aria-pressed='true'] { box-shadow: inset 0 0 0 2.4px var(--vang-sang); z-index: 1; }
.o-cung:focus-visible { outline: 3px solid var(--vang-sang); outline-offset: 1px; z-index: 4; }

.dau-o { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.ten-cung { position: relative; font-size: 14px; font-weight: 800; white-space: nowrap; }
/* Vòng bút đỏ khoanh chữ "Mệnh", như app khoanh ngày tốt. */
.la-menh .ten-cung::after {
  content: ''; position: absolute; left: -6px; right: -7px; top: -3px; bottom: -3px; pointer-events: none;
  border: 1.6px solid #D9341F; border-radius: 50% 46% 52% 48%; transform: rotate(-4deg);
}
.nhan-than {
  font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--muc); color: #fff;
}
.can-chi { flex-basis: 100%; font-size: 12.5px; color: var(--xam-chu); white-space: nowrap; }
.chi-ngan { display: none; }

.chinh { display: flex; flex-direction: column; gap: 3px; min-height: 44px; margin-top: 2px; }
.sao-chinh { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; line-height: 1.25; }
.ten-sao { font-weight: inherit; }
.sao-chinh .ten-sao { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; }
.sao-chinh .ten-sao::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px;
  vertical-align: 2px; background: var(--hanh);
}
.vo-chinh { font-size: 14px; color: var(--muc-mo); }

/* Chữ độ sáng M V Đ B H: nhỏ, xám, dính liền chữ cuối của tên (khoảng trắng không ngắt). */
.do-sang { font-size: .66em; font-weight: 700; color: var(--xam-chu); letter-spacing: 0; }

/* Tứ hóa: năm sinh Lộc Quyền Khoa nền xanh mực, Kỵ nền xám; lưu niên nền xanh nhạt. */
.hoa {
  display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--nut-nen); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px;
}
.hoa.ky { background: #EDEBF2; color: var(--muc-phu); }
.hoa.hoa-luu { background: #E4E9FA; color: var(--nut-nen); }
.hoa.hoa-luu.ky { background: #EDEBF2; color: var(--nut-nen); }

.phu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; font-size: 13px; line-height: 1.5; }
.phu > span { display: flex; flex-direction: column; min-width: 0; }
.phu .sao-phu { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 4px; }
.phu .hoa, .phu-gon .hoa { font-size: 9.5px; line-height: 14px; padding: 0 4px; }
.cot-tot, .phu-gon .tot { color: var(--muc-o); }
.cot-xau, .phu-gon .xau { color: var(--muc-xau); }
.phu-gon { display: none; flex-direction: column; font-size: 10px; line-height: 1.45; }
.phu-gon .them { color: #A9A6B0; }

.luu { font-size: 12px; line-height: 1.45; color: var(--chon); }

.chan-o { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muc-mo); }
.chan-o .dai-han { font-weight: 800; color: var(--muc-o); }
.chan-o .trang-sinh { margin-left: auto; }
.nhan-han { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--vang-nhat); color: var(--vang); }

/* Tuần, Triệt nằm giữa khe hai cung kề nhau. Cạnh ngang thì dồn về bên phải:
   góc dưới bên trái của ô phía trên là chỗ có số đại hạn và nhãn hạn. */
.o-cung.co-moc { z-index: 2; }
.o-cung.co-moc[aria-pressed='true'] { z-index: 3; }
.moc {
  position: absolute; z-index: 3; white-space: nowrap; pointer-events: none;
  padding: 1px 8px; border-radius: 999px; background: var(--vang-sang); color: var(--nut-nen);
  font-size: 10.5px; font-weight: 800;
}
.moc-tren { top: calc(var(--khe) / -2); right: 14px; transform: translateY(-50%); }
.moc-trai, .moc-phai { top: 50%; writing-mode: vertical-rl; padding: 8px 1px; }
.moc-trai { left: calc(var(--khe) / -2); transform: translate(-50%, -50%) rotate(180deg); }
.moc-phai { right: calc(var(--khe) / -2); transform: translate(50%, -50%) rotate(180deg); }
.moc-duoi { bottom: calc(var(--khe) / -2); right: 14px; transform: translateY(50%); }

/* ---------- giữa tờ: trên nền xanh ---------- */

.trung-tam {
  grid-column: 2 / 4; grid-row: 2 / 4; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 22px 28px; text-align: center; color: #fff;
}
.trung-tam > svg.nen { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trung-tam > :not(svg) { position: relative; }
.nen .mat-troi { color: #fff; opacity: .2; }
.nen .tam-hop { fill: rgba(255, 255, 255, .05); stroke: #fff; stroke-width: 1.2; stroke-opacity: .65; stroke-linejoin: round; }
.nen .xung { stroke: #fff; stroke-width: 1.2; stroke-opacity: .65; stroke-dasharray: 5 5; }
.nen .diem { fill: var(--vang-sang); }

.tt-nhan { font-size: 12.5px; font-weight: 700; color: #C9D3F7; }
.tt-ten { font-size: 32px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; overflow-wrap: anywhere; }
.tt-phu { font-size: 15.5px; color: #D6DEFB; }
.tu-tru { display: grid; grid-template-columns: repeat(4, auto); gap: 0 20px; margin: 14px 0 10px; }
.tu-tru > span { display: flex; flex-direction: column; align-items: center; }
.tu-tru small { font-size: 12px; font-weight: 600; color: #C9D3F7; }
.tu-tru b { font-size: 16.5px; }
.tt-bang { display: grid; grid-template-columns: auto auto; gap: 3px 16px; margin: 0; font-size: 14.5px; text-align: left; }
.tt-bang dt { color: #C9D3F7; }
.tt-bang dd { margin: 0; font-weight: 600; }
.tt-bang dd.noi { color: var(--vang-chu); font-weight: 800; }
.tt-gon { display: none; }

.chu-giai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 16px 4px 2px; font-size: 13.5px; color: var(--muc-mo); }
.chu-giai > span { display: inline-flex; align-items: center; gap: 6px; }
.chu-giai i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--hanh); }
.chu-giai b { color: var(--muc-phu); }
.chu-giai .luu-chu b { color: var(--chon); }

/* ---------- chi tiết một cung, sổ tính chung ---------- */

.chi-tiet { align-items: stretch; }
.chi-tiet > .chi-tiet-cung { flex: 1.45 1 540px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.chi-tiet > .so-tinh-chung { flex: 1 1 340px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.ct-dau { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ct-dau h2 { font-size: 26px; letter-spacing: -.5px; }
.ct-dau .phu { font-size: 16px; }
.ct-the { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-the span { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--nen-phu); color: var(--muc-phu); }
.ct-tam-phuong { font-size: 15px; color: var(--muc-phu); line-height: 1.55; }
.ct-tam-phuong b { color: var(--chon); font-weight: 600; }
.nhom-sao { display: flex; flex-direction: column; }
.nhom-sao > .nhan { padding: 8px 0 2px; }
.dong-sao { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0 12px; padding: 10px 0; border-bottom: 1px dashed var(--vien); }
.nhom-sao .dong-sao:last-child { border-bottom: 0; }
.cham-hanh { width: 10px; height: 10px; border-radius: 2.5px; margin-top: 7px; background: var(--hanh); }
.dong-sao .tren { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.dong-sao .ten { font-size: 16.5px; font-weight: 700; color: var(--muc); }
.dong-sao .meta { font-size: 13.5px; color: var(--muc-mo); }
.dong-sao .cach-an { font-size: 14.5px; color: var(--muc-phu); line-height: 1.55; margin-top: 2px; }

.dong-st { padding: 11px 0; border-bottom: 1px dashed var(--vien); display: flex; flex-direction: column; gap: 2px; }
.dong-st:last-child { border-bottom: 0; }
.dong-st .tren { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.dong-st .ten { font-size: 14px; color: var(--muc-mo); }
.dong-st .kq { font-size: 15.5px; font-weight: 700; }
.dong-st .cach { font-size: 14px; color: var(--muc-phu); line-height: 1.55; }

.ghi-chu-la-so { font-size: 14.5px; color: var(--muc-mo); line-height: 1.55; max-width: 820px; }

/* ---------- phần chữ tĩnh ---------- */

.giai-thich { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.giai-thich h2 { font-size: 22px; letter-spacing: -.4px; }
.ba-cot { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; }
.ba-cot h3 { font-size: 16.5px; margin-bottom: 4px; }
.ba-cot p { font-size: 15.5px; color: var(--muc-phu); line-height: 1.6; }
.nguon { border-top: 1px solid var(--vien); padding-top: 6px; }
.nguon summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--muc-phu); }
.nguon ul { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muc-phu); line-height: 1.55; }

/* ---------- điện thoại ---------- */

@media (max-width: 899px) {
  .bieu-mau-la-so { padding: 18px; gap: 20px; }
  .ba-o .o-vao { width: 64px; }
  .ba-o .o-nam { width: 88px; }
  .hang-gio .o-chon { flex-basis: 100%; }
  .nut-lap { width: 100%; }
  .tom-tat-la-so { padding: 12px 12px 12px 16px; }
  .tom-tat-la-so b { font-size: 17px; }
  .tom-tat-la-so span { font-size: 14px; }

  .nam-xem { margin-right: 0; flex: 1 1 100%; justify-content: space-between; }
  .nam-xem .chu { min-width: 0; }
  .thanh-cong-cu .lua-chon, .nut-in { flex: 1 1 0; }

  .luoi { --khe: 4px; padding: 6px; border-radius: 20px; margin: 0 -8px; }
  .o-cung { min-height: 128px; padding: 6px 4px 5px 6px; gap: 3px; border-radius: 12px; }
  .dau-o { gap: 2px 4px; }
  .ten-cung { font-size: 11px; }
  .la-menh .ten-cung::after { left: -4px; right: -5px; top: -2px; bottom: -2px; }
  .nhan-than { font-size: 8.5px; padding: 0 4px; }
  .can-chi { font-size: 10px; }
  .chinh { min-height: 0; gap: 3px; margin-top: 3px; }
  .sao-chinh { gap: 2px 3px; line-height: 1.2; }
  .sao-chinh .ten-sao { font-size: 12px; letter-spacing: -.25px; }
  .sao-chinh .ten-sao::before { width: 5px; height: 5px; margin-right: 3px; vertical-align: 1px; }
  .vo-chinh { font-size: 10.5px; }
  .hoa { font-size: 8.5px; line-height: 13px; padding: 0 4px; }
  .phu, .luu, .chan-o .trang-sinh { display: none; }
  .phu-gon { display: flex; }
  .chan-o { font-size: 10.5px; padding-top: 3px; gap: 2px 3px; }
  .nhan-han { font-size: 8px; padding: 0 4px; }
  .moc { font-size: 8px; padding: 0 5px; }
  .moc-tren, .moc-duoi { right: 6px; }
  .moc-trai, .moc-phai { font-size: 7.5px; padding: 4px 0; }

  .trung-tam { padding: 10px 8px; gap: 2px; }
  .tt-nhan { font-size: 10px; }
  .tt-ten { font-size: 18px; letter-spacing: -.4px; }
  .tt-phu { font-size: 11px; }
  .tu-tru, .tt-bang { display: none; }
  .tt-gon { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: 11px; line-height: 1.45; color: #D6DEFB; }
  .tt-gon b { color: var(--vang-chu); font-size: 12px; }

  .chu-giai { font-size: 12.5px; gap: 4px 12px; padding: 10px 4px 4px; }
  .goi-y-cham { font-size: 14.5px; color: var(--muc-mo); text-align: center; }
  .chi-tiet > .chi-tiet-cung, .chi-tiet > .so-tinh-chung { padding: 18px; }
  .ct-dau h2 { font-size: 23px; }
}

/* ---------- in ---------- */

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .dau-trang, .chan-trang, .tieu-de-trang, .bieu-mau-la-so, .tom-tat-la-so, .thanh-cong-cu,
  #canh-bao, .goi-y-cham, .chi-tiet, .ghi-chu-la-so, .giai-thich, .the-app, .o-quang-cao { display: none !important; }
  .khung { padding: 0; max-width: none; }
  .noi-dung { padding: 0; }
  /* Cả tờ vừa một trang A4 ngang: thu nhỏ thay vì để trình duyệt cắt giữa hàng ô.
     Giấy in không có nền xanh: ô kẻ viền mảnh, giữa tờ chữ mực. */
  .the-la-so { zoom: .66; }
  .luoi { break-inside: avoid; background: #fff; box-shadow: none; padding: 0; }
  .o-cung { min-height: 0; box-shadow: inset 0 0 0 1px #C9C5BE; }
  .o-cung.tam-phuong, .o-cung[aria-pressed='true'] { background: #fff; box-shadow: inset 0 0 0 1px #C9C5BE; }
  .trung-tam, .tt-nhan, .tt-phu, .tu-tru small, .tt-bang dt { color: var(--muc-phu); }
  .tt-ten, .tu-tru b, .tt-bang dd { color: var(--muc); }
  .tt-bang dd.noi { color: var(--muc); }
  .nen .mat-troi { color: var(--muc); opacity: .06; }
  .nen .tam-hop, .nen .xung, .nen .diem { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
