/*!
 * table-grid (http://mdo.github.io/table-grid)
 * Released under MIT, (c) 2014 Mark Otto
 */

html {
    font-size: 14px;
}

@media (min-width: 600px) {
    html {
        font-size: 14px;
    }
}

body {
    margin: 0;
    padding-bottom: 3rem;
    font-family: 'Roboto', "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: center;
    background-color: #fff;
}

.container {
    max-width: 54rem;
    /*padding: 0 1rem;*/
}

a {
    color: #1874cd;
    text-decoration: none;
}

a:hover {
    color: #104e8b;
}

h1,
h2,
h3 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-weight: 500;
    line-height: 1.1;
    color: #333;
}

h1 {
    font-size: 3rem;
}

h1 small {
    font-size: 80%;
    color: #777;
}

h2 {
    margin-top: 3rem;
    font-size: 2rem;
}

p {
    margin-top: 0;
}

.container > p {
    margin: .5rem auto 1rem;
    max-width: 800px;
}

hr {
    max-width: 100px;
    margin: 3rem auto;
    border: 0;
    border-top: .1rem solid #eee;
}

code {
    padding: .15rem .3rem;
    font-family: Menlo, "Courier New", monospace;
    font-size: 90%;
    color: #cd3333;
    background-color: #f5f5f5;
    border-radius: .15rem;
}


/* Display utility classes */

.inline-block {
    display: inline-block;
}


/* Masthead */

.masthead {
    padding: 4rem 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .65);
    text-align: center;
    /*background-color: #b94a48;*/
}

.masthead a,
.masthead strong {
    font-weight: normal;
    color: #fff;
}

.masthead p {
    font-size: 1.25rem;
}


/* Make it red for easy views */

.grid-example {
    margin-bottom: 1rem;
}

.grid-example .col {
    line-height: 3;
    text-align: center;
    color: #333;
    /*background-color: rgba(255, 0, 0, .15);*/
}


/* Nested grid examples need outdenting because padding. */

.grid-example .grid-example {
    margin-top: .5rem;
    margin-bottom: 0;
}


/* Increase height of vertically centered example */

.grid-example .grid-align-middle {
    height: 200px;
}

.grid-example.grid-align-middle .col {
    min-height: 3rem;
    line-height: 1.5;
}

.container {
    max-width: 940px;
    margin-right: auto;
    margin-left: auto;
}

.laso {
    width: 800px;
    min-height: 960px;
    height: auto;
    margin-right: auto;
    margin-left: auto;
    overflow: visible;
    background-image: url('texture.jpg');
    position: relative;
}

.cung-top {
    min-height: 25px;
    margin: 2px 2px 0 0;
}
/* Padding nội bộ cho từng cell trong cung-top (display: table-cell)
   để content cách đường kẻ cung */
.cung-top > .col {
    padding: 6px 8px 6px 8px;
}
.cung-bottom {
    min-height: 22px;
    margin: 0;
    padding: 0;
}

.cung-middle {
    min-height: 180px;
    height: auto;
}

.cung-middle ul,
li {
    list-style-type: none;
}

.hanhKim {
    color: #9E9E9E;
}

.hanhMoc {
    color: #4CAF50;
}

.hanhThuy {
    color: #000100;
}

.hanhHoa {
    color: #a71a14;
}

.hanhTho {
    color: #e6bd37;
}

/* chinhTinh giờ nằm trong cung-top (col col-8 cungChu-area), không tốn cung-middle */
.cungChu-area {
    text-align: center;
    line-height: 1.25;
    vertical-align: top;
    padding-top: 2px;
}
.cungChu-area .cungChu-line {
    margin-bottom: 1px;
}
.cungChu-area .chinhTinh {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.15em;
    line-height: 1.3;
    letter-spacing: 0.3px;
}
.cungChu-area .chinhTinh .ct-item {
    white-space: nowrap;
    margin-right: 4px;
}

.cungChu {
    text-transform: uppercase;
    font-size: 1.1em;
    font-weight: 800;
    padding-bottom: 0.2em;
}

