/* src/css/bo-cuc.css – bố cục "Cuộn đọc" của trang Xem lá số (bo-cuc.js thêm body.ld-doc) và nút chuyển trên menubar.
   Màu theo theme (theme.css: --ui-…). Bố cục "Bàn làm việc" không dùng tệp này. Nạp SAU note.css, luan-giai.css. */

/* ── Cần gạt bố cục (menubar, trang Xem lá số, Chọn giờ đẹp, Cấu hình — một lựa chọn chung): núm trái = Cuộn đọc, núm phải = Bàn làm việc ── */
.ld-gat { display: none; }
body[data-layout="desktop"].mb-page-laso .ld-gat,
body[data-layout="desktop"].mb-page-search .ld-gat,
body[data-layout="desktop"].mb-page-cfg .ld-gat {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ui-chip-border); background: var(--ui-chip-bg); color: var(--ui-bar-fg);
}
.ld-gat-ic { display: grid; place-items: center; opacity: .45; transition: opacity .15s, color .15s; }
.ld-gat-ic svg { width: 15px; height: 15px; }
.ld-gat[data-ld="doc"] [data-ld="doc"], .ld-gat[data-ld="ban"] [data-ld="ban"] { opacity: 1; color: var(--ui-accent); }
.ld-gat-ray { position: relative; width: 30px; height: 16px; border-radius: 999px; background: var(--ui-accent); }
.ld-gat-num { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ui-chip-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .18s ease; }
.ld-gat[data-ld="ban"] .ld-gat-num { transform: translateX(14px); }
.ld-gat:hover { border-color: var(--ui-accent); }
.ld-gat:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* ── Cuộn đọc: cột trái cũ ẩn; #colLaso thành lưới 2 cột — trái: thẻ #ldThe, phải: lá số + hàng nút #ldNut.
      Cột lá số rộng đúng bằng lá số (layout-scale.js đặt bề rộng #lasoWrap) → cả khối căn giữa, hai bên trống đều.
      Thanh mục, phần luận giải và các khối khác: rộng bằng khối (grid-column 1 / -1). ── */
.ld-muc, .ld-noidung, .ld-the, .ld-nut-hang { display: none; }
/* Thẻ ô lập lá số (#ldThe): trang Xem lá số desktop, cả hai bố cục (body.ld-the-on, bo-cuc.js) */
body.ld-the-on .ld-the { display: flex; flex-direction: column; gap: 10px; }
/* Bàn làm việc: thẻ đứng đầu cột trái thay cho form cũ (ẩn, vẫn giữ dữ liệu), cao vừa nội dung; "Lá số đã lưu" chiếm phần còn lại */
body.ld-the-on:not(.ld-doc) #formArea { display: none !important; }
body.ld-the-on:not(.ld-doc) .col-chat > .ld-the { flex: none; margin-bottom: 12px; }
body.ld-doc .separator, body.ld-doc .col-chat { display: none !important; }
body.ld-doc .col-laso {
  display: grid !important; grid-template-columns: 320px auto; justify-content: safe center; column-gap: 18px; align-items: start;   /* safe: lá số phóng to rộng hơn trang thì tràn sang phải (cuộn ngang được), không mất bên trái */
  width: 100%; padding: 0 16px; box-sizing: border-box;
}
body.ld-doc .col-laso > * { grid-column: 1 / -1; min-width: 0; }
/* Khối hết bề ngang (thanh mục, luận giải…) KHÔNG được làm rộng các cột: bề rộng nội dung của chúng tính là 0,
   rồi giãn ra đúng bằng khối thẻ trái + lá số. Không có dòng này, bài luận dài làm cột "auto" giãn hết trang. */
body.ld-doc .col-laso > :not(.laso-wrap):not(.ld-the):not(.ld-nut-hang) { width: 0; min-width: 100%; }
body.ld-doc .col-laso > .laso-wrap, body.ld-doc .col-laso > .ld-nut-hang { grid-column: 2; }
body.ld-doc .col-laso > .ld-the { grid-column: 1; grid-row: span 2; }
/* Trang Xem lá số desktop, cả hai bố cục: quanh lá số cùng màu nền trang (theo theme), không dùng nền ngà;
   khung trắng vài px ôm sát lá số để viền đen nổi rõ. Khung vẽ bằng box-shadow của #gridScaler (co giãn cùng lá số, ~6–8px);
   layout-scale.js chừa chỗ 8px quanh lá số cho khung (không bị cắt). */
body.ld-the-on, body.ld-tim { --ui-laso-nen: transparent; }
body.ld-the-on #gridScaler, body.ld-tim #gridScaler { align-self: flex-start; box-shadow: 0 0 0 8px #fff; }   /* flex-start: cao đúng bằng lá số (không giãn theo khung) */

/* 1. Thẻ trái: "Đang xem" + ô lập lá số của Trang chủ (#hpForm, home-page.css) thu gọn cho vừa cột + nút Hiện tại / Lưu lá số */
body.ld-doc .ld-the { margin-top: 6px; }                                  /* cuộn cùng lá số, thẳng mép trên với lá số */
.ld-the *, .ld-the *::before, .ld-the *::after { box-sizing: border-box; }
.ld-the-dau {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--ui-side-line); border-radius: 14px; background: var(--ui-side); color: var(--ui-side-fg);
}
.ld-the-nhan { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-side-fg-2); }
.ld-the-ten { font: 600 19px/1.3 'Playfair Display', Georgia, serif; overflow-wrap: anywhere; }
.ld-the-phu { font-size: 13px; color: var(--ui-side-fg-2); }
.ld-the-hang { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.ld-tt { padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; box-shadow: inset 0 0 0 1px currentColor; }
.ld-tt-luu { color: var(--ui-ok); }  .ld-tt-sua { color: #e67e22; }  .ld-tt-chua { color: var(--ui-side-fg-2); }
.ld-lk { padding: 0; border: 0; background: none; cursor: pointer; color: var(--ui-side-pri); font: 600 12.5px Arial, sans-serif; }
.ld-lk:hover { text-decoration: underline; }
.ld-the-sua { display: none; }
.ld-the-dong1 { display: flex; align-items: center; }
/* Nút thu gọn (dùng kiểu .side-fold-btn của cloud.css): ở Bàn làm việc và điện thoại; thu gọn = ẩn ô lập lá số + hàng nút, còn phần "Đang xem" */
.ld-the-gon { display: none; }
body.ld-the-on:not(.ld-doc) .ld-the-gon, body.ld-the-m .ld-the .ld-the-gon { display: inline-flex; }   /* .ld-the: thắng cloud.css (ẩn .side-fold-btn trên điện thoại) */
.ld-the-gon svg { transition: transform .15s ease; }
.ld-the.gon .ld-the-gon svg { transform: rotate(-90deg); }
body:not(.ld-doc) .ld-the.gon .ld-the-form, body:not(.ld-doc) .ld-the.gon .ld-the-nut { display: none; }
.ld-the-nut { display: flex; gap: 8px; }
.ld-the-nut .ld-nut { flex: 1 1 0; justify-content: center; }
body.ld-doc .ld-the-luu { display: none; }                               /* Cuộn đọc: đã có Lưu dưới lá số */
.ld-the .hp-form { flex: none; width: 100%; padding: 16px; gap: 10px; border-radius: 14px; box-shadow: none; }
.ld-the .hp-form-dau { display: none; }                                   /* tiêu đề "Lập lá số Tử Vi" đã có ở phần "Đang xem" */
.ld-the .hp-form input, .ld-the .hp-form select { height: 38px; font-size: 14px; }
.ld-the .hp-sel .hp-ic { top: 11px; }
.ld-the .hp-hang2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ld-the .hp-chon button { height: 30px; font-size: 13px; }
.ld-the .hp-chon-nho button { height: 26px; padding: 0 9px; font-size: 11.5px; }
.ld-the .hp-nut-lap { min-height: 44px; font-size: 15px; }

/* 2. Hàng nút dưới lá số */
body.ld-doc #lasoWrap { padding-bottom: 0 !important; }                 /* desktop-tools.js chừa chỗ thanh dưới ở đây; Cuộn đọc: hàng nút nằm ngay dưới lá số (layout-scale.js chừa chỗ cho hàng nút) */
body.ld-doc .ld-nut-hang { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.ld-nut {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--ui-side-line); background: var(--ui-side); color: var(--ui-side-fg); font: 600 13px Arial, sans-serif;
}
.ld-nut svg { width: 16px; height: 16px; }
.ld-nut:hover { border-color: var(--ui-side-pri); color: var(--ui-side-pri); }
.ld-nut:focus-visible, .ld-lk:focus-visible, .ld-muc button:focus-visible { outline: 2px solid var(--ui-side-pri); outline-offset: 2px; }

/* Màn hẹp: một cột; thẻ trái chỉ còn "Đang xem", bấm "Sửa thông tin" mới hiện ô lập lá số */
@media (max-width: 1150px) {
  body.ld-doc .col-laso { grid-template-columns: auto; }
  body.ld-doc .col-laso > .laso-wrap, body.ld-doc .col-laso > .ld-nut-hang, body.ld-doc .col-laso > .ld-the { grid-column: 1; grid-row: auto; }
  body.ld-doc .ld-the { margin-bottom: 10px; }
  body.ld-doc .ld-the-sua { display: inline; }
  body.ld-doc .ld-the:not(.mo) .hp-form { display: none; }
}

/* 3. Hộp thoại Danh sách lá số: chính #cloudList (laso-cloud.js, cloud.css) trong khung lớn hơn */
.ld-ds-nen { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.ld-ds-nen[hidden] { display: none; }
.ld-ds {
  display: flex; flex-direction: column; gap: 8px; width: min(640px, 100%); height: min(680px, 100%); padding: 16px 18px 12px;
  border: 1px solid var(--ui-side-line); border-radius: 16px; background: var(--ui-side); color: var(--ui-side-fg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); font: 13px/1.45 Arial, sans-serif;
}
.ld-ds-dau { display: flex; align-items: center; justify-content: space-between; }
.ld-ds-dau b { font: 600 19px 'Playfair Display', Georgia, serif; }
.ld-ds-x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ui-side-fg-2); cursor: pointer; }
.ld-ds-x:hover { background: var(--ui-side-hover); color: var(--ui-side-fg); }
.ld-ds-x svg { width: 18px; height: 18px; }
.ld-ds-than { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ld-ds #cloudList { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ld-ds .cl-row select, .ld-ds .cl-row .cl-search { height: 34px; font-size: 13px; }
.ld-ds .cl-items { flex: 1 1 auto; min-height: 0; max-height: none; margin: 4px 0 0; }
.ld-ds .cl-item { padding: 8px 10px; font-size: 14px; border-radius: 8px; }
.ld-ds .cl-count { font-size: 12px; }
.ld-ds-trong { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--ui-side-fg-2); }
.ld-ds-trong[hidden], .ld-ds-meo[hidden] { display: none; }
.ld-ds-meo { margin: 0; font-size: 11.5px; color: var(--ui-side-fg-2); }

/* 2. Thanh mục dính dưới menubar */
body.ld-doc .ld-muc {
  display: flex; justify-content: center; gap: 4px; position: sticky; top: 44px; z-index: 30;
  margin: 8px 0 6px; padding: 6px 8px; background: var(--ui-page); border-bottom: 1px solid var(--ui-side-line);
}
.ld-muc button {
  height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: var(--ui-page-fg); font: 600 13px Arial, sans-serif; opacity: .8;
}
.ld-muc button:hover { opacity: 1; background: var(--ui-side-hover); }

/* 4. Phần luận giải dưới lá số: chính #lgPane, cuộn theo trang (không cuộn trong khung) */
body.ld-doc .ld-noidung { display: block; margin: 16px 0 90px; }       /* rộng bằng khối thẻ trái + lá số */
body.ld-doc #lgPane { display: block; border: 1px solid var(--ui-edge); border-radius: 14px; overflow: hidden; }
body.ld-doc #lgPane .lg-cuon { overflow: visible; min-height: 0; padding: 20px 24px 28px; gap: 18px; }
body.ld-doc #lgPane .lg-luoi { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

/* Khung Chatbot / Ghi chú: hộp thoại nổi góc dưới phải (kiểu chatbot), mở bằng nút ở thanh dưới cùng */
body.ld-doc .note-sep { display: none !important; }
body[data-layout="desktop"].ld-doc.note-open .note-panel {
  position: fixed; right: 18px; bottom: calc(var(--ld-day, 50px) + 10px); top: auto; z-index: 955; flex: none;   /* --ld-day: chiều cao thanh dưới (bo-cuc.js) */
  width: min(400px, calc(100vw - 36px)); height: min(600px, calc(100vh - var(--ld-day, 50px) - 70px));
  border: 1px solid var(--ui-edge); border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45); animation: ld-hop-mo .18s ease-out;
}
@keyframes ld-hop-mo { from { opacity: 0; transform: translateY(14px) scale(.98); } }
body.ld-doc .note-panel [data-ntab="lg"] { display: none; }
/* Nút thu nhỏ / đóng ở đầu hộp (chỉ Cuộn đọc) */
.ld-chat-nut { display: none; }
body.ld-doc .ld-chat-nut { display: flex; gap: 2px; margin-left: auto; align-self: center; padding-right: 6px; }
.ld-chat-nut button {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--ui-side-fg-2); cursor: pointer;
}
.ld-chat-nut button:hover { background: var(--ui-side-hover); color: var(--ui-side-fg); }
.ld-chat-nut svg { width: 16px; height: 16px; }
/* 2 thẻ dọc Chatbot / Ghi chú (#ldDock) sát mép phải, ngay trên thanh dưới cùng: là chỗ mở hộp ở Cuộn đọc
   (thay nút AI luận giải / Chatbot / Note ở thanh dưới). Hiện khi hộp đóng hoặc thu nhỏ; hộp mở thì ẩn (đóng bằng – / ✕ trên hộp). */
