/*!
 * Soicau — kqxs.css
 * © 2026 pickles.soicau
 */

.kqxs-wrap,
.kqxs-day-tabs,
.kqxs-load-more,
.kqxs-empty,
.boxResult {

    --color-primary-hover:  var(--color-primary-dark);
    --color-text:           #333;
    --color-text-secondary: #555;
    --color-text-muted:     #888;
    --color-text-hint:      #999;
    --color-text-dark:      #222;
    --color-text-light:     #888;
    --color-white:          #fff;
    --color-bg:             #f5f5f5;
    --color-bg-alt:         #f7f7f7;
    --color-bg-alt-2:       #f0f0f0;
    --color-border:         #eee;
    --color-border-medium:  #ddd;
    --color-border-dark:    #e0e0e0;
    --color-border-light:   #f0f0f0;

    /* Typography */
    --font-family:    sans-serif;
    --font-size-base: 16px;
    --font-size-xs:   13px;
    --font-size-sm:   15px;
    --font-size-md:   17px;
    --font-size-lg:   19px;
    --font-size-xl:   21px;
    --font-size-2xl:  23px;

    /* Spacing & layout */
    --gap:       10px;
    --gap-sm:    20px;
    --padding-x: 15px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.15);

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;

    /* KQXS-specific */
    --kq-mb:             var(--color-primary);
    --kq-mt:             var(--color-primary);
    --kq-mn:             var(--color-primary);
    --kq-danger:         var(--soicau-danger, #dc3545);
    --kq-warning:        #fff3cd;
    --kq-info:           var(--color-primary);
    --kq-dark:           #343a40;
    --kq-border:         #f1f1f1;
    --kq-bg:             #f8f9fa;
    --kq-toolbar:        var(--color-primary);
    --kq-toolbar-active: var(--color-primary-dark);
}

.kqxs-wrap    { font-family: var(--font-family); }
.kqxs-results { display: block; }

.entry-content > .kqxs-wrap {
    margin-left: -16px;
    margin-right: -16px;
}
@media (max-width: 480px) {
    .entry-content > .kqxs-wrap {
        margin-left: -12px;
        margin-right: -12px;
    }
}

.boxResult + .boxResult { margin-top: var(--gap); }
.kqxs-results > * + * { margin-top: var(--gap); }

.main_result { background: var(--color-white); }

.kq-overflow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kq-overflow::-webkit-scrollbar { height: 4px; }
.kq-overflow::-webkit-scrollbar-thumb { background: var(--color-text-hint); border-radius: 2px; }

/* === Table === */
.kq-table { width: 100%; border-collapse: collapse; border: 0; border-bottom: 1px solid var(--kq-border); }
.kq-table th, .kq-table td { border: 1px solid var(--kq-border); vertical-align: middle; }
.kq-table tr > th:first-child, .kq-table tr > td:first-child { border-left: 0; }
.kq-table tr > th:last-child, .kq-table tr > td:last-child { border-right: 0; }

/* === Header === */
.kq-th-header { background: var(--color-primary); color: var(--color-white); text-align: center; padding: 10px 12px; }

.kq-title { font-weight: 700; font-size: var(--font-size-md); margin: 0 0 2px; }
.kq-title a { color: inherit; text-decoration: none; }
.kq-title a:hover { text-decoration: underline; }
.kq-tags { margin: 0; font-size: var(--font-size-xs); font-weight: 400; }
.kq-tags a { color: rgba(255,255,255,0.85); text-decoration: none; }
.kq-tags a + a::before { font-family: sans-serif; padding: 0 3px; color: rgba(255,255,255,0.6); content: "/\00a0"; display: inline-block; }
.kq-tags a:hover { text-decoration: underline; color: var(--color-white); }