/* Cột phải cung-top: đại hạn (trên) + nguyệt hạn (dưới) — đối xứng với chi/hành ở cột trái */
.cung-top .ct-right {
    text-align: right;
    line-height: 1.1;
}
.cung-top .ct-right .daiHan {
    font-weight: bold;
    color: #1565C0;
    font-size: 11px;
}
.cung-top .ct-right .nguyetHan {
    font-size: 10px;
    color: #6a1b9a;
    font-style: italic;
    margin-top: 2px;
}

.cungThan {
    font-weight: bold;
    /* màu kế thừa từ class hanhX trên cùng span */
}

.xungChieu {
    background-color: rgba(0, 0, 0, 0.04);
}

.diaCung {
    width: 200px;
    min-height: 240px;
    height: auto;
    position: relative;
    box-sizing: border-box;
    overflow: visible;
    border: 1px solid #888;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
}
/* diaCung trong table-cell (middle col Ngọ/Mùi/Sửu/Tý): fill chiều cao cell */
.col > .diaCung {
    height: 100%;
}
.diaCung .cung-top    { flex: 0 0 auto; }
.diaCung .cung-middle { flex: 1 1 auto; }
.diaCung .cung-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 24px;
    box-sizing: border-box;
}

#cungOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.tuanTrietBanner {
    position: absolute;
    z-index: 50;
    font-size: 9px;
    font-weight: bold;
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
    background-color: #000;
    letter-spacing: 0.2px;
}
.tuanTrietBanner.edge-top    { top: 0;    left: 50%; transform: translate(-50%, -50%); }
.tuanTrietBanner.edge-bottom { bottom: 0; left: 50%; transform: translate(-50%, 50%); }
.tuanTrietBanner.edge-left   { left: 0;   top: 50%;  transform: translate(-50%, -50%); }
.tuanTrietBanner.edge-right  { right: 0;  top: 50%;  transform: translate(50%, -50%); }
/* ẩn label Tuần/Triệt cũ trong cung body — đã render banner ở biên */
.tuanTriet { display: none; }

.thienBan {
    width: 400px;
    min-height: 480px;
    height: auto;
    position: relative;
    box-sizing: border-box;
    padding: 80px 36px 60px 36px;
    text-align: center;
    display: block !important;
    overflow: hidden;
}
/* Hình nền phủ TOÀN LÁ SỐ — toggle bằng class .has-bg + data-bg trên #laso */
#laso.has-bg::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: 78% auto;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.18;
    pointer-events: none;
    /* không z-index — ::before paint trước cung trong DOM order, content vẫn trên ảnh */
}
#laso.has-bg[data-bg="rongphuong"]::before { background-image: url('rongphuong.jpeg'); }
#laso.has-bg[data-bg="nenhorong"]::before  { background-image: url('nenhorong.jpg'); }
#laso.has-bg[data-bg="nenphuong"]::before  { background-image: url('nenphuong.jpg'); }
#laso.has-bg[data-bg="phuongrong"]::before { background-image: url('phuongrong.jpg'); }
#laso.has-bg[data-bg="shinigami"]::before  { background-image: url('Shinigami.jpg'); }
.thienBan .noidung,
.thienBan .codeBy {
    position: relative;
    z-index: 1;
}
.thienBan .noidung {
    display: inline-block;
    text-align: left;
    margin: 0;
    padding: 0;
}

/* Code by footer ở đáy mệnh bàn */
.thienBan .codeBy {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    font-style: italic;
    color: #aaa;
    pointer-events: none;
}