body.ld-doc.ld-chat-thu .note-panel { display: none !important; }
.ld-dock { display: none; }
body[data-layout="desktop"].ld-doc .ld-dock {
  display: flex; flex-direction: column; gap: 6px; position: fixed; right: 0; bottom: calc(var(--ld-day, 50px) + 10px); z-index: 955;
}
body[data-layout="desktop"].ld-doc.note-open:not(.ld-chat-thu) .ld-dock { display: none; }
body.ld-doc #hanNavBar :is(#btnToggleLG, #btnToggleAI, #btnToggleNote) { display: none !important; }
.ld-dock button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 34px; padding: 12px 0; cursor: pointer;
  border: 1px solid var(--ui-side-line); border-right: 0; border-radius: 10px 0 0 10px;
  background: var(--ui-side); color: var(--ui-side-fg-2); box-shadow: -4px 4px 14px rgba(0, 0, 0, .25);
  font: 600 12px Arial, sans-serif; transition: width .15s, color .15s;
}
.ld-dock button span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .02em; }   /* chữ dọc, đọc từ dưới lên */
.ld-dock svg { width: 16px; height: 16px; }
.ld-dock button:hover { width: 40px; color: var(--ui-side-fg); }
.ld-dock button.on { color: var(--ui-side-pri); border-color: var(--ui-side-pri); }
.ld-dock button:focus-visible { outline: 2px solid var(--ui-side-pri); outline-offset: 2px; }