.boxResult .kq-th-header { background: var(--color-primary); color: #fff; }
.boxResult .kq-th-header .kq-title { color: #fff; }
.boxResult .kq-th-header .kq-tags { color: rgba(255,255,255,.85); }
.boxResult .kq-th-header .kq-tags a { color: rgba(255,255,255,.85); }
.boxResult .kq-th-header .kq-tags a:hover { color: #fff; }
.boxResult .kq-th-header .kq-tags a + a::before { color: rgba(255,255,255,.5); }
.boxResult .kq-th-header .kq-day-nav {
    background: rgba(255,255,255,.18);
    color: #fff;
    border-color: rgba(255,255,255,.4);
}
.boxResult .kq-th-header .kq-day-nav:hover:not([disabled]) { background: rgba(255,255,255,.28); }

/* === Tên giải (cột trái) === */
.kq-name { text-align: center; font-size: var(--font-size-sm); color: var(--color-text-secondary); white-space: nowrap; width: 85px; min-width: 85px; }

/* === Province header === */
.kq-province-row { background: var(--color-primary-dark); }
.kq-province-row th:not(.kq-name) { color: var(--color-white); text-align: center; padding: 8px 6px; font-size: var(--font-size-sm); font-weight: 700; }
.kq-province-row .kq-name { background: var(--color-primary-dark); color: var(--color-text-secondary); font-weight: normal; }
.kq-table-2m .kq-province-row { background: none; }
.kq-table-2m .kq-province-row th:not(.kq-name) { color: var(--color-primary); }
.kq-table-2m .kq-province-row th:not(.kq-name) a { color: var(--color-primary); }
.kq-table-2m .kq-province-row .kq-name { background: none; color: var(--color-text-secondary); font-weight: normal; }
.kq-province-th { min-width: 95px; white-space: nowrap; }
.kq-province-th h3,
.kq-province-th h4 { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; }
.kq-province-th a { color: var(--color-white); text-decoration: none; }
.kq-province-th a:hover { text-decoration: underline; }

/* === Ô số - Miền Bắc (grid) === */
.kq-nums-td { padding: 0 !important; }
.kq-nums { display: flex; flex-wrap: wrap; }
.kq-num { display: flex; align-items: center; justify-content: center; font-family: var(--font-family); font-weight: 700; font-size: var(--font-size-lg); color: var(--color-text-dark); text-align: center; min-height: 38px; box-sizing: border-box; }
.kq-c1 { width: 100%; }
.kq-c2 { width: 50%; }
.kq-c3 { width: 33.333%; }
.kq-c4 { width: 25%; }
.kq-bl { border-left: 1px solid var(--kq-border); }
.kq-bb { border-bottom: 1px solid var(--kq-border); }

/* Đặc biệt */
.kq-tr-db .kq-num { font-size: var(--font-size-xl); min-height: 38px; }
.kq-danger { color: var(--kq-danger) !important; }
.kq-bold { font-weight: 700 !important; }

/* === Ô số - 2 miền === */
.kq-num-2m { text-align: center; font-family: var(--font-family); font-weight: 700; font-size: var(--font-size-lg); color: var(--color-text-dark); min-height: 38px; box-sizing: border-box; }
.kq-num-db { font-size: var(--font-size-xl) !important; }
.ky-tu-db .kq-num-2m { font-weight: 400; font-size: var(--font-size-md); }

/* Ký tự ĐB */
.ky-tu-db .kq-num { font-size: var(--font-size-md); font-weight: 400; }

.kq-num-text { display: inline-block; transition: opacity var(--transition-fast); }
.kq-dim > .kq-num-text { opacity: 0.22; }
.kq-highlight { background: var(--kq-warning); border-radius: 3px; padding: 0 2px; }

/* === Toolbar === */
.kq-toolbar-td { padding: 0 !important; background: var(--color-white); }
.kq-toolbar { padding: 8px; }
.kq-tb-len { flex: 1; }
.kq-tb-digit { flex: 1; }

.kq-grid { display: flex; flex-wrap: wrap; }
.kq-cell { display: flex; align-items: center; justify-content: center; width: calc(100% / 9); font-family: var(--font-family); font-weight: 600; color: var(--color-text-dark); box-sizing: border-box; }

h3.kq-cell-full,
h4.kq-cell-full {
    margin: 0;
    line-height: 1.4;
}
.kq-cell-full { width: 100%; }
.kq-bg-info { background: var(--kq-info); color: var(--color-white); }
.kq-break { width: 100%; height: 0; }
.kq-muted { color: var(--color-text-hint); }

/* === Loto Đầu/Đuôi Table === */
.kq-loto-table { width: 100%; border-collapse: collapse; background: var(--color-white); }
.kq-loto-table th { padding: 6px 8px; background: var(--color-primary-bg); font-size: var(--font-size-sm); font-weight: 700; border: 1px solid var(--kq-border); text-align: center; }
.kq-loto-table td { padding: 4px 8px; font-size: var(--font-size-md); border: 1px solid var(--kq-border); vertical-align: middle; }
.kq-loto-table .kq-th-header { background: var(--color-primary); padding: 10px 12px; border: 1px solid var(--color-primary); }
.kq-loto-table .kq-th-header .kq-title { color: var(--color-white); }
.kq-loto-table .kq-th-header .kq-tags a { color: rgba(255,255,255,0.85); }
.kq-loto-table .kq-th-header .kq-tags a:hover { color: var(--color-white); }
.kq-loto-idx { text-align: center; font-weight: 700; color: var(--kq-danger); width: 10%; }
.kq-loto-dau { text-align: left; font-family: var(--font-family); font-weight: 600; }
.kq-loto-duoi { text-align: right; font-family: var(--font-family); font-weight: 600; }
.kq-sup { vertical-align: super; font-size: smaller; color: var(--kq-danger); }
.kq-bold { font-weight: 700 !important; }

/* === Loto Province Tabs === */
.kq-loto-tabs { display: flex; background: var(--kq-bg); border-bottom: none; }
.kq-loto-tab { flex: 1; text-align: center; padding: 10px 6px; font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text-secondary); cursor: pointer; border-right: 1px solid var(--kq-border); transition: all var(--transition-fast); user-select: none; }
.kq-loto-tab:last-child { border-right: none; }
.kq-loto-tab:hover { background: var(--color-border-dark); }
.kq-loto-tab.active { background: var(--color-primary); color: var(--color-white); }
.kq-loto-pane { display: none; }
.kq-loto-pane.active { display: block; }

/* === Day Tabs (chọn thứ) === */
.kqxs-day-tabs {
    display: flex;
    flex-wrap: wrap;
    background: var(--color-white);
    border: 1px solid var(--kq-border);
    overflow: hidden;
    margin-bottom: 0;
}

.kqxs-day-tab {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-right: 1px solid var(--kq-border);
    border-bottom: 1px solid var(--kq-border);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.kqxs-day-tab:hover {
    background: var(--color-primary-bg);
    text-decoration: none;
    color: var(--color-primary);
}

.kqxs-day-tab.active {
    background: var(--color-primary);
    color: var(--color-white);
}

.kqxs-day-tab.active:hover {
    color: var(--color-white);
}

@media (min-width: 769px) {
    .kqxs-day-tab {
        border-bottom: none;
    }

    .kqxs-day-tab:last-child {
        border-right: none;
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) {
        background: transparent;
        border: 0;
        border-top: 1px solid var(--kq-border);
        border-bottom: 0;
        overflow: visible;
        flex-wrap: nowrap;
        gap: 3px;
        padding: 0;
        margin-bottom: 0;
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) + .kqxs-results { margin-top: -2px; }

    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab {
        flex: 1 1 0;
        background: var(--color-white);
        color: var(--color-text);
        border: 0;
        padding: 8px 14px;
        font-weight: 600;
        text-align: center;
        -webkit-clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
        clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab:first-child {
        -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
        clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab:last-child {
        -webkit-clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
        clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab:hover {
        background: var(--color-primary-bg);
        color: var(--color-primary);
    }

    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab.active,
    .kqxs-day-tabs:not(.vl-filter-tabs) .kqxs-day-tab.active:hover {
        background: var(--color-primary);
        color: var(--color-white);
    }
}

@media (max-width: 768px) {
    .kqxs-day-tab {
        flex: 1 1 25%;
        font-size: var(--font-size-xs);
        padding: 8px 4px;
    }

    /* Hàng cuối bỏ border-bottom */
    .kqxs-day-tab:nth-last-child(-n+4) {
        border-bottom: none;
    }

    /* Mỗi ô cuối hàng bỏ border-right */
    .kqxs-day-tab:nth-child(4n) {
        border-right: none;
    }

    /* Ô cuối cùng */
    .kqxs-day-tab:last-child {
        border-right: none;
    }
}

/* === Load More Button === */
.kqxs-load-more {
    display: flex;
    justify-content: center;
    padding: var(--gap) 0;
}

.kqxs-btn-load {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: var(--font-size-sm);
    color: var(--color-white);
    background: var(--color-primary);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.kqxs-btn-load:hover {
    background: var(--color-primary-hover);
}

.kqxs-btn-load:disabled {
    opacity: 0.7;
    cursor: wait;
}

.kqxs-btn-load i {
    font-size: 11px;
    transition: transform 0.4s ease;
}

.kqxs-btn-load:hover:not(:disabled) i {
    transform: rotate(180deg);
}

/* === Home posts === */
.kqxs-empty { padding: 40px 20px; text-align: center; color: var(--color-text-muted); }

/* === Responsive === */
@media (max-width: 768px) {
    .kq-name { width: 40px; min-width: 40px; padding: 4px 3px; font-size: var(--font-size-sm); }
    .kq-num { padding: 4px 2px; min-height: 34px; }
    .kq-tr-db .kq-num { padding: 6px 2px; min-height: 34px; }
    .kq-province-row th:not(.kq-name) { font-size: var(--font-size-sm); }
    .kq-province-th { min-width: 70px; }
    .kq-num-2m { padding: 4px 2px; min-height: 34px; }
    .ky-tu-db .kq-num,
    .ky-tu-db .kq-num-2m { font-size: var(--font-size-md); }
    .kq-cell { padding: 4px 1px; font-size: var(--font-size-md); }
    .kq-title { font-size: var(--font-size-sm); }
    .kq-tags { font-size: var(--font-size-xs); }
    .kq-loto-table th { font-size: var(--font-size-sm); padding: 5px 4px; }
    .kq-loto-table td { padding: 4px 6px; font-size: var(--font-size-md); }
    .kq-loto-tab { font-size: var(--font-size-sm); padding: 8px 3px; }
}

@media (max-width: 480px) {
    .kq-name { width: 36px; min-width: 36px; padding: 3px 2px; font-size: var(--font-size-xs); }
    .kq-num { font-size: var(--font-size-md); min-height: 30px; padding: 3px 1px; }
    .kq-tr-db .kq-num { font-size: var(--font-size-lg); min-height: 32px; padding: 4px 1px; }
    .kq-num-2m { font-size: var(--font-size-md); min-height: 30px; padding: 3px 1px; }
    .kq-num-db { font-size: var(--font-size-lg) !important; }
    .ky-tu-db .kq-num,
    .ky-tu-db .kq-num-2m { font-size: var(--font-size-sm); }
    .kq-cell { font-size: var(--font-size-sm); padding: 3px 1px; }
    .kq-loto-table th { padding: 4px 3px; font-size: var(--font-size-xs); }
    .kq-loto-table td { padding: 3px 4px; font-size: var(--font-size-sm); }
    .kq-loto-tab { font-size: var(--font-size-xs); padding: 7px 2px; }
}

.kq-toolbar-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    flex-wrap: wrap;
    background: var(--color-white);
}

.kq-toolbar-inline .kq-tb-cham-list { margin-left: auto; }

.kq-toolbar-inline .kq-tb-len {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.kq-tb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    padding: 0;
    background: transparent;
    border: 0;
    margin: 0;
    flex: 0 0 auto;
}
.kq-tb-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.kq-tb-pill .kq-tb-pill-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
    transition: border-color var(--transition-fast);
}
.kq-tb-pill.active .kq-tb-pill-mark::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: translate(-50%, -50%);
}
.kq-tb-pill:hover .kq-tb-pill-mark { border-color: var(--color-primary-hover); }

.kq-tb-cham-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.kq-tb-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    border: 2px solid transparent;
    padding: 0;
    flex: 0 0 auto;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.kq-tb-circle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.kq-tb-circle:hover { background: var(--color-primary-hover); }
.kq-tb-circle.active {
    background: var(--color-primary-dark);
    border-color: var(--color-white);
    box-shadow: 0 0 0 2px var(--color-primary-dark);
}

/* Toggle Loto trực tiếp */
.kq-tb-toggle-loto i { transition: transform var(--transition-base); font-size: 11px; }
.kq-tb-toggle-loto.is-expanded i { transform: rotate(180deg); }

.kq-loto-live-section.is-hidden { display: none; }

.kq-loto-table tbody tr.kq-row-active,
.kq-loto-table tbody tr.kq-row-active:nth-child(odd) { background: var(--kq-warning); }
.kq-loto-table tbody tr.kq-row-active td { background: var(--kq-warning); }

.kq-loto-table .kq-cell-fade { display: inline-block; transition: opacity var(--transition-fast); }
.kq-loto-table tbody tr.kq-row-dim .kq-cell-fade { opacity: 0.22; }

@media (max-width: 640px) {
    .kq-toolbar-inline { gap: 8px; padding: 8px; justify-content: center; }
    .kq-toolbar-inline .kq-tb-len { gap: 10px; }

    .kq-toolbar-inline .kq-tb-cham-list { margin-left: 0; justify-content: center; }
    .kq-tb-pill .kq-tb-pill-text { font-size: var(--font-size-xs); }
    .kq-tb-circle { width: 24px; height: 24px; font-size: var(--font-size-xs); }
}

@media (max-width: 480px) {
    .kq-toolbar-inline { gap: 6px; padding: 6px; }
    .kq-toolbar-inline .kq-tb-len { gap: 8px; }
    .kq-tb-cham-list { gap: 4px; }
    .kq-tb-circle { width: 22px; height: 22px; }
}

.kq-num-pending .kq-num-text { opacity: 1 !important; }
.kq-num-spinning .kq-num-text {
    opacity: 1 !important;
    transition: none !important;
}
kt-noformat { display: inline; }

.kq-live-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    animation: kq-live-flag-glow 1.6s ease-in-out infinite;
}
.kq-live-flag-dot {
    width: 8px;
    height: 8px;
    background: #ff3b30;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    animation: kq-live-dot-pulse 1.1s ease-in-out infinite;
}
@keyframes kq-live-flag-glow {
    0%, 100% { background-color: rgba(255, 255, 255, 0.16); }
    50%      { background-color: rgba(255, 255, 255, 0.32); }
}
@keyframes kq-live-dot-pulse {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70%  { transform: scale(0.9); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.kq-live-flag-done {
    animation: none;
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(220, 252, 231, 0.55);
}
.kq-live-flag-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.boxResult > .main_result,
.boxResult > .kq-loto-live-section,
.boxResult > .kq-loto-table-wrap,
.boxResult .kq-loto-tabs,
.boxResult .kq-loto-pane > .kq-loto-live-section,
.boxResult .kq-loto-pane > .kq-loto-table-wrap {
    background: #fff;
    overflow: hidden;
}
.boxResult > .kq-loto-live-section,
.boxResult > .kq-loto-table-wrap,
.boxResult > .kq-loto-wrap,
.boxResult .kq-loto-pane > .kq-loto-live-section,
.boxResult .kq-loto-pane > .kq-loto-table-wrap {
    margin-top: 8px;
}
.boxResult .main_result { background: #fff; }
.boxResult .kq-overflow { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.boxResult .kq-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    border-bottom: 1px solid var(--kq-border);
}
.boxResult .kq-table th,
.boxResult .kq-table td {
    border: 1px solid var(--kq-border);
    vertical-align: middle;
}
.boxResult .kq-table tr > *:first-child { border-left: 0; }
.boxResult .kq-table tr > *:last-child  { border-right: 0; }
.boxResult .kq-table > thead > tr:first-child > * { border-top: 0; }
.boxResult .kq-table > tbody > tr:last-child > *  { border-bottom: 0; }

.boxResult .kq-th-header {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: 10px 48px;
    position: relative;
}
.boxResult .kq-day-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    transition: background .15s ease, opacity .15s ease;
}
.boxResult .kq-day-nav:hover:not([disabled]) { background: rgba(255,255,255,.28); }
.boxResult .kq-day-nav[disabled] { opacity: .35; cursor: not-allowed; }
.boxResult .kq-day-prev { left: 10px; }
.boxResult .kq-day-next { right: 10px; }
.boxResult.is-loading { opacity: .55; pointer-events: none; }
@media (max-width: 600px) {
    .boxResult .kq-th-header { padding: 10px 40px; }
    .boxResult .kq-day-nav   { width: 28px; height: 28px; font-size: 12px; }
    .boxResult .kq-day-prev  { left: 6px; }
    .boxResult .kq-day-next  { right: 6px; }
}
.boxResult .kq-title {
    font-weight: 700;
    font-size: 17px;
    margin: 0 0 2px;
    color: #fff;
}
.boxResult .kq-tags {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,.85);
}
.boxResult .kq-tags > * + *::before {
    content: "/\00a0";
    padding: 0 3px;
    color: rgba(255,255,255,.5);
}
.boxResult .kq-tags a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
}
.boxResult .kq-tags a:hover {
    color: #fff;
    text-decoration: underline;
}

.boxResult .kq-name {
    text-align: center;
    font-size: 15px;
    color: #555;
    white-space: nowrap;
    width: 50px;
    min-width: 50px;
    background: #fff;
}
.boxResult .kq-nums-td { padding: 0 !important; }
.boxResult .kq-nums    { display: flex; flex-wrap: wrap; }
.boxResult .kq-num {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 19px;
    color: #222;
    text-align: center;
    min-height: 38px;
    box-sizing: border-box;
}
.boxResult .kq-c1 { width: 100%; }
.boxResult .kq-c2 { width: 50%; }
.boxResult .kq-c3 { width: 33.333%; }
.boxResult .kq-c4 { width: 25%; }
.boxResult .kq-bl { border-left: 1px solid var(--kq-border); }
.boxResult .kq-bb { border-bottom: 1px solid var(--kq-border); }

.boxResult .kq-tr-db .kq-num { font-size: 21px; }
.boxResult .kq-danger { color: var(--kq-danger) !important; }

.boxResult .ky-tu-db .kq-num { font-size: 17px; font-weight: 400; }

@media (max-width: 600px) {
    .boxResult .kq-name          { font-size: 13px; }
    .boxResult .kq-num           { font-size: 16px; min-height: 32px; }
    .boxResult .kq-tr-db .kq-num { font-size: 18px; }
    .boxResult .kq-title         { font-size: 15px; }
    .boxResult .kq-tags          { font-size: 12px; }
}

/* ---- Toolbar (pill radio + chip số) ---- */
.boxResult .kq-toolbar-td { padding: 0 !important; background: #fff; }
.boxResult .kq-toolbar-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    flex-wrap: wrap;
    background: #fff;
}
.boxResult .kq-toolbar-inline .kq-tb-cham-list { margin-left: auto; }
.boxResult .kq-toolbar-inline .kq-tb-len {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.boxResult .kq-tb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    color: #333;
    padding: 0;
    background: transparent;
    border: 0;
    margin: 0;
    flex: 0 0 auto;
}
.boxResult .kq-tb-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.boxResult .kq-tb-pill .kq-tb-pill-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
    transition: border-color .15s ease;
}
.boxResult .kq-tb-pill.active .kq-tb-pill-mark::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: translate(-50%, -50%);
}

.boxResult .kq-tb-cham-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.boxResult .kq-tb-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    border: 2px solid transparent;
    padding: 0;
    flex: 0 0 auto;
    transition: background .15s ease, box-shadow .15s ease;
}
.boxResult .kq-tb-circle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.boxResult .kq-tb-circle:hover { background: var(--color-primary-dark, #a31818); }
.boxResult .kq-tb-circle.active {
    background: var(--color-primary-dark, #a31818);
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--color-primary-dark, #a31818);
}
.boxResult .kq-tb-toggle-loto i { transition: transform .2s ease; font-size: 11px; }
.boxResult .kq-tb-toggle-loto.is-expanded i { transform: rotate(180deg); }

.boxResult .kq-num-text { display: inline-block; transition: opacity .15s ease; }
.boxResult .kq-num.kq-dim > .kq-num-text { opacity: .22; }
.boxResult .kq-highlight {
    background: var(--color-primary-bg);
    border-radius: 3px;
    padding: 0 2px;
}

/* Toggle Loto trực tiếp */
.boxResult .kq-loto-live-section.is-hidden { display: none; }

.boxResult .kq-loto-table .kq-cell-fade {
    display: inline-block;
    transition: opacity .15s ease;
}
.boxResult .kq-loto-table tbody tr.kq-row-dim .kq-cell-fade { opacity: .22; }
.boxResult .kq-loto-table tbody tr.kq-row-active,
.boxResult .kq-loto-table tbody tr.kq-row-active:nth-child(odd) { background: #fff3cd; }
.boxResult .kq-loto-table tbody tr.kq-row-active td { background: var(--color-primary-bg); }

@media (max-width: 640px) {
    .boxResult .kq-toolbar-inline { gap: 8px; padding: 8px; justify-content: center; }
    .boxResult .kq-toolbar-inline .kq-tb-len { gap: 10px; }
    .boxResult .kq-toolbar-inline .kq-tb-cham-list { margin-left: 0; justify-content: center; }
    .boxResult .kq-tb-pill .kq-tb-pill-text { font-size: 13px; }
    .boxResult .kq-tb-circle { width: 24px; height: 24px; font-size: 12px; }
}
@media (max-width: 480px) {
    .boxResult .kq-toolbar-inline { gap: 6px; padding: 6px; }
    .boxResult .kq-tb-cham-list { gap: 4px; }
    .boxResult .kq-tb-circle { width: 22px; height: 22px; }
}

/* ---- Loto trực tiếp (grid 9 cột) ---- */
.boxResult .kq-loto-live-section {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid #f1f1f1;
}
.boxResult .kq-loto-live-section .kq-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% / 9);
    min-height: 28px;
    padding: 2px 0;
    font-weight: 600;
    font-size: 16px;
    color: #222;
    border-right: 1px solid #f1f1f1;
    border-bottom: 1px solid #f1f1f1;
    box-sizing: border-box;
}

.boxResult .kq-loto-live-section .kq-cell:nth-child(10n) { border-right: 0; }
.boxResult .kq-loto-live-section .kq-cell-full {
    width: 100%;
    background: var(--color-primary-bg);
    font-weight: 700;
    font-size: 14px;
    padding: 6px 8px;
    justify-content: center;
    min-height: 0;
    border-right: 0;
}
.boxResult .kq-break    { width: 100%; height: 0; }
.boxResult .kq-muted    { color: #999; }
.boxResult .kq-bold     { font-weight: 700 !important; }

/* ---- Bảng Đầu / Đuôi ---- */
.boxResult .kq-loto-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 0;
}
.boxResult .kq-loto-table th {
    padding: 6px 8px;
    background: var(--color-primary-bg);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--kq-border);
    text-align: center;
}
.boxResult .kq-loto-table td {
    padding: 5px 8px;
    font-size: 16px;
    border: 1px solid var(--kq-border);
    vertical-align: middle;
}
.boxResult .kq-loto-table tr > *:first-child { border-left: 0; }
.boxResult .kq-loto-table tr > *:last-child  { border-right: 0; }
.boxResult .kq-loto-idx {
    text-align: center;
    font-weight: 700;
    color: var(--kq-danger);
    width: 10%;
}
.boxResult .kq-loto-dau  { text-align: left;  font-weight: 600; }
.boxResult .kq-loto-duoi { text-align: right; font-weight: 600; }
.boxResult .kq-sup {
    vertical-align: super;
    font-size: smaller;
    color: var(--kq-danger);
}

@media (max-width: 600px) {
    .boxResult .kq-loto-live-section .kq-cell { font-size: 14px; min-height: 28px; }
    .boxResult .kq-loto-table th { font-size: 12px; padding: 4px 3px; }
    .boxResult .kq-loto-table td { font-size: 13px; padding: 4px 5px; }
}