.thienBan .noidung {
    display: inline-block;
    text-align: left;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.thienBan .noidung .header {
    text-align: center;
    font-weight: bold;
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
}

.thienBan .noidung .info-row {
    text-align: left;
    line-height: 1.5em;
    padding: 4px 0;
    font-size: 0.95em;
}
.thienBan .noidung .info-label {
    font-weight: 700;
    color: #444;
}
.thienBan .noidung .info-label-inline {
    font-weight: 700;
    color: #444;
}
.thienBan .noidung .info-value {
    font-weight: 500;
    color: #222;
}
.thienBan .noidung .info-sep {
    color: #aaa;
    margin: 0 6px;
}
.thienBan .noidung .canchi {
    color: #c62828;
    font-weight: 700;
}
.thienBan .noidung .namxem-display {
    color: #1565C0;
    font-weight: 700;
}
.thienBan .noidung .vong-info {
    color: #6a1b9a;
    font-weight: 600;
    font-size: 0.92em;
}
.thienBan .noidung .cach-cuc {
    color: #ad1457;
    font-weight: 700;
}
.thienBan .noidung .info-value .lich {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
    margin-left: 4px;
    font-weight: normal;
}
.thienBan .noidung .sinh-khac-inline {
    display: block;
    font-size: 0.85em;
    font-style: italic;
    font-weight: normal;
    color: #888;
    margin-left: 0;
}


input {
    padding: .5em .6em;
    display: inline-block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    border-radius: 4px;
    vertical-align: middle;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

form {
    color: #000;
    text-align: left;
}

label {
    padding-right: 2rem;
}

select {
    height: 2.25em;
    border: 1px solid #ccc;
    background-color: #fff;
}

.grid .left {
    width: 30%;
    text-align: right;
}

.grid .right {
    width: 70%;
}

.formborder {
    border: 1px solid #c92424;
    padding: 10px;
}

.border {
    border: 1px solid #888;
}

.border-right {
    border-right: 1px solid #888;
}

.border-left {
    border-left: 1px solid #888;
}

.border-bottom {
    border-bottom: 1px solid #888;
}

.border-top {
    border-top: 1px solid #888;
}

.inset-border {
    box-sizing: border-box;
}

.button {
    cursor: pointer;
    display: inline-block;
    min-height: 1em;
    outline: 0;
    border: none;
    vertical-align: baseline;
    background: #E0E1E2;
    color: rgba(0, 0, 0, .6);
    font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
    margin: 0 .25em 0 0;
    padding: .78571429em 1.5em;
    text-transform: none;
    text-shadow: none;
    font-weight: 700;
    line-height: 1em;
    font-style: normal;
    text-align: center;
    text-decoration: none;
    border-radius: .28571429rem;
    box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34, 36, 38, .15) inset;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
    transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
    will-change: '';
    -webkit-tap-highlight-color: transparent;
}

input.primary:hover {
    background-color: #1678c2;
    color: #FFF;
    text-shadow: none;
}

#namsinh {
    width: 100px;
}

input.warning {
    background-color: #f0ad4e;
    color: #FFF;
    text-shadow: none;
}

input.primary {
    background-color: #2185D0;
    color: #FFF;
    text-shadow: none;
}


/*.phuTinh .col{
    padding-bottom: 0.2em;
}*/

.phuTinh .saotot {
    width: 46%;
    line-height: 1.3em;
    text-align: left;
    display: inline-block;
    white-space: nowrap;
    vertical-align: top;
    font-weight: 400;
}

.phuTinh .saoxau {
    width: 46%;
    line-height: 1.3em;
    display: inline-block;
    text-align: left;
    white-space: nowrap;
    vertical-align: top;
    font-weight: 400;
}

/* Chỉ bold lục cát/sát + Lộc Tồn + Thiên Hình */
.phuTinh .sao-bold {
    font-weight: 700;
}

.blocks {
    width: 46%;
    white-space: nowrap;
    display: inline-block;
    /*overflow: hidden;
    text-overflow: ellipsis;*/
    line-height: 1.2em;
    font-size: 14px;
}


/*.blocks:nth-child(odd){
    text-align: left;
}
.blocks:nth-child(even){
    text-align: right;
}*/

.anlaso {
    display: none !important;
}

.hide {
    width: 46%;
    white-space: nowrap;
    display: inline-block;
    line-height: 1.2em;
    font-size: 14px;
    height: 0;
    overflow: hidden;
}


/*@media (min-width: 600px) {*/

.grid {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}

.col {
    display: table-cell;
    vertical-align: top;
}

.thongtin {
    padding-bottom: 1rem;
}

.grid-padded {
    margin-left: -1rem;
    margin-right: -1rem;
}


/*.grid-padded .grid {
    border-spacing: 1rem 0;
}*/

.label {
    display: inline;
    padding: .2em .6em .3em;
    font-size: 90%;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25em;
}