/* ═══ Chọn giờ đẹp / Cấu hình – Cuộn đọc (body.ld-tim, bo-cuc.js) ═══
   Khối căn giữa: trái = cột #colChat (Chọn giờ đẹp: điều kiện + kết quả; Cấu hình: bảng cấu hình) cao theo nội dung, cuộn theo trang;
   phải = #colLaso dính dưới menubar: lá số (layout-scale.js đặt bề rộng #lasoWrap = lá số) + hàng ◀ ▶ ☰ ★ ngay dưới.
   Không có thanh dưới cùng (Chatbot / Ghi chú đã ẩn ở trang này: menubar.css). desktop-tools.js không khóa cuộn trang. */
body.ld-tim .separator, body.ld-tim #hanNavBar { display: none !important; }
body.ld-tim .main-layout { justify-content: center; column-gap: 18px; padding: 8px 16px 40px; }
body.ld-tim .col-chat { flex: none; width: 340px !important; height: auto; }   /* !important: thắng bề rộng kéo bằng thanh chia (style inline) */
/* Vùng điều kiện + kết quả: KHÔNG cuộn riêng (menubar.css cho cuộn riêng ở Bàn làm việc; overscroll-behavior: contain
   ở đó còn chặn lăn chuột cuộn trang khi con trỏ nằm trên danh sách) */
