/* Ba trang lá số Tử Vi, Bát Tự, Hà Lạc: bàn giao giao diện 18/11/2026 (Tử Vi v01, Bát Tự bản chốt, Hà Lạc chốt 1).
   Chỉ thêm, không xoá luật cũ. Màu theo bảng chuẩn site.css. Body có lớp kk-ls kk-<công cụ>. */

/* ---- Phiếu nhập · chung ---- */
.kk-ls .wrap.section:has(>.ml-san){padding-top:14px}                                  /* Hà Lạc C1 */
.kk-ls nav.crumb{display:inline-block;background:rgba(248,244,236,.9);border-radius:8px;padding:3px 10px}  /* C2, N1 */
.kk-ls .ml-xem-theo label span,.kk-ls .ml-xem-theo .ml-sap-o span{flex-direction:row!important;justify-content:center;align-items:center;gap:8px!important;padding:10px 8px!important;min-height:44px!important}
.kk-ls .ml-xem-theo label span svg,.kk-ls .ml-xem-theo .ml-sap-o span svg{width:20px;height:20px;flex:none}
.kk-ls .ml-dong-ho.dh-gon .dh-dong{font-size:12.5px}
.kk-help-ngan{display:none}

@media (min-width:641px){
  .kk-tu-vi .ml-san-dau h1{font-size:30px}
}