.label-tuan {
    background-color: #3E2723;
}

.label-triet {
    background-color: #263238;
}

.tuanTriet {
    padding-top: 0.5rem;
}

/* Lục cát/sát: nổi bật hơn ở đầu mỗi cột */
.sao-luccat {
    font-weight: 800 !important;
    letter-spacing: 0.2px;
}
.sao-lucsat {
    font-weight: 800 !important;
    letter-spacing: 0.2px;
}
/* Vòng Bác Sỹ - Lộc Tồn: nhạt hơn ở dưới mỗi cột */
.sao-vongbacsy {
    opacity: 0.75;
    font-size: 0.92em;
}
/* Thiên thương / Thiên sứ / Thiên la / Địa võng — nhỏ và mờ nhất, đặt cuối */
.sao-thienla {
    opacity: 0.55;
    font-size: 0.82em;
    font-weight: normal !important;
}

/* Lưu sao — sao chuyển động theo năm xem (L.Lộc Tồn, L.Hóa Lộc, ...).
   Màu thừa hưởng từ class hanhX (hanhKim/hanhMoc/...) thêm vào cùng span. */
.sao-luu {
    font-size: 0.88em;
    font-style: italic;
    font-weight: 600;
}

/* Lưu Đại Vận label ở bottom-left mỗi cung */
.luu-dv {
    color: #1565C0;
    font-weight: 700;
    font-size: 11px;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.luu-dv.luu-dv-menh {
    color: #c62828;
    background: #ffebee;
    padding: 0 3px;
    border-radius: 2px;
}
.cung-bottom .col {
    vertical-align: middle;
    line-height: 1.2;
}
.cung-bottom .trang-sinh-text {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1565C0;
}

/* Lưu Niên Đại Vận label ở bottom-right mỗi cung */
.luu-nien {
    color: #2e7d32;
    font-weight: 700;
    font-size: 11px;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.luu-nien.luu-nien-menh {
    color: #c62828;
    background: #fff3e0;
    padding: 0 3px;
    border-radius: 2px;
}

/* Cung-top trái: chi + ngũ hành xếp dọc */
.cung-top .chi-hanh .chi-text {
    font-weight: bold;
    font-size: 13px;
    color: #222;
    line-height: 1.1;
    white-space: nowrap;
}
.cung-top .chi-hanh .hanh-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 2px;
}

/* Tiểu hạn — chỉ là chữ nhỏ ở cạnh trong của cung (giáp mệnh bàn) */
.tieuHanBadge {
    position: absolute;
    z-index: 6;
    font-size: 10px;
    font-weight: 600;
    color: #5d4037;
    pointer-events: none;
    white-space: nowrap;
    padding: 0 2px;
}
/* Đặt hẳn ra mệnh bàn, có gap 4px khỏi viền cung */
.tieuHanBadge.edge-top    { top: -4px;    left: 50%;  transform: translate(-50%, -100%); }
.tieuHanBadge.edge-bottom { bottom: -4px; left: 50%;  transform: translate(-50%, 100%);  }
.tieuHanBadge.edge-left   { left: -4px;   top: 50%;   transform: translate(-100%, -50%); }
.tieuHanBadge.edge-right  { right: -4px;  top: 50%;   transform: translate(100%, -50%);  }
/* 4 cung góc: chữ đẩy hẳn ra góc mệnh bàn */
.tieuHanBadge.edge-bottom-right { bottom: -4px; right: -4px; transform: translate(100%, 100%);   }
.tieuHanBadge.edge-bottom-left  { bottom: -4px; left: -4px;  transform: translate(-100%, 100%);  }
.tieuHanBadge.edge-top-right    { top: -4px;    right: -4px; transform: translate(100%, -100%);  }
.tieuHanBadge.edge-top-left     { top: -4px;    left: -4px;  transform: translate(-100%, -100%); }


/*}*/


/*@media (min-width: 600px) {*/

.col-1 {
    width: 8.333333%;
}

.col-2 {
    width: 16.666667%;
}

.col-3 {
    width: 25%;
}

.col-4 {
    width: 33.333333%;
}

.col-5 {
    width: 41.666667%;
}

.col-6 {
    width: 50%;
}

.col-7 {
    width: 58.333333%;
}

.col-8 {
    width: 66.666667%;
}

.col-9 {
    width: 75%;
}

.col-10 {
    width: 83.333333%;
}

.col-11 {
    width: 91.666667%;
}

.grid-align-middle .col {
    vertical-align: middle;
}

.grid-reverse {
    direction: rtl;
}

.grid-reverse .col {
    direction: ltr;
}

.Zebra_Tooltip {
    position: absolute;
    z-index: 8000;
    background: transparent;
}

.Zebra_Tooltip .Zebra_Tooltip_Message {
    position: relative;
    padding: 15px;
    font-size: inherit;
    text-align: left;
    font-weight: normal;
    line-height: inherit;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    *margin-right: 0;
    _width: expression(document.body.clientWidth > 250 ? '250px': 'auto');
    /* max-width for IE6 */
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow {
    position: absolute;
    height: 10px;
    width: 20px;
    overflow: hidden
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Bottom {
    bottom: 0
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Top {
    top: 0
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow div {
    position: absolute;
    border-style: solid;
    border-width: 10px;
    height: 0;
    width: 0;
    left: 0;
    _border-left-color: pink;
    _border-right-color: pink;
    _filter: chroma(color=pink);
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Bottom div {
    top: 0;
    _border-bottom-color: pink;
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Top div {
    bottom: 0;
    _border-top-color: pink;
}

.Zebra_Tooltip .Zebra_Tooltip_Close {
    text-decoration: none;
    color: #FFF;
    position: absolute;
    right: 8px;
    top: 1px;
    font-size: inherit;
    font-weight: bold;
}

.Zebra_Tooltip .Zebra_Tooltip_Close:hover {
    color: #C40000;
}

.tooltips {
    cursor: help;
}

/* ==========================================================================
   Form modern + mobile responsive (light-only — site dùng nhiều màu ngũ
   hành, không phù hợp với browser auto-invert / force-dark trên mobile).
   ========================================================================== */

:root {
    color-scheme: light;
    --c-text: #1f2937;
    --c-muted: #6b7280;
    --c-border: #d1d5db;
    --c-border-strong: #9ca3af;
    --c-bg: #ffffff;
    --c-bg-soft: #f9fafb;
    --c-primary: #2185D0;
    --c-primary-dark: #1678c2;
    --c-accent: #c92424;
}

html {
    background: var(--c-bg);
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
}

/* Masthead — nhỏ gọn trên mobile, rộng rãi trên desktop */
.masthead {
    padding: 1.5rem 1rem 1rem;
}
@media (min-width: 720px) {
    .masthead { padding: 3rem 1rem 1.5rem; }
}

.masthead .wordmark {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}
@media (min-width: 720px) {
    .masthead .wordmark { font-size: 2rem; margin-bottom: 1.5rem; }
}

/* Form container */
.formborder {
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid #f0d9d9;
    border-radius: 14px;
    padding: 18px 16px;
    background: var(--c-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    transition: padding 0.2s ease;
}
@media (min-width: 720px) {
    .formborder { padding: 24px; }
}
/* Desktop ≥1116px: form thẳng hàng với mép trái lá số (vì lá số bên trái,
   sidebar bên phải trong .laso-stage). */
@media (min-width: 1116px) {
    .masthead .container { max-width: 1084px; }
    .formborder { margin-left: 0; margin-right: auto; }
}

/* Form toggle (collapse/expand) — chỉ hiện khi formBox có class .collapsed */
.form-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.form-toggle:hover { background: #f3f4f6; }
.form-toggle:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(33,133,208,0.15); }
.form-toggle-icon {
    font-size: 1.1em;
    color: var(--c-muted);
    transition: transform 0.2s;
}
.formborder.collapsed .form-toggle {
    display: flex;
}
.formborder.collapsed .form-toggle .form-toggle-icon {
    transform: rotate(-90deg);
}
.formborder.collapsed #lstv {
    display: none;
}
.formborder.collapsed {
    padding: 8px;
}

/* Modern form layout — overrides legacy table-grid bên trong form#lstv */
.form-modern {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: left;
    color: var(--c-text);
}
@media (min-width: 600px) {
    .form-modern {
        grid-template-columns: 1fr 1fr;
        gap: 14px 16px;
    }
}
.form-modern .field-full {
    grid-column: 1 / -1;
}
.form-modern .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.form-modern label {
    padding: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

/* Inputs & selects: kích thước tap-friendly (44px), font 16px tránh iOS zoom khi focus */
.form-modern input[type="text"],
.form-modern input[type="number"],
.form-modern select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--c-text);
    background-color: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-modern select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%236b7280' stroke-width='1.8' d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}
.form-modern input::placeholder {
    color: #9ca3af;
}
.form-modern input:focus,
.form-modern select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(33,133,208,0.15);
}
.form-modern input:hover,
.form-modern select:hover {
    border-color: var(--c-border-strong);
}

/* Date row: ngày/tháng/năm */
.form-modern .date-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.4fr;
    gap: 8px;
}

/* Âm lịch checkbox */
.form-modern .amlich-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}
.form-modern .amlich-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--c-primary);
    box-shadow: none;
    padding: 0;
    border-radius: 4px;
}

/* Buttons */
.form-modern .actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.form-modern .actions .button {
    flex: 1;
    margin: 0;
    padding: 13px 18px;
    font-size: 1rem;
    border-radius: 8px;
    min-height: 48px;
}
@media (min-width: 600px) {
    .form-modern .actions {
        justify-content: center;
    }
    .form-modern .actions .button {
        flex: 0 1 200px;
    }
}

/* Lá số scale vừa viewport. JS đo viewport width và set transform: scale()
   trên #laso (xem inline script ở cuối index.html). CSS chỉ lo container. */
.laso-wrap {
    width: 100%;
    margin: 0 auto;
    padding: 0 8px;
    overflow: hidden;
}
@media (min-width: 900px) {
    .laso-wrap {
        padding: 0;
        overflow: visible;
    }
}

/* Stage: chứa lá số + sidebar lá số gần đây.
   Mobile: stack dọc, cả 2 cùng max-width 560px (giống .formborder).
   Desktop ≥ 1116px: cạnh nhau, lá số trái — sidebar phải. */
.laso-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}
@media (min-width: 1116px) {
    .laso-stage {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 24px;
        padding: 0;
        max-width: 1084px;
        margin: 0 auto;
    }
    .laso-stage .laso-wrap {
        width: 800px;
        flex: 0 0 800px;
        padding: 0;
    }
}

/* Sidebar lá số gần đây */
.recent-aside {
    width: calc(100% - 16px);
    max-width: 560px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: var(--c-bg-soft);
    text-align: left;
    color: var(--c-text);
    overflow: hidden;
}
.recent-aside.hidden {
    display: none;
}
@media (min-width: 1116px) {
    .recent-aside {
        width: 260px;
        max-width: 260px;
        flex: 0 0 260px;
        position: sticky;
        top: 16px;
    }
}
.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.recent-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}
.recent-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.recent-empty {
    padding: 16px 8px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--c-muted);
    font-style: italic;
}
.recent-foot {
    padding: 8px 14px 10px;
    font-size: 0.75rem;
    color: var(--c-muted);
    text-align: center;
    border-top: 1px solid #eef0f3;
}

/* Item */
.recent-item {
    display: flex;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background 0.12s, border-color 0.12s;
}
.recent-item:hover {
    background: #fff;
    border-color: #e5e7eb;
}
.recent-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    border-radius: 8px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.recent-main:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(33,133,208,0.25);
}
.recent-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.recent-meta {
    font-size: 0.78rem;
    color: var(--c-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.recent-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 4px;
    flex: 0 0 auto;
}
.recent-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--c-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.recent-btn:hover {
    background: #fff;
    border-color: var(--c-border);
    color: var(--c-text);
}
.recent-delete:hover {
    color: #c62828;
    border-color: #f3c2c2;
}
@media (max-width: 480px) {
    /* Mobile: nút to hơn cho dễ chạm */
    .recent-btn { width: 32px; height: 32px; font-size: 16px; }
    .recent-main { padding: 10px 12px; }
}