body.ld-tim #colChat #formArea { overflow: visible !important; overscroll-behavior: auto; min-height: 0; }
body.ld-tim .col-laso { flex: none !important; width: auto !important; min-width: 0; position: sticky; top: 52px; }   /* 52 = menubar 44 + 8 */
body.ld-tim #lasoWrap { display: flex !important; flex-direction: column; padding-bottom: 0 !important; }   /* !important: JS đặt style.display = 'block' khi vẽ lá số (chưa có kết quả: menubar.css vẫn ẩn, đặc hiệu cao hơn); desktop-tools.js chừa chỗ thanh dưới ở padding-bottom: không cần */
body.ld-tim #searchResultNav { order: 2; flex-wrap: nowrap; justify-content: center; margin: 12px 0 0; }   /* menubar.js đặt hàng này đầu #lasoWrap: đưa xuống dưới lá số */
body.ld-tim #searchResultNav :is(#btnLasoPrev, #btnLasoNext) .nav-label { display: none; }   /* gọn một hàng vừa bề rộng lá số: ◀ 3/48 ▶ ☰ ★ Xem lá số ↗ (layout-scale.js đo hàng này để chừa chỗ) */

/* Tìm xong: điều kiện thu gọn thành một dòng tóm tắt */
.ld-tim-tt { display: none; }
body.ld-tim .ld-tim-gon .ld-tim-tt {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
  padding: 10px 12px; border: 1px solid var(--ui-side-line); border-radius: 10px; background: var(--ui-side-the);
  color: var(--ui-side-fg); font-size: 12.5px; line-height: 1.45;
}
body.ld-tim .ld-tim-gon .search-panel-form { display: none; }

/* Chưa có kết quả: khung chờ bên phải cỡ bằng lá số (bo-cuc.js đặt rộng / cao) */
.ld-tim-trong { display: none; }
body.ld-tim.mb-search-empty .ld-tim-trong {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; padding: 24px;
  border: 1.5px dashed var(--ui-side-line); border-radius: 6px; color: var(--ui-side-fg-2); text-align: center;
}
.ld-tim-trong svg { width: 56px; height: 56px; opacity: .6; }
.ld-tim-trong b { font: 600 18px 'Playfair Display', Georgia, serif; color: var(--ui-side-fg); }
.ld-tim-trong span { max-width: 280px; font-size: 13px; line-height: 1.5; }

/* Khung điều kiện kiểu ô lập lá số (.hp-form, home-page.css) — trang Chọn giờ đẹp: desktop (cả hai bố cục) và điện thoại (body.ld-tim-on).
   Bộ chọn có thêm :is(.col-chat, #formAreaLaso) #searchPanel để thắng kiểu ô nhập chung của thanh bên / form điện thoại
   (forms.css: body[data-layout="desktop"] .col-chat #searchPanel …, body[data-layout="mobile"] #formAreaLaso #searchPanel …). */