/* ---- Phiếu nhập · điện thoại ---- */
@media (max-width:640px){
  .kk-ls .ml-sen,.kk-ls .ml-may{display:none!important}                                /* N1, D1, Tử Vi 1.1 */
  .kk-ls .ml-san-dau{padding-top:10px;background:rgba(248,244,236,.85);border-radius:14px;padding:10px 12px}
  .kk-ls .ml-san-dau h1{font-size:24px!important;line-height:1.2;margin:0 0 4px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .kk-ls .ml-san-dau p{font-size:14px;margin-top:4px}
  /* Dải giờ 1 dòng: giờ · âm lịch · giờ can chi · tiết; bấm thì mở đủ (dong-ho.js) */
  .kk-ls .ml-dong-ho.dh-gon{padding:6px 10px!important;cursor:pointer}
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) .dh-dong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;font-size:12.5px}
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) .dh-phu,
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=duong],
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=ngay],
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=con]{display:none}
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=am]::before,
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=chi]:not(:empty)::before,
  .kk-ls .ml-dong-ho.dh-gon:not(.kk-dh-mo) [data-dh=tiet]::before{content:"· ";font-weight:400;color:inherit}
  .kk-ls .ml-dong-ho.dh-gon.kk-dh-mo .dh-dong{white-space:normal}
  /* Kiểu xem: chỉ biểu tượng, một hàng, ô cao 44px; chữ còn cho máy đọc màn hình (N4, Tử Vi 1.1) */
  .kk-ls .ml-xem-theo{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(0,1fr))!important;gap:10px!important}
  .kk-ls .ml-xem-theo label span,.kk-ls .ml-xem-theo .ml-sap-o span{position:relative;padding:10px 0!important}
  .kk-ls .ml-xem-theo label span b,.kk-ls .ml-xem-theo .ml-sap-o span b,.kk-ls .ml-xem-theo .ml-sap-nhan{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .kk-ls .ml-xem-theo label span svg,.kk-ls .ml-xem-theo .ml-sap-o span svg{width:22px!important;height:22px!important}
  .kk-ls .ml-xem-theo .ml-sap-o{opacity:.6}
  .kk-ls .ml-xem-theo .ml-sap-o span::after{content:"";position:absolute;top:6px;right:8px;width:6px;height:6px;border-radius:50%;background:#C89B3C}
  /* Giờ sinh 1 hàng; Phút sinh và Xem hạn năm chung 1 hàng (N6, D3) */
  .kk-ls .ml-gio-luoi{grid-template-columns:1fr 1fr!important;gap:10px!important}
  .kk-ls .ml-gio-luoi>.field:first-child{grid-column:1/-1!important}
  .kk-ls .ml-gio-luoi>.field:nth-child(2) select,.kk-ls .ml-gio-luoi>.field:nth-child(3) select{padding-right:24px!important;font-size:15px}
  .kk-ls p.kk-help-gio{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .kk-ha-lac p.kk-help-gio{display:block}
  .kk-ha-lac .kk-help-dai{display:none}.kk-ha-lac .kk-help-ngan{display:inline}
}

/* ---- Kết quả · chung ---- */
/* Thanh ghim mua và thanh mục dính (Bát Tự K13, Tử Vi 1.3) */
@media (max-width:640px){
  .kk-ls .tv2-muc-nav .kk-chuyen{display:none!important}
  .kk-ls .tv2-muc-nav-ds{-webkit-mask-image:linear-gradient(90deg,#000 82%,transparent);mask-image:linear-gradient(90deg,#000 82%,transparent)}
  .kk-ls .tv2-tron select{font-size:14px;padding-right:30px;text-overflow:ellipsis}
  .kk-ls .tv2-thanh .tv2-sua-nut{display:inline-flex!important}
  .kk-ls .tv2-thanh-nut{flex-wrap:nowrap!important;gap:6px!important}
  .kk-ls .tv2-thanh-nut>button,.kk-ls .tv2-thanh-nut>a,.kk-ls .tv2-thanh-nut>details>summary{white-space:nowrap;padding-left:12px!important;padding-right:12px!important;font-size:14px!important}
}
/* Khối chia sẻ trên điện thoại: 3 hàng (Bát Tự K12) */
@media (max-width:640px){
  .kk-ls .lan-toa .lt-hang{display:grid!important;grid-template-columns:repeat(6,1fr);gap:8px}
  .kk-ls .lan-toa .lt-hang>details.tv-tai-in,.kk-ls .lan-toa .lt-hang>.lt-anh{grid-column:span 3}
  .kk-ls .lan-toa .lt-hang>.lt-fb,.kk-ls .lan-toa .lt-hang>.lt-zalo,.kk-ls .lan-toa .lt-hang>.lt-chia{grid-column:span 2}
  .kk-ls .lan-toa .lt-hang>.lt-chep,.kk-ls .lan-toa .lt-hang>.lt-tom{grid-column:span 3}
  .kk-ls .lan-toa .lt-hang>*{width:100%;justify-content:center;min-height:44px}
  .kk-ls .lan-toa .lt-hang>details.tv-tai-in>summary{width:100%;justify-content:center;min-height:44px}
}

/* ---- Bát Tự · kết quả ---- */
.bt-id-dong i.kk-dai{font-style:normal}
.kk-bat-tu table.ml-tru td.bt9-goc:has(.bt9-tang){vertical-align:top}                    /* K4 */
.kk-bat-tu .bt-he2 .bt5-gd-o.h-thuy:not(.toi){background:#EAF1F9}                        /* K7: 5 mã nền chờ Khổng Khôi duyệt */
.kk-bat-tu .bt-he2 .bt5-gd-o.h-moc:not(.toi){background:#E8F3EC}
.kk-bat-tu .bt-he2 .bt5-gd-o.h-tho:not(.toi){background:#F7EEDB}
.kk-bat-tu .bt-he2 .bt5-gd-o.h-kim:not(.toi){background:#EEF0F3}
.kk-bat-tu .bt-he2 .bt5-gd-o.h-hoa:not(.toi){background:#FBEAE7}
/* K8: khối chưa mở thu nhỏ, vẫn hiện */
.kk-bat-tu .tv2-khoa .tv2-he,.kk-bat-tu .bt5-hn .bt5-he{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.kk-bat-tu .tv2-khoa .tv2-vach,.kk-bat-tu .tv2-muc .tv2-vach{display:none}
.kk-bat-tu .tv2-khoa{padding:12px 14px!important}
.kk-bat-tu .tv2-khoa .tv2-khoa-nhan{margin:6px 0 2px!important;font-size:13px}
.kk-bat-tu .ml-5o .ml-o{padding:8px 4px!important;min-height:0!important}
.kk-bat-tu .ml-5o .ml-o span{display:none}
.kk-bat-tu .ml-5o .ml-o b{font-size:18px!important;line-height:1.2}
.kk-bat-tu .lg-o{padding:12px 14px!important}
.kk-bat-tu .lg-o p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:4px 0 8px!important;font-size:13.5px}
.kk-bat-tu ol.tv2-muc>li:not([data-ma="tong-quan"])>:not(.tv2-muc-so):not(.tv2-muc-ten):not(svg){display:none}
.kk-bat-tu ol.tv2-muc>li:not([data-ma="tong-quan"]){padding-top:8px!important;padding-bottom:8px!important}
@media (min-width:641px){.kk-bat-tu ol.tv2-muc{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.kk-bat-tu ol.tv2-muc>li[data-ma="tong-quan"]{grid-column:1/-1}}
.kk-bat-tu .tv2-tam-khoi{display:none}
.kk-bat-tu .tv2-ba .tv2-ba-luoi>*{padding:12px!important}
.kk-bat-tu .tv2-ba .tv2-ba-luoi p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.kk-bat-tu .tv2-them-ds{display:grid!important;grid-template-columns:repeat(3,1fr);gap:6px}
.kk-bat-tu .tv2-them-o{padding:8px 6px!important;font-size:13px}
@media (max-width:640px){
  /* K1: Nhật chủ · Trung Hòa 55 · 2026 Vượng trên 1 dòng */
  .kk-bat-tu .bt-id-dong{display:block!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12.5px}
  .kk-bat-tu .bt-id-dong span{display:inline!important;background:none!important;border:0!important;padding:0!important}
  .kk-bat-tu .bt-id-dong>span+span::before{content:"·"!important;display:inline!important;width:auto!important;margin:0!important;padding:0 4px!important;position:static!important;color:#8A6620}
  .kk-bat-tu .bt-id-dong .kk-dai{display:none}
  /* K3: can chi không bẻ chữ, ẩn hàng chỉnh giờ (dùng nút Sửa) */
  .kk-bat-tu table.ml-tru tr.bt9-bam{display:none}
  .kk-bat-tu table.ml-tru th.bt9-nhan,.kk-bat-tu table.ml-tru tr>th:first-child{width:46px;font-size:11px;line-height:1.25}
  .kk-bat-tu table.ml-tru td.bt9-goc b{white-space:nowrap;font-size:clamp(19px,6vw,24px);letter-spacing:-.01em}
  .kk-bat-tu table.ml-tru td.bt9-goc small{font-size:10.5px;line-height:1.2}
  .kk-bat-tu table.ml-tru td.bt9-goc,.kk-bat-tu table.ml-tru th.bt9-goc{padding-left:2px;padding-right:2px}
  /* K5, K6 */
  .kk-bat-tu table.ml-tru .bt9-tang-thanh{display:none!important}
  .kk-bat-tu .ml-the:not(:has(.bt9-k-sao .bt9-gap-nut[aria-expanded="true"]))>p.ml-chu{display:none}
}

/* Tử Vi v01 (15/11/2026): điện thoại ẩn Phóng to, nút chat 42px cách đáy 96px */
@media (max-width:640px){
  .kk-tu-vi [data-tv2-phong]{display:none!important}
  .kk-tu-vi .cn{bottom:96px}
  .kk-tu-vi .cn .cn-nut,.kk-tu-vi .cn>button{width:42px;height:42px;min-height:42px}
}
/* Hà Lạc chốt K12: nút không rớt chữ */
.kk-ha-lac .tv2-n,.kk-ha-lac .tv2-mi,.kk-bat-tu .tv2-n{white-space:nowrap}
/* Bát Tự K14: đánh số khối từ 1 */
.kk-bat-tu .bt-he2 #so-sanh{--so:"1"}.kk-bat-tu .bt-he2 #doi-loi{--so:"2"}.kk-bat-tu .bt-he2 .bt5-nh{--so:"3"}.kk-bat-tu .bt-he2 .bt5-vtr{--so:"4"}.kk-bat-tu .bt-he2 #anh-la-so{--so:"5"}.kk-bat-tu .bt-he2 #gia-dinh{--so:"6"}.kk-bat-tu .bt-he2 #dung-than{--so:"7"}.kk-bat-tu .bt5-ba{--so:"9"}
/* Trang kết quả đã bỏ đường dẫn: bớt khoảng trống đầu trang */
.kk-ls.kk-kq main>.wrap.section:first-child,.kk-ls.kk-kq .wrap.section{padding-top:14px}

/* Lá số đã lưu trong Tuỳ chọn thêm (Hà Lạc phiếu nhập v01 mục C6, dùng chung ba lá số): tối đa 3 dòng, còn lại vào Hồ Sơ */
.kk-ls .hl-da-luu{margin-top:4px;grid-column:1 / -1}
.kk-ls .hl-da-luu .t{font-size:13px;color:#74665A;margin-bottom:6px}
.kk-ls .hl-da-luu a.r{display:block;padding:9px 12px;border:1px solid #EAD9BD;border-radius:10px;background:#FDFBF6;color:#2B2118;text-decoration:none;margin-bottom:6px;min-height:42px}
.kk-ls .hl-da-luu a.r b{display:block;font-weight:600;color:#79200F;font-size:14px}
.kk-ls .hl-da-luu a.r span{display:block;color:#74665A;font-size:13px}
.kk-ls .hl-da-luu a.het{display:block;text-align:right;font-size:13px;color:#79200F;font-weight:600;padding:4px 2px}
@media (min-width:641px){.kk-ls .hl-da-luu{display:grid;grid-template-columns:repeat(3,1fr);gap:0 8px}.kk-ls .hl-da-luu .t,.kk-ls .hl-da-luu a.het{grid-column:1 / -1}}

/* Bát Tự phiếu tải về v01: khung tải ảnh dạng tấm đáy, cùng khuôn Tam Tai (tam-tai.css) */
.tt-tai-lop{position:fixed;inset:0;z-index:9999;background:rgba(30,15,10,.5);display:flex;align-items:center;justify-content:center;padding:12px;font-family:"Be Vietnam Pro",system-ui,sans-serif}
.tt-tai-hop{position:relative;background:#FDFBF6;color:#2B2118;border-radius:18px;width:100%;max-width:720px;max-height:94vh;overflow:auto;display:grid;grid-template-columns:260px 1fr;grid-template-areas:"dau dau" "xem chon";gap:14px 22px;padding:22px}
.tt-tai-keo{display:none}
.tt-tai-dong{position:absolute;top:8px;right:12px;background:none;border:0;font-size:26px;line-height:1;cursor:pointer;color:#79200F}
.tt-tai-dau{grid-area:dau}
.tt-tai-dau h4{margin:0;font:600 21px var(--t-serif);color:#79200F}
.tt-tai-dau p{margin:4px 0 0;font-size:13px;color:#6D5D47}
.tt-tai-xem{grid-area:xem}
.tt-tai-xem img{display:block;width:100%;height:auto;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.tt-tai-chon{grid-area:chon;display:flex;flex-direction:column;gap:12px}
.tt-tai-kho{display:flex;gap:10px}
.tt-tai-kho button{flex:1;border:1.5px solid #E3CF9F;border-radius:12px;padding:10px;background:#fff;text-align:center;font:inherit;font-size:12.5px;color:#5A4A36;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:2px}
.tt-tai-kho button i{display:block;background:#45140B;border-radius:4px;margin-bottom:5px}
.tt-tai-kho button small{font-size:11.5px;color:#8A6620}
.tt-tai-kho button[aria-pressed=true]{border-color:#79200F;background:#FBEFEA}
.tt-tai-ten{display:flex;flex-direction:column;gap:5px;font-size:12.5px;color:#6D5D47}
.tt-tai-ten input{border:1px solid #D9C59A;border-radius:10px;padding:10px 12px;font:inherit;font-size:15px;background:#fff;color:#2B2118}
.tt-tai-bat{display:flex;justify-content:space-between;align-items:center;font-size:13.5px;cursor:pointer}
.tt-tai-bat input{position:absolute;opacity:0;pointer-events:none}
.tt-tai-bat i{width:40px;height:23px;border-radius:12px;background:#D8C9AB;position:relative;flex:none;transition:background .15s}
.tt-tai-bat i::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:left .15s}
.tt-tai-bat input:checked+i{background:#2E7D4F}.tt-tai-bat input:checked+i::after{left:20px}
.tt-tai-bat input:focus-visible+i{outline:2px solid #C89B3C;outline-offset:2px}
.tt-tai-nut{border:0;border-radius:999px;background:#7A2414;color:#fff;font:inherit;font-weight:600;font-size:15px;padding:13px;cursor:pointer}
.tt-tai-nut2{border:1px solid #D9C59A;border-radius:999px;background:#fff;color:#5A4A36;font:inherit;font-size:14px;padding:12px;cursor:pointer}
@media (max-width:760px){
  .tt-tai-lop{align-items:flex-end;padding:0}
  .tt-tai-hop{grid-template-columns:1fr;grid-template-areas:"dau" "xem" "chon";border-radius:20px 20px 0 0;padding:12px 18px 22px;max-height:92vh;gap:12px}
  .tt-tai-keo{display:block;width:40px;height:5px;border-radius:3px;background:#D8C9AB;margin:0 auto -4px}
  .tt-tai-dau h4{font-size:19px}
  .tt-tai-xem img{width:150px;margin:0 auto}
}
.tt-tai-xem{min-height:120px;display:flex;align-items:flex-start;justify-content:center}.tt-tai-xem .cho{font-size:13px;color:#6D5D47;padding:40px 0}

/* Tử Vi v01 (bàn giao 18/11/2026) mục 1.2 còn lại: băng Hạn năm thu thấp một dòng, hàng Tam phương / Hoá xuất / Hoá nhập / Tải gọn một dòng */
.kk-tu-vi .tv2-dai summary{padding-top:6px;padding-bottom:6px;min-height:0;font-size:14px}
.kk-tu-vi .tv2-dai summary .tv2-dai-lich{width:20px;height:20px}
.kk-tu-vi .tv2-dai-chu{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.kk-tu-vi .tv2-dai{margin-bottom:8px}
.kk-tu-vi .tv2-cu-hang{flex-wrap:nowrap;gap:4px}
.kk-tu-vi .tv2-cu-hang .tv-cach-nut{flex-wrap:nowrap;min-width:0}
@media (max-width:640px){
  .kk-tu-vi .tv2-dai summary{font-size:13px}
  .kk-tu-vi .tv2-cu-hang .tv-cach-nut button{padding:0 8px;font-size:12px;white-space:nowrap}
  .kk-tu-vi .tv2-cu-hang .tv2-nhan-cham,.kk-tu-vi .tv2-cu-cham{display:none}
  .kk-tu-vi .tv2-cu-phai .tv2-cu-b{padding:0 8px;font-size:12px;white-space:nowrap}
}
/* Mục 1.3: menu trên cùng tự ẩn khi kéo xuống; nút chat ẩn khi lưới lá số hoặc khối mua trên màn hình */
.kk-ls.kk-kq header.top{transition:transform .25s ease}
html.kk-dau-an .kk-ls.kk-kq header.top{transform:translateY(-100%)}
.kk-ls.kk-kq .tv2-muc-nav{transition:top .25s ease}
.kk-ls.kk-kq .cn{transition:opacity .2s}
body.kk-ls.an-chat .cn:not(.mo):not(:focus-within){opacity:0;pointer-events:none}
@media (prefers-reduced-motion:reduce){.kk-ls.kk-kq header.top,.kk-ls.kk-kq .tv2-muc-nav{transition:none}}
/* Bàn giao Tử Vi v01 Phần 2: chụp ảnh lá số không để chữ tràn, đè. */
.dang-chup-la-so .tv-tu-hoa,.dang-chup-la-so .tv-dh,.dang-chup-la-so .tv-luoi .pha,.dang-chup-la-so .tv-giua>*{white-space:nowrap}
/* Thông báo nhỏ sau khi lưu ảnh */
.kk-bao-nho{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:9999;background:#3a2a1c;color:#fbf6ec;padding:9px 16px;border-radius:999px;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.18);pointer-events:none;transition:opacity .3s}
/* Bàn giao Tử Vi v01 Phần 4 mục 8: Tam Chiếu nằm trong khối "Sắp ra mắt" */
.tv2-tam-gop{margin:0 0 12px;padding:10px 14px;border:1px dashed #C89B3C;border-radius:10px;background:#FBF3DF;font-size:14px;line-height:1.45;color:#2B2118}
.tv2-tam-gop b{color:#79200F}
.tv2-tam-gop span{display:block;color:#5a4a3a;font-size:13px}
/* Phần 4 mục 4: biểu đồ Vận trình trên điện thoại vuốt ngang, chữ đủ đọc */
@media (max-width:640px){
  .kk-tu-vi #duong-doi .dd-svg,.kk-tu-vi #duong-doi svg.vt2{min-width:600px}
  .kk-tu-vi #duong-doi .dd-cuon{overflow-x:auto;-webkit-overflow-scrolling:touch}
}

/* Thanh đầu Tử Vi trên điện thoại: bỏ chữ (đầy đủ) để nút Chia sẻ không tràn */
@media (max-width:480px){.tv2-tai-du{display:none}}
/* Thanh đầu Hà Lạc, Bát Tự trên điện thoại: theo mẫu bàn giao, bỏ mũi tên Chia sẻ và thu đệm để nút ⋯ không tràn */
@media (max-width:430px){.kk-ls .tv2-thanh-nut summary.tv2-n>span[aria-hidden]{display:none}.kk-ls .tv2-thanh .tv2-thanh-nut{gap:4px!important}.kk-ls .tv2-thanh-nut>button,.kk-ls .tv2-thanh-nut>a,.kk-ls .tv2-thanh-nut>details>summary{padding-left:9px!important;padding-right:9px!important;font-size:13px!important}.kk-ls .tv2-thanh-nut>details:last-child>summary{padding-left:8px!important;padding-right:8px!important}}
@media (max-width:370px){.kk-ls .tv2-thanh-nut>button,.kk-ls .tv2-thanh-nut>a,.kk-ls .tv2-thanh-nut>details>summary{padding-left:7px!important;padding-right:7px!important;font-size:12.5px!important}}
@media (max-width:430px){.kk-ls .tv2-thanh-nut>.tv2-tai>svg{display:none}}
