/* ==========================================================
   XS3M D1 — "Truyền thống tinh gọn"
   Nạp sau styles.min.css (ketqua.me): ghi đè màu, chữ, viền bảng
   và dựng bố cục trang chủ 3 cột (.d1-home).
   ========================================================== */

:root {
    --d1-red: #B5121B;
    --d1-red-dk: #8C1016;
    --d1-gold: #FFC928;
    --d1-gold-lt: #FFF1C4;
    --d1-paper: #FFF9EC;
    --d1-card: #FFFDF8;
    --d1-tan: #F7EBCB;
    --d1-rule: #CDB47A;
    --d1-rule2: #A0864F;
    --d1-ink: #221A12;
    --d1-ink2: #4E3D22;
    --d1-muted: #5C4A2E;
    --d1-cond: 'Roboto Condensed', Arial, sans-serif;
    --d1-sans: Roboto, Arial, sans-serif;
}

/* ---------- Nền chung ---------- */
html { background: var(--d1-paper); }
body { margin: 0; background: var(--d1-paper); color: var(--d1-ink); font-family: var(--d1-sans); font-size: 15px; line-height: 1.45; }
a { color: var(--d1-red); }
a:hover { color: var(--d1-red-dk); }
:focus-visible { outline: 3px solid var(--d1-ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.d1-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.d1-skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 8px 12px; background: var(--d1-gold); color: var(--d1-ink); font-weight: 700; }
.d1-skip:focus { left: 8px; top: 8px; }

/* styles.min.css đặt màu #222 + Arial thẳng cho span/strong/time…: trong các khung của D1, chữ con lấy màu và font của khung */
.d1-mast *, .d1-nav *, .d1-sched *, .d1-foot *, .d1-bnav *, .d1-tabs *, .d1-card-h *, .d1-page-h * { color: inherit; font-family: inherit; }

@keyframes d1-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Dải đỏ đầu trang ---------- */
.d1-mast { background: var(--d1-red); color: #FFFFFF; }
.d1-mast-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 12px; padding-bottom: 12px; }
.d1-logo { display: flex; flex-direction: row; align-items: center; gap: 12px; color: #FFFFFF; text-decoration: none !important; }
.d1-logo-text { display: flex; flex-direction: column; gap: 7px; }
/* Biểu tượng: 3 viên bi Bắc – Trung – Nam xếp theo dáng chữ S */
.d1-emblem { position: relative; flex: 0 0 auto; width: 50px; height: 70px; }
.d1-emblem span { position: absolute; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px var(--d1-red); color: var(--d1-red-dk); font-family: var(--d1-cond); font-size: 13px; font-weight: 800; line-height: 1; }
.d1-emblem .d1-eb-b { left: 14px; top: 0; background: var(--d1-gold); }
.d1-emblem .d1-eb-t { left: 22px; top: 21px; background: #FFFFFF; }
.d1-emblem .d1-eb-n { left: 6px; top: 42px; background: var(--d1-gold); }
.d1-logo-mark .d1-3 { color: var(--d1-gold); font-size: inherit !important; line-height: inherit; font-weight: inherit; vertical-align: baseline; }
.d1-logo:hover { color: #FFFFFF; }
.d1-logo-mark { display: flex; align-items: center; gap: 0; font-family: var(--d1-cond); font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.d1-logo-sub { font-family: var(--d1-cond); font-size: 12px; font-weight: 700; letter-spacing: 3.4px; text-transform: uppercase; line-height: 1; }
.d1-mast-date { margin: 0; display: flex; flex-direction: column; justify-content: center; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.45); color: #FFFFFF; font-family: var(--d1-cond); line-height: 1.2; }
.d1-mast-date span { font-size: 15px; font-weight: 700; }
.d1-mast-date strong { font-size: 24px; font-weight: 800; }
.d1-mast-date time { font-family: var(--d1-sans); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.d1-mast .header-banner { margin-left: auto; max-width: 728px; }
.d1-mast .header-banner:empty { display: none; }
.d1-mast-dove, .d1-menu-btn { display: none; }

/* ---------- Menu chính ---------- */
.d1-nav { position: relative; z-index: 20; background: var(--d1-red-dk); border-bottom: 3px solid var(--d1-gold); }
.d1-nav-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.d1-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.d1-menu > li { position: relative; margin: 0; padding: 0; list-style: none; }
.d1-menu > li > a { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 13px; color: #FFFFFF; font-family: var(--d1-cond); font-size: 16px; font-weight: 700; text-decoration: none; }
.d1-menu > li > a:hover, .d1-menu > li:focus-within > a { background: rgba(0,0,0,.2); color: #FFFFFF; text-decoration: none; }
.d1-menu > li > a[aria-current], .d1-menu > li.current-menu-item > a { background: var(--d1-paper); color: var(--d1-ink); }
.d1-menu > li.menu-item-has-children > a::after { content: ""; width: 6px; height: 6px; margin: -4px 0 0 4px; border-right: 2px solid var(--d1-gold); border-bottom: 2px solid var(--d1-gold); transform: rotate(45deg); }
.d1-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 200px; margin: 0; padding: 4px 0; list-style: none; background: var(--d1-card); border: 1px solid var(--d1-ink); box-shadow: 0 6px 14px rgba(34,26,18,.22); }
.d1-menu > li:hover > .sub-menu, .d1-menu > li:focus-within > .sub-menu, .d1-menu > li.is-open > .sub-menu { display: block; }
.d1-menu .sub-menu li { margin: 0; padding: 0; list-style: none; }
.d1-menu .sub-menu a { display: block; padding: 7px 14px; color: var(--d1-ink); font-size: 15px; line-height: 20px; text-decoration: none; }
.d1-menu .sub-menu a:hover { background: var(--d1-tan); }
.d1-sub-btn { display: none; }
.d1-nav-dove { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 2px solid var(--d1-gold); color: var(--d1-gold); font-family: var(--d1-cond); font-size: 16px; font-weight: 800; text-decoration: none; }
.d1-nav-dove:hover { background: var(--d1-gold); color: var(--d1-ink); text-decoration: none; }

/* ---------- Lịch quay hôm nay ---------- */
.d1-sched { margin-top: 16px; }
.d1-sched-in { display: flex; flex-wrap: wrap; gap: 1px; background: var(--d1-rule); border: 1px solid var(--d1-rule); }
.d1-sched-h { flex: 1 0 150px; display: flex; align-items: center; margin: 0; padding: 10px 14px; background: var(--d1-tan); font-family: var(--d1-cond); font-size: 18px; line-height: 22px; font-weight: 800; color: var(--d1-ink); }
.d1-sched-cell { flex: 20 1 250px; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--d1-card); }
.d1-sched-time { display: flex; flex-direction: column; gap: 3px; }
.d1-sched-time span { font-family: var(--d1-cond); font-size: 26px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--d1-ink); }
.d1-sched-time small { font-family: var(--d1-cond); font-size: 13px; font-weight: 700; color: var(--d1-muted); white-space: nowrap; }
.d1-sched-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d1-sched-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.d1-sched-name { font-family: var(--d1-cond); font-size: 17px; line-height: 22px; font-weight: 800; color: var(--d1-ink); }
.d1-sched-provs { font-family: var(--d1-cond); font-size: 14px; line-height: 20px; color: var(--d1-ink2); }
.d1-sched-provs a { color: var(--d1-ink2); text-decoration: underline dotted; text-underline-offset: 3px; }
.d1-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; box-sizing: border-box; font-family: var(--d1-cond); font-size: 13px; font-weight: 700; text-decoration: none !important; }
.d1-badge-wait { border: 1px dashed var(--d1-rule2); color: var(--d1-ink2); }
.d1-badge-done { padding: 0; gap: 4px; color: var(--d1-ink); font-size: 14px; font-weight: 800; }
.d1-badge-live { background: #FFFFFF; color: var(--d1-red); font-size: 14px; font-weight: 800; }
.d1-badge-live span { width: 8px; height: 8px; border-radius: 50%; background: var(--d1-red); animation: d1-pulse 1.2s ease-in-out infinite; }
.d1-sched-cell.is-live { background: var(--d1-red); }
.d1-sched-cell.is-live .d1-sched-time span, .d1-sched-cell.is-live .d1-sched-time small,
.d1-sched-cell.is-live .d1-sched-name, .d1-sched-cell.is-live .d1-sched-provs, .d1-sched-cell.is-live .d1-sched-provs a { color: #FFFFFF; }

/* ---------- Bố cục trang chủ ---------- */
.d1-home { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding-top: 16px; padding-bottom: 32px; }
.d1-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.d1-col-l { flex: 1 1 380px; }
.d1-col-r { flex: 2.2 1 756px; }
.d1-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.d1-col-m { flex: 1.2 1 440px; }
.d1-col-s { flex: 1 1 300px; }
.d1-b { min-width: 0; }
.d1-b-intro { flex: 1 1 100%; }
.d1-tabs { display: none; }
.d1-empty { width: 100%; padding: 40px 0; text-align: center; }

/* Thẻ có tiêu đề nền kem đậm */
.d1-card { background: var(--d1-card); border: 1px solid var(--d1-rule); }
.d1-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--d1-tan); border-bottom: 1px solid var(--d1-rule); }
.d1-card-h h2 { margin: 0; font-family: var(--d1-cond); font-size: 17px; line-height: 22px; font-weight: 800; color: var(--d1-ink); }
.d1-card-h span { font-size: 13px; color: var(--d1-muted); }
.d1-card-h span strong { color: var(--d1-ink); }
.d1-card-h a { font-family: var(--d1-cond); font-size: 14px; font-weight: 700; }
.d1-card-more { display: inline-block; margin: 0 12px 12px; font-family: var(--d1-cond); font-size: 14px; font-weight: 700; }

/* ---------- Bảng kết quả (mọi trang) ---------- */
.result-box { margin: 0; background: var(--d1-card); border: 1px solid var(--d1-rule) !important; }
.result-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 12px; text-align: left; background: var(--d1-card); border-bottom: 3px solid var(--d1-red); }
.result-header h1, .result-header h2, .result-header h3 { margin: 0; }
.result-header .title-kq, .result-header .title-kq a, .title-kq a { font-family: var(--d1-cond); font-size: 20px; line-height: 24px; font-weight: 800; color: var(--d1-ink); }
.result-header .title-link-item, .result-header .title-link-item a { margin: 0; font-family: var(--d1-cond); font-size: 14px; line-height: 20px; color: var(--d1-muted); }
.result-box table { border-collapse: collapse; }
.result-box table tr td { height: auto; padding: 3px 2px; border: 1px solid var(--d1-rule); background: var(--d1-card); color: var(--d1-ink); font-variant-numeric: tabular-nums; }
.result-box table tr.bg_f9 td, .bg_f9 { background: var(--d1-card); }
.result-box .first-col, .result-box table tr td.first-col { width: 56px; background: var(--d1-tan); font-family: var(--d1-cond); font-size: 16px !important; font-weight: 700 !important; color: var(--d1-ink2); }
.result-box table tr td span { height: auto; font-size: 24px; line-height: 34px; font-weight: 700; letter-spacing: 1px; }
.result-box td.mb_madb { font-family: var(--d1-cond); font-size: 16px; color: var(--d1-ink2); }
.result-box table tr td.first-col.red { background: var(--d1-red); color: #FFFFFF !important; font-size: 18px !important; font-weight: 800 !important; }
.result-box table tr:has(.mb_g0) td:not(.first-col) { background: var(--d1-gold-lt); }
.result-box table tr td span.mb_g0, .result-box table tr span.mb_g0 { font-size: 48px; line-height: 58px; font-weight: 900; color: var(--d1-red); letter-spacing: 3px; }
.result-box table tr td span.mb_g1 { font-size: 32px; line-height: 40px; }
.result-box tbody td .mb_g71, .result-box tbody td .mb_g72, .result-box tbody td .mb_g73, .result-box tbody td .mb_g74 { color: var(--d1-red); font-size: 28px; font-weight: 800; }

/* Hiển thị Tất cả / 2 số cuối / 3 số cuối */
.control-panel { height: auto; padding: 8px 10px; border-top: 1px solid var(--d1-rule); background: var(--d1-paper); color: var(--d1-ink); }
.table-tructiep .control-panel { border-top: 1px solid var(--d1-rule); }
.control-panel .digits-form { display: flex; flex-wrap: wrap; align-items: center; margin: 0; }
.control-panel .digits-form::before { content: "Hiển thị"; margin-right: 10px; font-family: var(--d1-cond); font-size: 14px; font-weight: 700; color: var(--d1-ink2); }
.digits-form .radio { position: relative; float: none; margin: 0; }
.digits-form .radio input[type=radio] { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.digits-form .radio label { display: inline-flex; align-items: center; height: 40px; margin-left: -1px; padding: 0 12px; border: 1px solid var(--d1-rule2); background: var(--d1-card); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 15px; font-weight: 600; }
.digits-form .radio label::before, .digits-form .radio label::after { display: none; }
.digits-form .radio input:checked + label { position: relative; z-index: 1; background: var(--d1-ink); border-color: var(--d1-ink); color: #FFFFFF; font-weight: 800; }
.digits-form .radio input:focus-visible + label { outline: 3px solid var(--d1-gold); outline-offset: 1px; }

/* Lô tô đầu / đuôi */
.dd-loto-widget { background: var(--d1-card); border: 1px solid var(--d1-rule); }
.d1-b-loto .dd-loto-widget { border: 0; }
.dd-loto-widget table { float: none; height: auto; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dd-loto-widget table th { height: auto; padding: 5px 8px; line-height: 20px; background: var(--d1-tan); border: 1px solid var(--d1-rule); font-family: var(--d1-cond); font-size: 13px; font-weight: 700; color: var(--d1-ink2); }
.dd-loto-widget table tr td { border: 1px solid var(--d1-rule); background: var(--d1-card); }
.dd-loto-widget table tr td.dd-stt { width: 32px; background: var(--d1-tan); font-family: var(--d1-cond); font-size: 16px; font-weight: 800; color: var(--d1-red); }
.dd-loto-widget table tr td.dd-kq { padding: 5px 8px; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--d1-ink); }
.dd-loto-widget .small.red, .dd-loto-widget tr td .red { font-size: 12px; font-weight: 800; color: var(--d1-red); }

/* Thống kê XSMB (30 lần quay) */
.tk-nhanh-40 { margin: 0; background: var(--d1-card); border: 1px solid var(--d1-rule); }
.tk-nhanh-40 .widget-header { padding: 8px 12px; background: var(--d1-tan); border: 0; border-bottom: 1px solid var(--d1-rule); }
.tk-nhanh-40 .widget-header h2 { margin: 0; text-align: left; font-family: var(--d1-cond); font-size: 17px; line-height: 22px; font-weight: 800; color: var(--d1-ink); }
.tk-nhanh-40 .widget-content { border: 0; }
.tk-nhanh-item-header { padding: 7px 12px; background: var(--d1-paper); border: 0; border-bottom: 1px solid var(--d1-rule); font-family: var(--d1-cond); font-size: 15px; line-height: 20px; font-weight: 700; color: var(--d1-ink); }
.tk-nhanh-item-header .red { color: var(--d1-red); font-size: inherit; font-weight: inherit; }
.tk-nhanh-40 table { width: 100%; margin: 0; border-collapse: collapse; }
.tk-nhanh-40 table tr td, .tk-nhanh-40 .tk-nhanh-number { width: auto; height: auto; padding: 7px 2px; border: 1px solid var(--d1-rule) !important; text-align: center; font-family: var(--d1-cond); font-size: 15px; color: var(--d1-ink2); white-space: nowrap; }
.tk-nhanh-40 table tr:first-child td { border-top: 0 !important; }
.tk-nhanh-40 .bold { font-family: var(--d1-sans); font-size: 18px; font-weight: 800; color: var(--d1-ink); }

/* Miền Nam / Miền Trung */
.table-tructiep { margin: 0; background: var(--d1-card); border: 1px solid var(--d1-rule); }
.table-tructiep .table { width: 100%; margin: 0; border-collapse: collapse; }
.table-tructiep .table thead tr th { padding: 8px 4px; background: var(--d1-tan); border: 1px solid var(--d1-rule); font-family: var(--d1-cond); font-size: 16px; font-weight: 800; color: var(--d1-ink); }
.table-tructiep .table thead tr th a { font-family: var(--d1-cond); font-size: 16px; color: var(--d1-red); text-decoration: none; }
.table-tructiep .table thead tr th:first-child { width: 52px; color: var(--d1-ink2); }
.table-tructiep .table tr td { border: 1px solid var(--d1-rule); background: var(--d1-card); }
.table-tructiep .table tr.bg_f9 td { background: var(--d1-card); }
.table-tructiep .table tr td.first-col { background: var(--d1-tan); font-family: var(--d1-cond); font-size: 15px; font-weight: 700 !important; color: var(--d1-ink2); }
.table-tructiep .table tr td .number { height: auto; padding: 1px 0; line-height: 30px; font-size: 22px; font-weight: 700; color: var(--d1-ink); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.table-tructiep table .xstn_g8 { color: var(--d1-red) !important; font-size: 28px !important; font-weight: 800; }
.table-tructiep .table tr.gdb td { background: var(--d1-gold-lt); }
.table-tructiep .table tr.gdb td.first-col { background: var(--d1-red); color: #FFFFFF; font-weight: 800 !important; }
.table-tructiep .table tr.gdb td .number { font-size: 28px; font-weight: 900; color: var(--d1-red); }
.d1-home .loto-tructiep { display: none; }
.d1-home .xo_so_mien { margin: 0; }

/* Điện toán */
.dientoan .result-header { border-bottom-width: 1px; }
.dientoan table tr td { height: auto; padding: 4px 2px; line-height: 30px; font-size: 22px; }
.dientoan .th-dientoan, .dientoan .th-dientoan a { font-family: var(--d1-cond); font-size: 14px; color: var(--d1-ink2); }

/* Tiêu đề widget dùng chung */
.widget-header-item { padding: 8px 12px; background: var(--d1-tan); border-bottom: 1px solid var(--d1-rule); }
.widget-header-item h3, .widget-header-item h3 a { margin: 0; text-align: left; font-family: var(--d1-cond); font-size: 17px; line-height: 22px; font-weight: 800; color: var(--d1-ink); }

/* ---------- Cột phải ---------- */
/* Dò vé */
.d1-dove-form { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 8px 10px; margin: 0; padding: 12px; }
.d1-dove-form label { font-family: var(--d1-cond); font-size: 15px; font-weight: 700; color: var(--d1-ink); }
.d1-dove-form select { width: 100%; height: 40px; padding: 0 8px; border: 1px solid var(--d1-rule2); border-radius: 0; background: #FFFFFF; color: var(--d1-ink); font-family: var(--d1-sans); font-size: 15px; }
.d1-dove-form input { width: 100%; height: 44px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--d1-ink); border-radius: 0; background: #FFFFFF; color: var(--d1-ink); font-family: var(--d1-sans); font-size: 22px; font-weight: 700; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.d1-dove-form button { grid-column: 1 / -1; height: 44px; border: 1px solid var(--d1-ink); background: var(--d1-gold); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 17px; font-weight: 800; cursor: pointer; }
.d1-dove-out { padding: 0 12px 10px; font-size: 14px; line-height: 20px; color: var(--d1-ink2); }
.d1-dove-out p { margin: 6px 0 0; }
.d1-dove-res { border: 1px solid var(--d1-ink); background: var(--d1-card); }
.d1-dove-res-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 10px; background: var(--d1-gold); color: var(--d1-ink); }
.d1-dove-res-h b { font-family: var(--d1-cond); font-size: 17px; font-weight: 800; }
.d1-dove-group { padding: 4px 10px 8px; border-top: 1px solid var(--d1-rule); }
.d1-dove-group b { display: block; font-family: var(--d1-cond); font-size: 15px; line-height: 26px; font-weight: 800; color: var(--d1-red); }
.d1-dove-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 24px; color: var(--d1-ink); }
.d1-dove-row span:last-child { font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.d1-dove-miss { padding: 8px 10px; border: 1px dashed var(--d1-rule2); }
.d1-hit { background: var(--d1-gold) !important; color: var(--d1-ink) !important; box-shadow: 0 0 0 2px var(--d1-ink); border-radius: 2px; }
.d1-part { background: var(--d1-gold-lt) !important; box-shadow: inset 0 -3px 0 var(--d1-ink); }

/* Vietlott (khối Mega / Power lấy từ ketqua.me) */
.d1-b-vl .vl-box { margin: 0; padding: 12px; background: transparent; border: 0 !important; border-bottom: 1px solid var(--d1-rule) !important; }
.d1-b-vl .vl-box:last-child { border-bottom: 0 !important; }
.d1-b-vl .title-vietlott { margin: 0; padding: 0; text-align: left; }
.d1-b-vl .title-vietlott a { font-family: var(--d1-cond); font-size: 18px; font-weight: 800; color: var(--d1-ink); }
.d1-b-vl .clear, .d1-b-vl .mega645-wins, .d1-b-vl .line-power { display: none; }
.d1-b-vl .mega-content { display: flex; flex-direction: column; }
.d1-b-vl .draw-info { order: 1; margin: 2px 0 0; text-align: left; font-size: 13px; color: var(--d1-muted); }
.d1-b-vl .draw-info .red { color: var(--d1-ink); font-weight: 700; }
.d1-b-vl .mega645-result { order: 2; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; text-align: left; }
.d1-b-vl .jackpot_info { order: 3; padding: 8px 0 0; border-top: 1px dashed var(--d1-rule); text-align: left; font-size: 13px; color: var(--d1-muted); }
.d1-b-vl .jackpot-amount-box { order: 4; width: auto; margin: 0; padding: 0; border: 0; border-radius: 0; text-align: left; font-family: var(--d1-cond); font-size: 25px; line-height: 30px; font-weight: 800; color: var(--d1-red); }
.d1-b-vl .mega645-item, .d1-b-vl .power-item { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--d1-red); background: #FFFFFF !important; color: var(--d1-ink) !important; font-size: 16px; line-height: 1; font-weight: 700; }
.d1-b-vl .power-item { border-color: var(--d1-ink); }
.d1-b-vl .power-item.power-7 { background: var(--d1-red) !important; color: #FFFFFF !important; }

/* KQXS theo tỉnh */
.widget-tinh { background: var(--d1-card); border: 1px solid var(--d1-rule); }
.widget-tinh .widget-content { padding: 0; border: 0; }
.widget-tinh ul.sub-content { margin: 0; padding: 0; list-style: none; }
.widget-tinh ul.sub-content > li { margin: 0; padding: 0; line-height: normal; border-top: 1px solid var(--d1-rule); list-style: none; }
.widget-tinh ul.sub-content > li:first-child { border-top: 0; }
.widget-tinh .widget-content ul.sub-content li a::before, .widget-tinh .widget-content ul.sub-content li span::before { display: none; }
.widget-tinh ul.sub-content > li > a, .d1-prov-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box; border: 0; background: none; font-family: var(--d1-cond); font-size: 16px; font-weight: 700; color: var(--d1-ink); text-align: left; text-decoration: none; cursor: pointer; }
.d1-prov-btn small { font-family: var(--d1-sans); font-size: 14px; font-weight: 400; color: var(--d1-muted); }
.d1-prov-btn::after, .widget-tinh ul.sub-content > li > a::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-right: 2.5px solid var(--d1-red); border-bottom: 2.5px solid var(--d1-red); transform: rotate(45deg); margin-top: -4px; }
.widget-tinh ul.sub-content > li > a::after { transform: rotate(-45deg); margin-top: 0; }
.widget-tinh li.is-open > .d1-prov-btn::after { transform: rotate(225deg); margin-top: 4px; }
.widget-tinh i.fa { display: none; }
.widget-tinh ul.level3 { display: none; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--d1-rule); border-top: 1px solid var(--d1-rule); }
.widget-tinh li.is-open > ul.level3 { display: grid; }
.widget-tinh ul.level3 li { margin: 0; padding: 0; background: var(--d1-card); list-style: none; line-height: normal; }
.widget-tinh .widget-content ul.sub-content ul.level3 li a { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: auto; min-height: 36px; padding: 0 10px; color: var(--d1-ink); font-size: 14px; font-weight: 400; }
.widget-tinh ul.level3 li.d1-today a::after { content: "Hôm nay"; padding: 0 5px; background: var(--d1-gold); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 12px; line-height: 18px; font-weight: 800; }

/* Tra cứu nhanh */
.d1-tc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--d1-rule); }
.d1-tc-grid a { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 40px; padding: 0 10px; background: var(--d1-card); color: var(--d1-ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.d1-tc-grid a svg { color: var(--d1-red); }
.d1-tc-grid a:hover { background: var(--d1-tan); }

/* Bài viết mới (widget WordPress) */
.widget-hq .widget-header-item { border-bottom: 1px solid var(--d1-rule); }
.widget-hq .widget-content { padding: 0; border: 0; }
.widget-hq ul { margin: 0; padding: 0; list-style: none; }
.widget-hq li { margin: 0; padding: 8px 12px; border-top: 1px solid var(--d1-rule); line-height: 20px; list-style: none; }
.widget-hq li:first-child { border-top: 0; }
.widget-hq li a { color: var(--d1-ink); font-size: 14px; }

/* Kết quả theo thứ */
.d1-thu-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--d1-rule); font-family: var(--d1-cond); }
.d1-thu-grid > * { display: flex; align-items: center; justify-content: center; height: 36px; background: var(--d1-card); color: var(--d1-ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.d1-thu-grid .d1-thu-lab { background: var(--d1-tan); font-size: 14px; font-weight: 800; }
.d1-thu-grid a:hover { background: var(--d1-tan); text-decoration: none; }
.d1-thu-grid a.is-today { background: var(--d1-ink); color: #FFFFFF; font-weight: 800; }

/* Thống kê loto (dưới cột giữa + cột phải) */
.d1-b-tkl .widget { margin: 0; background: var(--d1-card); border: 1px solid var(--d1-rule); }
.d1-b-tkl .widget-content { padding: 0; border: 0; }
.d1-b-tkl ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--d1-rule); }
.d1-b-tkl li { margin: 0; padding: 0; background: var(--d1-card); line-height: normal; list-style: none; }
.d1-b-tkl .widget-content ul li a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; color: var(--d1-ink); font-size: 15px; text-decoration: none; }
.d1-b-tkl .widget-content ul li a:hover { background: var(--d1-tan); }
.d1-b-tkl .widget-content ul li .a-item::before { position: static; flex: 0 0 auto; width: 6px; height: 6px; margin: 0; background: var(--d1-red); }

/* Giới thiệu */
.d1-b-intro { padding: 14px 16px; background: var(--d1-card); border: 1px solid var(--d1-rule); font-size: 14px; line-height: 21px; color: var(--d1-ink2); }
.d1-b-intro h2 { margin: 0 0 6px; font-family: var(--d1-cond); font-size: 17px; font-weight: 800; color: var(--d1-ink); }
.d1-b-intro p { margin: 0 0 6px; }

/* Lịch mở thưởng + câu hỏi thường gặp (trang chủ) */
.d1-b-lich, .d1-b-faq { flex: 1 1 100%; }
.d1-lich-wrap { overflow-x: auto; }
.d1-lich-t { width: 100%; margin: 0; table-layout: fixed; border-collapse: collapse; background: var(--d1-card); font-size: 15px; line-height: 21px; }
.d1-lich-t th, .d1-lich-t td { padding: 8px 12px; border: 0; border-bottom: 1px solid var(--d1-rule); background: transparent; text-align: left; vertical-align: top; }
.d1-lich-t thead th { font-family: var(--d1-cond); font-size: 16px; font-weight: 800; color: var(--d1-ink); }
.d1-lich-t thead th:first-child { width: 120px; }
.d1-lich-t thead th a { color: var(--d1-ink); font-family: var(--d1-cond); font-size: 16px; font-weight: 800; }
.d1-lich-t small { font-family: var(--d1-cond); font-size: 13px; font-weight: 700; color: var(--d1-red); }
.d1-lich-t tbody th { width: 120px; font-family: var(--d1-cond); font-size: 16px; font-weight: 800; color: var(--d1-ink); white-space: nowrap; }
.d1-lich-t td a, .d1-lich-t td span { display: inline-block; margin: 0 16px 0 0; color: var(--d1-red); font-family: var(--d1-sans); font-size: 15px; font-weight: 500; }
.d1-lich-t tr.is-today th, .d1-lich-t tr.is-today td { background: var(--d1-gold-lt); }
.d1-lich-t tbody tr:last-child th, .d1-lich-t tbody tr:last-child td { border-bottom: 0; }
.d1-lich-note { margin: 0; padding: 8px 12px; border-top: 1px solid var(--d1-rule); font-size: 13px; line-height: 19px; color: var(--d1-muted); }
.d1-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--d1-rule); }
.d1-faq-i { padding: 12px 14px; background: var(--d1-card); }
.d1-faq-i h3 { margin: 0 0 4px; font-family: var(--d1-cond); font-size: 16px; line-height: 21px; font-weight: 800; color: var(--d1-ink); }
.d1-faq-i p { margin: 0; font-size: 14px; line-height: 21px; color: var(--d1-ink2); }
.d1-faq-i:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Chân trang ---------- */
.d1-foot { background: var(--d1-red-dk); border-top: 3px solid var(--d1-gold); color: #FFE9A8; }
.d1-foot-in { display: flex; flex-wrap: wrap; gap: 20px 32px; padding-top: 24px; padding-bottom: 16px; }
.d1-foot-about { flex: 2 1 360px; font-size: 14px; line-height: 21px; }
.d1-foot-about p { margin: 8px 0 0; }
.d1-foot a { color: #FFFFFF; }
.d1-foot-nav { flex: 1 1 150px; }
.d1-foot-nav h2 { margin: 0 0 8px; font-family: var(--d1-cond); font-size: 16px; font-weight: 800; color: var(--d1-gold); }
.d1-foot-nav ul { margin: 0; padding: 0; list-style: none; }
.d1-foot-nav li { margin: 0; line-height: 30px; list-style: none; }
.d1-foot-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 14px; border-top: 1px solid rgba(255,233,168,.3); font-size: 13px; }
.d1-logo-sm { gap: 8px; }
.d1-logo-sm .d1-logo-mark { font-size: 34px; }
.d1-logo-sm .d1-emblem { width: 34px; height: 48px; }
.d1-logo-sm .d1-emblem span { width: 19px; height: 19px; font-size: 9px; box-shadow: 0 0 0 1.5px var(--d1-red-dk); }
.d1-logo-sm .d1-emblem .d1-eb-b { left: 10px; top: 0; } .d1-logo-sm .d1-emblem .d1-eb-t { left: 15px; top: 14px; } .d1-logo-sm .d1-emblem .d1-eb-n { left: 4px; top: 29px; }

/* ---------- Trang con: nội dung bên trái, cột thẻ D1 bên phải ---------- */
.main { width: auto; max-width: none; margin: 0; padding: 0; background: transparent; }
.main .main-content { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 16px; align-items: start; width: auto; max-width: 1240px; margin: 0 auto; padding: 4px 20px 32px; box-sizing: border-box; }
.main .main-content > * { grid-column: 1 / -1; min-width: 0; }
.main .main-content > .content-left, .main .main-content > .d1-page-main { grid-column: 1; float: none; width: auto; margin: 0; padding: 0; }
.main .main-content > .d1-page-side, .main .main-content > .main-right { grid-column: 2; float: none; width: auto; margin: 0; padding: 0; }
.main .main-content > .clear { display: none; }
.d1-page-main .content-left, .d1-page-main .main-left { float: none; width: auto; margin: 0; padding: 0; }
/* Một số trang ketqua.me đặt rộng cố định theo id (#left-big 645px, #right-lt-tk …): cho co giãn theo cột */
.d1-page-main > *, .d1-page-side > * { float: none !important; width: auto !important; max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }
.d1-page-side { display: flex; flex-direction: column; gap: 16px; }
.d1-page-side .tk-loto { display: flex; flex-direction: column; gap: 16px; padding: 0; border: 0; background: none; }
.d1-page-side .main-center, .d1-page-side .main-right { float: none; width: auto; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.d1-page-side .widget, .d1-page-side .widget-tinh, .d1-page-side .widget-hq { margin: 0; background: var(--d1-card); border: 1px solid var(--d1-rule); }
.d1-page-side .widget .widget-content { padding: 0; border: 0; }
.d1-page-side .widget .widget-content ul { margin: 0; padding: 0; list-style: none; }
.d1-page-side .widget .widget-content li { margin: 0; padding: 0; border-top: 1px solid var(--d1-rule); line-height: normal; list-style: none; }
.d1-page-side .widget .widget-content li:first-child { border-top: 0; }
.d1-page-side .widget .widget-content ul li a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; color: var(--d1-ink); font-size: 15px; text-decoration: none; }
.d1-page-side .widget .widget-content ul li a:hover { background: var(--d1-tan); }
.d1-page-side .widget .widget-content ul li .a-item::before, .d1-page-side .widget .widget-content ul li .text-black-bold::before { position: static; flex: 0 0 auto; width: 6px; height: 6px; margin: 0; background: var(--d1-red); }

/* Breadcrumb + tiêu đề trang */
.breadcrumbs { margin: 12px 0 0; padding: 0; background: none; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; background: none; font-size: 13px; line-height: 20px; color: var(--d1-muted); }
.breadcrumb li { margin: 0; padding: 0; list-style: none; color: var(--d1-muted); }
.breadcrumb li + li::before { content: "›" !important; padding: 0 6px; color: var(--d1-rule2); }
.breadcrumb a, .breadcrumb a span { color: var(--d1-muted); }
.d1-page-title { margin: 6px 0 14px !important; padding: 0 0 8px; border-bottom: 3px solid var(--d1-red); text-align: left !important; font-family: var(--d1-cond); font-size: 26px !important; line-height: 32px; font-weight: 800; color: var(--d1-ink) !important; }

/* ---------- Thành phần của ketqua.me trong nội dung trang con ---------- */
/* Tiêu đề trùng với tiêu đề trang (template đã in) */
.d1-page-main .main-title { display: none; }
/* Thanh tiêu đề khối: đỏ / xanh đậm cũ → nền kem đậm, chữ đen */
.d1-page-main .header-title, .d1-page-main .header-title-blue, .d1-page-main .widget-header, .d1-page-main .widget-skq .list-link { margin: 0; padding: 8px 12px; background: var(--d1-tan) !important; border: 1px solid var(--d1-rule); border-bottom: 0; color: var(--d1-ink); text-align: left; }
.d1-page-main .header-title .title-text, .d1-page-main .header-title-blue .title-text, .d1-page-main .widget-header h2, .d1-page-main .widget-header h3, .d1-page-main .widget-header .title-ds-gan, .d1-page-main .widget-skq .list-link, .d1-page-main .widget-skq .list-link a { margin: 0; padding: 0; background: none; text-align: left; font-family: var(--d1-cond); font-size: 17px; line-height: 22px; font-weight: 800; color: var(--d1-ink) !important; }
.d1-page-main .widget-header-hr { display: none; }
/* Khung form tìm kiếm */
.d1-page-main .border-red { margin: 0 0 12px; padding: 12px; background: var(--d1-card); border: 1px solid var(--d1-rule) !important; }
.d1-page-main .form-group .label, .d1-page-main .label { display: block; margin: 0 0 4px; padding: 0; background: none; font-family: var(--d1-cond); font-size: 15px; font-weight: 700; color: var(--d1-ink); text-align: left; }
.d1-page-main .form-control { height: 44px; padding: 0 10px; border: 1px solid var(--d1-rule2); border-radius: 0; background: #FFFFFF; color: var(--d1-ink); font-family: var(--d1-sans); font-size: 15px; box-shadow: none; }
.d1-page-main .form-control:focus { border-color: var(--d1-ink); outline: none; }
.d1-page-main .btn, .d1-page-main .btn-inline-default { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 1px solid var(--d1-ink); border-radius: 0; background: var(--d1-gold); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 16px; font-weight: 800; cursor: pointer; text-decoration: none; }
.d1-page-main .btn:hover, .d1-page-main .btn-inline-default:hover { background: #FFD95A; color: var(--d1-ink); }
/* Nhóm nút 10 / 20 / 30 ngày… */
.d1-page-main .btn-group-skq { display: flex; flex-wrap: wrap; margin: 8px 0; }
.d1-page-main .btn-xsmb, .d1-page-main .btn-info { flex: 1 1 60px; height: 40px; margin: 0 0 0 -1px; padding: 0 10px; border: 1px solid var(--d1-rule2); border-radius: 0; background: var(--d1-card); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.d1-page-main .btn-xsmb.active, .d1-page-main .btn-info.active { position: relative; z-index: 1; background: var(--d1-ink); border-color: var(--d1-ink); color: #FFFFFF; }
.d1-page-main .btn-xsmb .dskq, .d1-page-main .btn-info .dskq { color: inherit; margin-left: 3px; }
/* Dòng ghi chú dưới form */
.d1-page-main .action { margin: 0 0 12px; padding: 8px 12px; background: var(--d1-paper); border: 1px solid var(--d1-rule); }
.d1-page-main .icon-note, .d1-page-main .icon-note a { color: var(--d1-ink2); font-size: 14px; }
/* Hàng chọn thứ (XSMB | Thứ 2 | …) và tab Vietlott */
.d1-page-main .menu-diw-desktop { margin: 0 0 12px; }
.d1-page-main .menu-diw-desktop ul.navbar-nav { display: flex; flex-wrap: wrap; gap: 1px; margin: 0; padding: 0; background: var(--d1-rule); border: 1px solid var(--d1-rule); list-style: none; }
.d1-page-main .menu-diw-desktop ul.navbar-nav li { flex: 1 1 90px; float: none; width: auto; margin: 0; padding: 0; background: var(--d1-card); list-style: none; }
.d1-page-main .menu-diw-desktop ul.navbar-nav li a { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 6px; border: 0; background: none; color: var(--d1-ink); font-family: var(--d1-cond); font-size: 15px; font-weight: 700; text-decoration: none; }
.d1-page-main .menu-diw-desktop ul.navbar-nav li a:hover { background: var(--d1-tan); }
.d1-page-main .menu-diw-desktop ul.navbar-nav li.active, .d1-page-main .menu-diw-desktop ul.navbar-nav li.active a { background: var(--d1-ink); color: #FFFFFF; }
.d1-page-main .link-loto { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 10px; }
.d1-page-main .link-loto a { font-family: var(--d1-cond); font-size: 15px; font-weight: 700; color: var(--d1-red); }
/* Tiêu đề trong khung kết quả của trang con */
.d1-page-main .result-header h1, .d1-page-main .result-header h2, .d1-page-main .result-header h1 a, .d1-page-main .result-header h2 a, .d1-page-main .result-header .title-a { font-family: var(--d1-cond); font-size: 20px; line-height: 24px; font-weight: 800; color: var(--d1-ink) !important; }
.d1-page-main .result-box, .d1-page-main .xo_so_mien, .d1-page-main .widget { margin-bottom: 12px; }
/* Bảng thống kê chung */
.d1-page-main .table { width: 100%; border-collapse: collapse; background: var(--d1-card); }
.d1-page-main .table tr th, .d1-page-main .table thead tr th, .d1-page-main .table tr td { border: 1px solid var(--d1-rule); }
.d1-page-main .table tr th, .d1-page-main .table thead tr th { padding: 6px 4px; background: var(--d1-tan); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 15px; font-weight: 800; }
.d1-page-main .table tr:nth-child(2n) { background: transparent; }
.d1-page-main .blue, .d1-page-main .text-blue { color: var(--d1-ink2) !important; }
.d1-page-main .dau-loto, .d1-page-main .dd-loto-widget table th { background: var(--d1-tan); color: var(--d1-ink2); }
.d1-page-main th, .d1-page-main th a { color: var(--d1-ink); }
/* Vietlott (trang con): cùng kiểu với trang chủ */
.d1-page-main .vl-box .jackpot-amount-box { width: auto; max-width: 380px; margin: 8px auto; padding: 8px 16px; border: 1px solid var(--d1-rule); border-radius: 0; background: var(--d1-gold-lt) !important; color: var(--d1-red) !important; font-family: var(--d1-cond); font-size: 28px; line-height: 34px; font-weight: 800; box-shadow: none; }
.d1-page-main .vl-box .jackpot_info, .d1-page-main .vl-box .draw-info { color: var(--d1-ink2); }
.d1-page-main .mega645-item, .d1-page-main .power-item { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 3px; padding: 0; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--d1-red); background: #FFFFFF !important; color: var(--d1-ink) !important; font-size: 20px; line-height: 1; font-weight: 800; }
.d1-page-main .power-item { border-color: var(--d1-ink); }
.d1-page-main .power-item.power-7 { background: var(--d1-red) !important; color: #FFFFFF !important; }
.d1-page-main .line-power { display: inline-block; width: 2px; height: 34px; margin: 0 6px; background: var(--d1-rule2); vertical-align: middle; }
.d1-page-main .mega645-wins table th { padding: 6px 8px; background: var(--d1-tan); border: 1px solid var(--d1-rule); font-family: var(--d1-cond); font-size: 15px; font-weight: 800; text-align: left; }
.d1-page-main .mega645-wins .circle-num i { border-color: var(--d1-ink2); }
/* Danh sách bài (sổ mơ, tin tức) */
.d1-page-main .news-lists { display: flex; flex-direction: column; background: var(--d1-card); border: 1px solid var(--d1-rule); }
.d1-page-main .news-item { display: flex; gap: 12px; margin: 0; padding: 12px; border-top: 1px solid var(--d1-rule); }
.d1-page-main .news-item:first-child { border-top: 0; }
.d1-page-main .news-item .thumbnail { flex: 0 0 120px; margin: 0; }
.d1-page-main .news-item .thumbnail img { width: 120px; height: 80px; object-fit: cover; border: 1px solid var(--d1-rule); }
.d1-page-main .news-item .info { flex: 1 1 auto; min-width: 0; }
.d1-page-main .news-item .title { margin: 0 0 4px; font-family: var(--d1-cond); font-size: 18px; line-height: 23px; font-weight: 800; }
.d1-page-main .news-item .title a { color: var(--d1-ink); }
.d1-page-main .news-item .des { font-size: 14px; line-height: 20px; color: var(--d1-ink2); }
.d1-page-main .pagination, .content-left .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 12px 0; }
.content-left .pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--d1-rule2); background: var(--d1-card); color: var(--d1-ink); font-family: var(--d1-cond); font-weight: 700; text-decoration: none; }
.content-left .pagination .page-numbers.current { background: var(--d1-ink); border-color: var(--d1-ink); color: #FFFFFF; }
/* Bài viết / trang tĩnh */
.content-left .article-content { padding: 16px 18px; background: var(--d1-card); border: 1px solid var(--d1-rule); font-size: 16px; line-height: 1.65; color: var(--d1-ink); }
.content-left .article-content h2, .content-left .article-content h3 { font-family: var(--d1-cond); font-weight: 800; color: var(--d1-ink); }
.content-left .seo-content { margin-top: 16px; padding: 14px 16px; background: var(--d1-card); border: 1px solid var(--d1-rule); font-size: 14px; line-height: 1.7; color: var(--d1-ink2); }
.content-left .seo-content h2 { margin: 0 0 8px; font-family: var(--d1-cond); font-size: 17px; font-weight: 800; color: var(--d1-ink); }

/* ---------- Ghi đè các luật cụ thể hơn trong styles.min.css ---------- */
.d1-home .result-header { background: var(--d1-card) !important; }
.title-link-item a::before, .title-link-item a::after { content: none !important; }
.widget-header-item { margin: 0; padding: 8px 12px !important; background: var(--d1-tan) !important; border: 0; border-bottom: 1px solid var(--d1-rule); }
.widget-header-item h3, .widget-header-item h3 a { margin: 0; text-align: left !important; color: var(--d1-ink) !important; font-family: var(--d1-cond); font-size: 17px !important; line-height: 22px; font-weight: 800; }
.widget-content { border-color: var(--d1-rule); background: var(--d1-card); }
.d1-home .tk-nhanh-40 .tk-nhanh-item-header { background: var(--d1-paper) !important; border: 0 !important; border-bottom: 1px solid var(--d1-rule) !important; }
.d1-b-vl .title-vietlott { background: none !important; border: 0 !important; }
.d1-b-vl .jackpot-amount-box { background: none !important; box-shadow: none !important; color: var(--d1-red) !important; }
.d1-b-vl .jackpot_info, .d1-b-vl .jackpot-amount-box { order: 3; }
.d1-b-vl .jackpot_info ~ .jackpot_info { border-top: 0; }
.widget-hq .widget-content-menu { padding-left: 0; }
.widget-hq li::before, .widget-hq li a::before { display: none !important; }
.widget-tinh .widget-content ul.sub-content li .d1-prov-btn span { width: auto !important; padding: 0 !important; color: inherit !important; }
.d1-foot p, .d1-foot span, .d1-foot li { color: #FFE9A8; }
.d1-foot .d1-logo-mark { color: #FFFFFF; }
.d1-foot .d1-emblem span { color: var(--d1-red-dk); }

/* Thanh điều hướng đáy (điện thoại) */
.d1-bnav { display: none; }


/* Trang con dưới 960px: cột phải xuống dưới nội dung */
@media (max-width: 959px) {
    .main .main-content { grid-template-columns: minmax(0, 1fr); }
    .main .main-content > .d1-page-side, .main .main-content > .main-right { grid-column: 1; margin-top: 16px; }
}

/* ==========================================================
   Điện thoại (< 768px)
   ========================================================== */
@media (max-width: 767px) {
    .d1-wrap { padding: 0 10px; }

    .d1-mast-in { flex-wrap: nowrap; gap: 8px; padding-top: 6px; padding-bottom: 6px; }
    .d1-logo { gap: 6px; flex: 0 0 auto; }
    .d1-logo-mark { font-size: 28px; }
    .d1-emblem { width: 30px; height: 44px; }
    .d1-emblem span { width: 18px; height: 18px; font-size: 9px; box-shadow: 0 0 0 1.5px var(--d1-red); }
    .d1-emblem .d1-eb-b { left: 8px; top: 0; } .d1-emblem .d1-eb-t { left: 13px; top: 13px; } .d1-emblem .d1-eb-n { left: 3px; top: 26px; }
    .d1-logo-sub { display: none; }
    .d1-mast-date { flex: 1 1 auto; min-width: 0; padding-left: 8px; }
    .d1-mast-date span { font-size: 12px; }
    .d1-mast-date strong { font-size: 15px; }
    .d1-mast-date time { font-size: 14px; }
    .d1-mast .header-banner { display: none; }
    .d1-mast-dove { display: inline-flex; align-items: center; flex: 0 0 auto; height: 36px; padding: 0 10px; background: var(--d1-gold); color: var(--d1-ink); font-family: var(--d1-cond); font-size: 15px; font-weight: 800; text-decoration: none; }
    .d1-menu-btn { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #FFFFFF; cursor: pointer; }

    .d1-nav { display: none; }
    .d1-nav.is-open { display: block; }
    .d1-nav-in { display: block; padding: 0; }
    .d1-menu { display: block; }
    .d1-menu > li { border-bottom: 1px solid rgba(255,255,255,.15); }
    .d1-menu > li > a { height: 48px; padding: 0 16px; }
    .d1-menu > li.menu-item-has-children > a::after { display: none; }
    .d1-menu > li:hover > .sub-menu, .d1-menu > li:focus-within > .sub-menu { display: none; }
    .d1-menu > li.is-open > .sub-menu { display: grid; }
    .d1-menu .sub-menu { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; padding: 0; border: 0; box-shadow: none; }
    .d1-menu .sub-menu a { padding: 12px 16px; }
    .d1-sub-btn { display: flex; align-items: center; justify-content: center; position: absolute; right: 0; top: 0; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; color: var(--d1-gold); cursor: pointer; }
    .d1-menu > li.is-open > .d1-sub-btn svg { transform: rotate(180deg); }
    .d1-nav-dove { display: none; }

    .d1-sched { display: none; }

    .d1-home { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; padding-top: 0; padding-bottom: 16px; }
    .d1-col, .d1-row { display: contents; }
    .d1-tabs { order: 0; position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 -10px; background: var(--d1-rule); border-bottom: 1px solid var(--d1-rule); }
    .d1-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; padding: 0 4px; border: 0; border-top: 3px solid transparent; background: var(--d1-tan); color: var(--d1-ink); font-family: var(--d1-cond); cursor: pointer; }
    .d1-tabs button strong { font-size: 16px; font-weight: 800; }
    .d1-tabs button small { font-size: 12px; font-weight: 700; color: var(--d1-ink2); }
    .d1-tabs button[aria-pressed="true"] { background: var(--d1-card); border-top-color: var(--d1-red); }
    .d1-tabs button.is-live small { color: var(--d1-red); }

    /* Thứ tự khối trên điện thoại; miền được chọn (data-focus) lên đầu */
    .d1-b-xsmb { order: 10; } .d1-b-loto { order: 11; } .d1-b-tk { order: 12; }
    .d1-b-xsmn { order: 30; } .d1-b-xsmt { order: 40; } .d1-b-dt { order: 45; }
    .d1-b-dove { order: 50; } .d1-b-vl { order: 60; } .d1-b-thu { order: 65; }
    .d1-b-tinh { order: 70; } .d1-b-tkl { order: 75; } .d1-b-tc { order: 80; }
    .widget-hq { order: 85; } .d1-b-lich { order: 87; } .d1-b-faq { order: 88; } .d1-b-intro { order: 90; }
    .d1-home[data-focus="mn"] .d1-b-xsmn { order: 5; }
    .d1-home[data-focus="mt"] .d1-b-xsmt { order: 5; }

    .result-box .first-col, .result-box table tr td.first-col { width: 44px; }
    .result-box table tr td span { font-size: 21px; line-height: 30px; }
    .result-box table tr td span.mb_g0, .result-box table tr span.mb_g0 { font-size: 42px; line-height: 50px; }
    .result-box table tr td span.mb_g1 { font-size: 28px; line-height: 36px; }
    .result-box tbody td .mb_g71, .result-box tbody td .mb_g72, .result-box tbody td .mb_g73, .result-box tbody td .mb_g74 { font-size: 26px; }
    .table-tructiep .table thead tr th { font-size: 15px; }
    .table-tructiep .table thead tr th:first-child { width: 40px; }
    .table-tructiep .table tr td .number { font-size: 20px; line-height: 28px; letter-spacing: 0; }
    .table-tructiep table .xstn_g8 { font-size: 26px !important; }
    .table-tructiep .table tr.gdb td .number { font-size: 22px; }
    .tk-nhanh-40 table tr td, .tk-nhanh-40 .tk-nhanh-number { padding: 6px 1px; font-size: 13px; }
    .tk-nhanh-40 .bold { font-size: 17px; }
    .d1-thu-grid { grid-template-columns: 48px repeat(7, minmax(0, 1fr)); }
    .d1-thu-grid > * { height: 44px; }
    .d1-tc-grid a, .d1-b-tkl .widget-content ul li a, .widget-tinh .widget-content ul.sub-content ul.level3 li a { min-height: 44px; }
    .d1-b-tkl ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .d1-b-tkl li:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .d1-b-tkl .widget-content ul li a { gap: 8px; padding: 4px 10px; font-size: 14px; line-height: 18px; }
    .control-panel .digits-form::before { display: none; }
    .digits-form .radio label { height: 44px; }

    .d1-page-main .form-group { float: none; width: auto !important; margin: 0 0 10px; }
    .d1-page-main .btn-inline-default { width: 100%; float: none; }
    .d1-page-main .news-item .thumbnail { flex-basis: 96px; }
    .d1-page-main .news-item .thumbnail img { width: 96px; height: 64px; }
    .d1-page-title { font-size: 22px !important; line-height: 28px; }

    .d1-lich-t { font-size: 14px; }
    .d1-lich-t th, .d1-lich-t td { padding: 6px 6px; }
    .d1-lich-t thead th { font-size: 15px; }
    .d1-lich-t tbody th { font-size: 15px; white-space: normal; }
    .d1-lich-t thead th:first-child { width: 54px; }
    .d1-lich-t thead th a { font-size: 15px; }
    .d1-lich-t small { display: block; }
    .d1-lich-t td a, .d1-lich-t td span { display: block; margin: 0; padding: 4px 0; font-size: 14px; line-height: 18px; }
    .d1-faq { grid-template-columns: minmax(0, 1fr); }

    .d1-bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 60px; box-sizing: border-box; background: var(--d1-red-dk); border-top: 3px solid var(--d1-gold); }
    .d1-bnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #FFE9A8; font-family: var(--d1-cond); font-size: 12px; font-weight: 700; text-decoration: none; }
    .d1-bnav a[aria-current] { color: var(--d1-gold); }
    body { padding-bottom: 60px; }
}