body.ld-tim-on #searchPanel :is(.search-block-start, .search-block-span-gt, .fg-ansao-method) { display: none !important; }   /* khối cũ (chỉ còn nhãn, các ô đã chuyển vào khung); !important: thắng kiểu hiện khối của bản điện thoại */
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form { flex: none; order: 0; width: 100%; padding: 16px; gap: 12px; margin: 0 0 14px; border-radius: 14px; box-shadow: none; }   /* order 0: home-page.css đặt .hp-form order:1 trên điện thoại → bị đẩy xuống dưới chính tinh */
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form input,
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form select {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d8c9a6; border-radius: 10px;
  background: #fffdf8; color: #211a12; font: 14px Arial, 'Helvetica Neue', sans-serif;
}
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form select { padding-right: 30px; appearance: none; -webkit-appearance: none; }
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form :is(input, select):focus-visible { outline: 2px solid #b07d1a; outline-offset: 1px; border-color: #d8c9a6; }
body.ld-tim-on .ld-tim-form .hp-sel .hp-ic { top: 11px; }
body.ld-tim-on .ld-tim-form .hp-hang2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.ld-tim-on .ld-tim-form .hp-chon button { height: 30px; font-size: 13px; }
body.ld-tim-on .ld-tim-form label { margin: 0; text-transform: none; letter-spacing: normal; }   /* bỏ kiểu nhãn in hoa của thanh bên */
body.ld-tim-on :is(.col-chat, #formAreaLaso) #searchPanel .ld-tim-form #searchGt { display: none; }   /* ô chọn gốc: giữ giá trị, thay bằng nút đôi Nam / Nữ */

/* ═══ Xem lá số – Bàn làm việc (thẻ ô lập lá số ở cột trái: body.ld-the-on, không .ld-doc) ═══
   Hàng lá số cao hết chỗ từ dưới thanh mục tới sát thanh dưới cùng (bo-cuc.js đặt --ld-hang): khung phải (AI luận giải /
   Chatbot / Note, note.css: cao bằng hàng) cao tối đa; lá số căn giữa vùng bên trái khung cả trên dưới lẫn trái phải
   (trái phải: .grid-scaler-outer đã căn giữa; layout-scale.js đo chỗ trống từ đỉnh hàng, không từ lá số). */
body.ld-the-on:not(.ld-doc) #lasoRow { height: var(--ld-hang, auto); }
body.ld-the-on:not(.ld-doc) #gridScalerOuter { align-self: center; }

/* ═══ Điện thoại – trang Xem lá số (body.ld-the-m, bo-cuc.js): thẻ ô lập lá số thay form cũ ═══ */
body.ld-the-m #formAreaLaso { display: none !important; }                 /* form cũ: ẩn, vẫn giữ dữ liệu cho lá số / Lưu / Luận giải */
body.ld-the-m .ld-the { display: flex; flex-direction: column; gap: 10px; margin: 8px 8px 12px; }
/* Nút "Lá số đã lưu" (đã đăng nhập) — ngay trên ô lập lá số */
.ld-the-ds[hidden] { display: none; }
.ld-ds-nut {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--ui-side-line); border-radius: 14px; background: var(--ui-side); color: var(--ui-side-fg);
  font: 14px Arial, sans-serif; -webkit-tap-highlight-color: transparent;
}
.ld-ds-nut:active { transform: scale(.99); }
.ld-ds-nut-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: color-mix(in srgb, var(--ui-side-pri) 16%, transparent); color: var(--ui-side-pri); }
.ld-ds-nut-ic svg { width: 20px; height: 20px; }
.ld-ds-nut-chu { flex: 1; min-width: 0; }
.ld-ds-nut-chu b { font-size: 15px; }
.ld-ds-nut-so { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--ui-side-in); border: 1px solid var(--ui-side-line);
  font: 700 12px Arial, sans-serif; text-align: center; }
.ld-ds-nut-mui { font-size: 22px; line-height: 1; color: var(--ui-side-fg-2); }
/* Hộp "Lá số đã lưu" trên điện thoại: tấm trượt từ dưới lên */
body[data-layout="mobile"] .ld-ds-nen { align-items: flex-end; padding: 0; }
body[data-layout="mobile"] .ld-ds {
  width: 100%; height: 88vh; height: 88dvh; padding: 14px 14px calc(12px + env(safe-area-inset-bottom)); gap: 10px;
  border-radius: 18px 18px 0 0; border-bottom: 0; animation: ld-ds-len .22s ease-out; font: 15px/1.45 Arial, sans-serif;
}
body[data-layout="mobile"] .ld-ds-dau b { font-size: 20px; }
body[data-layout="mobile"] .ld-ds-x { width: 40px; height: 40px; }
body[data-layout="mobile"] .ld-ds-x svg { width: 22px; height: 22px; }
body[data-layout="mobile"] .ld-ds-trong { font-size: 15px; }
@keyframes ld-ds-len { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
body[data-layout="mobile"] .ld-ds-meo { display: none; }                  /* mẹo phím ↑ ↓ Enter: chỉ desktop */
/* Danh sách trong hộp (cloud.css là cỡ thanh bên desktop): to vừa tay, chữ dễ đọc */
body[data-layout="mobile"] .ld-ds .cl-row { gap: 8px; margin-top: 8px; }
body[data-layout="mobile"] .ld-ds .cl-row select, body[data-layout="mobile"] .ld-ds .cl-row .cl-search {
  height: 38px; padding: 0 10px; border-radius: 10px; font: 14px Arial, sans-serif;
}
body[data-layout="mobile"] .ld-ds .cl-row select { min-width: 0; flex: 1 1 0; }
body[data-layout="mobile"] .ld-ds .cl-row .cl-sort { flex: 0 0 38%; }    /* hàng tìm: ô tìm rộng, ô sắp xếp vừa đủ chữ */
body[data-layout="mobile"] .ld-ds .cl-count { margin: 8px 2px 2px; font-size: 13px; }
body[data-layout="mobile"] .ld-ds .cl-items { margin: 4px 0 0; }
body[data-layout="mobile"] .ld-ds .cl-item { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px 8px 12px; border-radius: 10px; font-size: 15px; }
body[data-layout="mobile"] .ld-ds .cl-item + .cl-item { margin-top: 2px; }
body[data-layout="mobile"] .ld-ds .cl-name { font-weight: 600; font-size: 15px; }
body[data-layout="mobile"] .ld-ds .cl-snip { margin-top: 2px; font-size: 12.5px; }
body[data-layout="mobile"] .ld-ds :is(.cl-gt, .cl-year) { font-size: 13px; }
body[data-layout="mobile"] .ld-ds .cl-del { display: grid; place-items: center; width: 36px; height: 36px; flex: none; font-size: 16px; opacity: .6; }   /* không có rê chuột: luôn hiện mờ */
body[data-layout="mobile"] .ld-ds .cl-group { padding: 10px 6px 4px; font-size: 13px; }
body[data-layout="mobile"] .ld-ds .cl-empty { padding: 12px 6px; font-size: 14px; }
/* Lá số đang mở: nền nhạt màu nhấn + vạch trái (không chữ trắng trên nền nâu ở theme Sáng) */
body[data-layout="mobile"] .ld-ds .cl-item.active { background: color-mix(in srgb, var(--ui-side-pri) 16%, transparent); color: var(--ui-side-fg); box-shadow: inset 3px 0 0 var(--ui-side-pri); }
body[data-layout="mobile"] .ld-ds .cl-item.active :is(.cl-gt, .cl-year, .cl-snip) { color: var(--ui-side-fg-2); opacity: 1; }

/* ═══ Thanh zoom lá số (desktop, trang Xem lá số: #ldZoom, bo-cuc.js) — Bàn làm việc: mép trái vùng lá số; Cuộn đọc: mép phải màn hình ═══ */
.ld-zoom { display: none; }
body[data-layout="desktop"].ld-the-on .ld-zoom:not([hidden]) {
  position: absolute; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 30px; padding: 6px 0 10px;
  border: 1px solid var(--ui-side-line); border-radius: 999px; background: var(--ui-side); color: var(--ui-side-fg-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  opacity: .35; transition: opacity .2s ease;                             /* mờ khi không dùng; rê chuột / đang kéo → rõ */
}
body[data-layout="desktop"].ld-the-on .ld-zoom:is(:hover, :focus-within) { opacity: 1; }
body[data-layout="desktop"].ld-the-on.ld-doc .ld-zoom:not([hidden]) { position: fixed; right: 12px; top: 50%; height: 240px; transform: translateY(-50%); }
.ld-zoom-vua { display: grid; place-items: center; width: 22px; height: 22px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ui-side-fg-2); cursor: pointer; }
.ld-zoom-vua svg { width: 15px; height: 15px; }
.ld-zoom-vua:hover:not(:disabled) { background: var(--ui-side-hover); color: var(--ui-side-pri); }
.ld-zoom-vua:disabled { opacity: .35; cursor: default; }
.ld-zoom-keo {                                                            /* ô trượt đứng: trên = to (200%), dưới = nhỏ (50%); 100% = vừa màn hình */
  flex: 1; min-height: 0; width: 18px; margin: 0; padding: 0; cursor: ns-resize;
  writing-mode: vertical-lr; direction: rtl; appearance: none; -webkit-appearance: none; background: transparent;
}
.ld-zoom-keo::-webkit-slider-runnable-track { width: 4px; border-radius: 4px;
  background: linear-gradient(to top, var(--ui-side-pri) var(--z, 100%), var(--ui-side-line) var(--z, 100%)); }
.ld-zoom-keo::-moz-range-track { width: 4px; border-radius: 4px; background: var(--ui-side-line); }
.ld-zoom-keo::-moz-range-progress { width: 4px; border-radius: 4px; background: var(--ui-side-pri); }
.ld-zoom-keo::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-left: -6px; border-radius: 50%;
  background: var(--ui-side-pri); border: 2px solid var(--ui-side); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.ld-zoom-keo::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ui-side-pri); border: 2px solid var(--ui-side); }
.ld-zoom-keo:focus-visible { outline: 2px solid var(--ui-side-pri); outline-offset: 3px; border-radius: 6px; }

/* ═══ Thanh dưới lá số (desktop): ô "Xem hạn" + ‹ năm › chung một khung viền (bo-cuc.js datXemHan: .ld-xh-khoi) ═══ */
.ld-xh-khoi {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 2px 4px 2px 10px;
  border: 1px solid color-mix(in srgb, var(--ui-page-fg) 30%, transparent); border-radius: 999px;   /* --ui-page-fg: màu chữ của thanh (theme.css) */
}
.ld-xh-khoi:empty { display: none; }                                      /* điện thoại: hai phần tử đã sang hàng riêng */
.ld-xh-khoi > #chkXemHanLabel { margin: 0; white-space: nowrap; }

/* ═══ Điện thoại – các hàng dưới lá số (#hanNavBar.ld-m-hang, bo-cuc.js datHangM) ═══ */
body[data-layout="mobile"] #hanNavBar.ld-m-hang { flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding-top: 12px; }   /* cách lá số */
#hanNavBar .ld-m-h1, #hanNavBar .ld-m-h2, #hanNavBar .ld-m-h3 { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* Hàng 1: Chatbot · Ghi chú · Xuất prompt — 3 nút đều nhau */
body[data-layout="mobile"] #hanNavBar .ld-m-h1 > * {
  flex: 1 1 0; min-width: 0; height: 34px; padding: 0 8px; margin: 0; justify-content: center; gap: 5px;
  border: 1px solid var(--btn-sec-border); border-radius: 8px; background: var(--btn-sec-bg); color: var(--btn-sec-fg);
  font: var(--btn-font-sm); box-shadow: none; white-space: nowrap;
}
/* Hàng 2: kéo ngang khi dài hơn màn hình */
#hanNavBar .ld-m-h2 { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 1px 0; }
#hanNavBar .ld-m-h2::-webkit-scrollbar { display: none; }
#hanNavBar .ld-m-h2 > .han-nav-check-label {
  flex: none; white-space: nowrap; padding: 5px 10px; margin: 0;
  border: 1px solid var(--ui-side-line); border-radius: 999px; background: var(--ui-side-in);
}
/* Hàng 3: Xem hạn · ‹ năm › | ‹ giờ › */
#hanNavBar .ld-m-h3 { justify-content: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#hanNavBar .ld-m-h3 > * { flex: none; white-space: nowrap; }
#hanNavBar .ld-m-h3 .han-nav-gio { min-width: 112px; }
/* Hai nút to dưới cùng */
body[data-layout="mobile"] #lasoWrap .laso-actions > .ui-btn { height: 46px; font-size: 14px; border-radius: 10px; }
body[data-layout="mobile"] #lasoWrap .laso-actions > .laso-download-btn {      /* Tải ảnh: kiểu phụ để Luận giải AI nổi bật */
  background: var(--btn-sec-bg); border-color: var(--btn-sec-border); color: var(--btn-sec-fg); box-shadow: none;
}
body[data-layout="mobile"] #lasoWrap .laso-actions > .ld-m-ai {
  flex-grow: 1.4; font-weight: 700; position: relative; overflow: hidden; isolation: isolate;
  animation: ld-ai-sang 2.8s ease-in-out infinite;                        /* quầng sáng nhẹ */
}
.ld-m-ai::after {                                                         /* vệt sáng quét ngang (lấp lánh) */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 48%, rgba(255, 236, 170, .45) 52%, transparent 70%);
  transform: translateX(-120%); animation: ld-ai-quet 2.8s ease-in-out infinite;
}
.ld-m-ai .nt-ico { width: 18px; height: 18px; animation: ld-ai-sao 1.6s ease-in-out infinite; }   /* ngôi sao lấp lánh */
@keyframes ld-ai-quet { 0%, 35% { transform: translateX(-120%); } 75%, 100% { transform: translateX(120%); } }
@keyframes ld-ai-sang { 0%, 100% { box-shadow: 0 4px 14px rgba(27, 35, 80, .28); } 50% { box-shadow: 0 4px 20px rgba(200, 150, 40, .55); } }
@keyframes ld-ai-sao {                                                   /* lóe sáng nhanh, tắt dần, nghỉ */
  0%, 100% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 0 rgba(255, 224, 138, 0)); opacity: .85; }
  12%      { transform: scale(1.3) rotate(18deg); filter: drop-shadow(0 0 5px rgba(255, 236, 170, 1)) brightness(1.5); opacity: 1; }
  24%      { transform: scale(.92) rotate(-6deg); filter: drop-shadow(0 0 2px rgba(255, 224, 138, .7)); opacity: .9; }
  36%      { transform: scale(1.15) rotate(8deg); filter: drop-shadow(0 0 4px rgba(255, 236, 170, .9)) brightness(1.3); opacity: 1; }
  55%      { transform: scale(1) rotate(0); filter: drop-shadow(0 0 1px rgba(255, 224, 138, .4)); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) { .ld-m-ai, .ld-m-ai::after, .ld-m-ai .nt-ico { animation: none; } }

/* ═══ Điện thoại – Cấu hình (body.m-page-cfg) ═══ */
/* Dưới lá số: chỉ trang Xem lá số mới có (hàng Xem hạn / tứ hóa / Chatbot…, Sao lưu, Luận giải AI · Tải ảnh) */
body[data-layout="mobile"].m-page-cfg :is(#hanNavBar, #luuModeBar, #lasoWrap .laso-actions) { display: none !important; }
/* Ô chọn giao diện: chỉ điện thoại (desktop đổi bằng nút 🎨 trên menubar) */
.ld-cfg-theme { display: none; }
body[data-layout="mobile"] #cfgPanel .ld-cfg-theme { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.ld-cfg-muc { display: none; }                                           /* tiêu đề mục "Lá số" (sau ô Giao diện) */
body[data-layout="mobile"] #cfgPanel .ld-cfg-muc {
  display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; margin-top: 6px;
  color: var(--ui-side-fg); font: 700 15px 'Playfair Display', Georgia, serif;
}
body[data-layout="mobile"] #cfgPanel .ld-cfg-muc::after { content: ""; flex: 1; height: 1px; background: var(--ui-side-line); }
.ld-theme-chon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ld-theme-chon button {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; cursor: pointer;
  border: 1.5px solid var(--ui-side-line); border-radius: 12px; background: var(--ui-side-in); color: var(--ui-side-fg);
  font: 600 14px Arial, sans-serif; -webkit-tap-highlight-color: transparent;
}
.ld-theme-chon button[aria-checked="true"] { border-color: var(--ui-side-pri); box-shadow: 0 0 0 2px var(--ui-side-pri) inset; }
.ld-theme-mau { width: 28px; height: 22px; flex: none; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); }
/* Bảng cấu hình: thẻ theo theme, 1 cột, ô chọn / thanh trượt to vừa tay
   (bộ chọn có #formAreaLaso #cfgPanel .cfg-panel-grid để thắng forms.css: body[data-layout="mobile"] #formAreaLaso #cfgPanel select …) */
body[data-layout="mobile"] #formAreaLaso #cfgPanel {
  margin: 8px 8px 12px; padding: 16px !important; border: 1px solid var(--ui-side-line); border-radius: 14px;
  background: var(--ui-side-the); color: var(--ui-side-fg);
}
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid > .fg { margin: 0; }
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid label {
  display: block; margin: 0 0 6px; color: var(--ui-side-fg-2); font: 600 12px Arial, sans-serif; text-transform: none; letter-spacing: normal;
}
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid select {
  width: 100%; height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--ui-side-line); border-radius: 10px;
  background: var(--ui-side-in) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  color: var(--ui-side-fg); font: 14px Arial, sans-serif; appearance: none; -webkit-appearance: none;
}
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid select:focus-visible { outline: 2px solid var(--ui-side-pri); outline-offset: 1px; }
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid input[type="range"] { height: 28px; accent-color: var(--ui-side-pri); }
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid input[type="range"] + span {
  min-width: 40px !important; font-size: 13px !important; font-weight: 600; color: var(--ui-side-fg); text-align: right;   /* !important: thắng style="" trong index.html */
}
body[data-layout="mobile"] #formAreaLaso #cfgPanel .cfg-panel-grid .ui-btn { height: 42px; border-radius: 10px; }

/* ═══ Chọn giờ đẹp – phần dưới khung điều kiện ═══ */
/* Nhãn chính tinh: "Tên (chú thích)" (bo-cuc.js nhanChinhTinh) — mặc định hiện y như cũ */
.ld-ct-phu { font: inherit; }
.ld-ct-phu::before { content: "("; }
.ld-ct-phu::after { content: ")"; }
/* Điện thoại: chính tinh thành thẻ như khung điều kiện; chữ, nút, viên chọn theo theme, vừa tay */
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chinh-wrap {
  padding: 16px; border: 1px solid var(--ui-side-line); border-radius: 14px; background: var(--ui-side-the); color: var(--ui-side-fg);
}
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chinh-wrap > label {
  margin: 0 0 10px; color: var(--ui-side-fg); font: 700 15px Arial, sans-serif; text-transform: none; letter-spacing: normal;
}
body[data-layout="mobile"] #formAreaLaso #searchPanel .ld-ct-phu { display: block; margin-top: 3px; color: var(--ui-side-fg-2); font: 400 12px Arial, sans-serif; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .ld-ct-phu::first-letter { text-transform: uppercase; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .ld-ct-phu::before,
body[data-layout="mobile"] #formAreaLaso #searchPanel .ld-ct-phu::after { content: none; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chip-actions { gap: 8px; margin-bottom: 10px; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .btn-chip-action {          /* !important: forms.css đặt bằng !important */
  height: 32px; padding: 0 14px !important; border: 1px solid var(--ui-side-line) !important; border-radius: 999px;
  background: var(--ui-side-in) !important; color: var(--ui-side-fg) !important; font: 600 13px Arial, sans-serif !important;
}
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chinh-tinh-list { gap: 8px; padding: 0; border: 0; background: none; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 14px;
  border: 1px solid var(--ui-side-line); border-radius: 999px; background: var(--ui-side-in); color: var(--ui-side-fg); font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chip.active {   /* đang chọn: nền nhạt màu nhấn + viền + dấu ✓ (không chữ trắng trên nền nâu) */
  border-color: var(--ui-side-pri); background: color-mix(in srgb, var(--ui-side-pri) 18%, var(--ui-side-in)); color: var(--ui-side-fg); font-weight: 700;
}
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-chip.active::before { content: "✓"; color: var(--ui-side-pri); }
body[data-layout="mobile"] #formAreaLaso #searchPanel :is(.search-hint, .search-gio-hint) { margin-top: 8px; padding: 0; color: var(--ui-side-fg-2); font-size: 12px; line-height: 1.5; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .search-gio-hint { margin: 2px 4px 0; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .fg-search-submit-wrap { margin-top: 6px; }
body[data-layout="mobile"] #formAreaLaso #searchPanel .btn-search-submit {         /* như nút "Lập lá số" của ô lập lá số */
  width: 100% !important; max-width: none; min-height: 50px; border: 0; border-radius: 14px;
  background: linear-gradient(180deg, #2b2016, #16100a); color: #f6dfa6; font: 700 16px Arial, sans-serif; letter-spacing: .02em;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .6);
}