/* =========================================================
   PKDS Site Standard v1
   Đồng bộ theo chuẩn khung kho sim
   - Desktop: max 1280px / padding ngang 14px / margin dọc 20px
   - Mobile: 8px / 6px như kho sim chuẩn
   ========================================================= */
:root{
  --pkds-shell-max-local: var(--pkds-shell-max, 1280px);
  --pkds-shell-margin-y-local: var(--pkds-shell-margin-y, 20px);
  --pkds-shell-pad-x-local: var(--pkds-shell-pad-x, 14px);
  --pkds-shell-pad-x-mobile-local: var(--pkds-shell-pad-x-mobile, 8px);
  --pkds-shell-pad-x-mobile-sm-local: var(--pkds-shell-pad-x-mobile-sm, 6px);
  --pkds-section-gap-local: var(--pkds-section-gap, 16px);
  --kd-space-sm-local: var(--pkds-space-sm, 8px);
  --kd-space-lg-local: var(--pkds-space-lg, 12px);
  --kd-space-xl-local: var(--pkds-space-xl, 14px);
  --kd-space-3xl-local: var(--pkds-space-3xl, 18px);
  --kd-space-4xl-local: var(--pkds-space-4xl, 20px);
  --kd-radius-sm-local: var(--pkds-radius-sm, 10px);
  --kd-radius-md-local: var(--pkds-radius-md, 12px);
}

:root {
    --kd-bg: var(--pkds-panel-bg-1, #fcf6e8);
    --kd-panel: var(--pkds-panel-bg-2, #f1e1bb);
    --kd-panel-soft: var(--pkds-panel-soft, #f7ecd1);
    --kd-red: var(--pkds-red-1, #7f1414);
    --kd-red-soft: var(--pkds-red-2, #9e1a1a);
    --kd-gold: var(--pkds-gold-2, #c39a52);
    --kd-gold-soft: var(--pkds-gold-1, #dcc08a);
    --kd-text: var(--pkds-text-soft, #5f4512);
    --kd-muted: var(--pkds-text-mute, #8a734b);
    --kd-red2: var(--pkds-red-2, #9e1a1a);
    --kd-gold2: var(--pkds-gold-1, #dcc08a);
    --kd-ink: #3b2a12;
    --kd-ink-2: #5a4210;
    --kd-paper: var(--pkds-panel-bg-1, #fcf6e8);
    --kd-line: rgba(169, 123, 24, .20);
    --kd-gold-line: rgba(195, 154, 82, .62);
    --kd-red-deep: var(--pkds-red-deep, #651010);
}

.kd-que-title,
.skd-que-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--kd-red);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-left: var(--kd-space-xl-local);
    border-left: 5px solid var(--kd-gold);
    margin-bottom: var(--kd-space-3xl-local);
}

.kd-luan-giai,
.skd-luan-giai {
    background: linear-gradient(135deg, var(--kd-bg), var(--kd-panel));
    border: 1.5px solid var(--kd-gold);
    border-radius: var(--kd-radius-sm-local);
    padding: var(--kd-space-3xl-local) var(--kd-space-4xl-local);
    box-shadow: 0 4px 12px rgba(121, 84, 21, 0.15);
}

.kd-subtitle {
    font-weight: 700;
    color: var(--kd-red-soft);
    margin-top: 20px;
    margin-bottom: 10px;
}

.kd-content p {
    font-size: 16.5px;
    line-height: 1.85;
    color: var(--kd-text);
    margin-bottom: 14px;
}

.kd-content ul {
    list-style: none;
    padding-left: 0;
}

.kd-content li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
}

.kd-content li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--kd-gold);
    font-weight: bold;
}

/* =========================================================
KDCH – ĐỎ VÀNG SANG (ÁP CHO OUTPUT PLUGIN)
Bám đúng class: .skd-card .skd-panel .skd-section
========================================================= */

/* Nền khu vực plugin */
.entry-content .skd-card,
.entry-content .skd-panel,
.entry-content .skd-section {
    background: linear-gradient(135deg, var(--kd-bg), var(--kd-panel)) !important;
    border: 1.5px solid var(--kd-gold) !important;
    border-radius: var(--kd-radius-md-local) !important;
    box-shadow: 0 6px 18px rgba(140, 100, 20, .12) !important;
}

/* Thanh tiêu đề dạng “sắc phong” */
.entry-content .skd-section>h3,
.entry-content .skd-panel>h3,
.entry-content .skd-card>h3,
.entry-content .skd-section .skd-title,
.entry-content .skd-panel .skd-title {
    margin: 0 0 var(--kd-space-xl-local) 0 !important;
    padding: var(--kd-space-lg-local) var(--kd-space-xl-local) !important;
    background: linear-gradient(180deg, #f1d89f, #d7ad5d) !important;
    border: 1px solid var(--kd-gold) !important;
    border-radius: var(--kd-radius-sm-local) !important;
    color: #42250c !important;
    font-weight: 900 !important;
    letter-spacing: .3px !important;
}

/* Tiêu đề quẻ: đỏ son + gạch vàng */
.entry-content .skd-section h1,
.entry-content .skd-section h2,
.entry-content .skd-panel h1,
.entry-content .skd-panel h2 {
    color: var(--kd-red) !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    padding-left: 14px !important;
    border-left: 5px solid var(--kd-gold) !important;
    margin: 10px 0 14px !important;
}

/* Nội dung văn bản */
.entry-content .skd-section p,
.entry-content .skd-panel p {
    color: var(--kd-text) !important;
    font-size: 16.5px !important;
    line-height: 1.9 !important;
}

/* Nhấn mạnh (Hành / Quái / chữ đỏ) */
.entry-content .skd-section b,
.entry-content .skd-panel b,
.entry-content .skd-section strong,
.entry-content .skd-panel strong {
    color: var(--kd-red2) !important;
}

/* List dạng sao vàng (đẹp như bản cổ) */
.entry-content .skd-section ul,
.entry-content .skd-panel ul {
    list-style: none !important;
    padding-left: 0 !important;
}

.entry-content .skd-section li,
.entry-content .skd-panel li {
    position: relative !important;
    padding-left: 22px !important;
    margin: 10px 0 !important;
    color: var(--kd-text) !important;
}

.entry-content .skd-section li::before,
.entry-content .skd-panel li::before {
    content: "✦" !important;
    position: absolute !important;
    left: 0 !important;
    color: var(--kd-gold) !important;
    font-weight: 900 !important;
}

/* Khung “luận giải tổng thể” (nếu đang nằm trong panel) */
.entry-content .skd-section .skd-luan-giai,
.entry-content .skd-panel .skd-luan-giai {
    background: var(--kd-panel-soft) !important;
    border: 1.5px solid var(--kd-gold) !important;
    border-radius: var(--kd-radius-md-local) !important;
    padding: 16px 18px !important;
}

/* Mobile: giảm padding cho gọn */
@media (max-width: 600px) {

    .entry-content .skd-card,
    .entry-content .skd-panel,
    .entry-content .skd-section {
        padding: 12px !important;
    }

    .entry-content .skd-section>h3,
    .entry-content .skd-panel>h3,
    .entry-content .skd-card>h3 {
        padding: 10px 12px !important;
    }
}

/* ===== CSS ĂN VÀO NỘI DUNG QUẺ CPT (skd_render_hex) ===== */
.kdch-wrap .skd-hex {
    margin: 0;
}

.kdch-wrap .skd-hex-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--kd-red);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-left: var(--kd-space-xl-local);
    border-left: 5px solid var(--kd-gold);
    margin: 0 0 18px;
}

.kdch-wrap .skd-hex-content {
    background: linear-gradient(135deg, var(--kd-bg), var(--kd-panel));
    border: 1.5px solid var(--kd-gold);
    border-radius: var(--kd-radius-sm-local);
    padding: var(--kd-space-3xl-local) var(--kd-space-4xl-local);
    box-shadow: 0 4px 12px rgba(121, 84, 21, 0.15);
    color: var(--kd-text);
    line-height: 1.85;
    font-size: 16.5px;
}

/* ăn vào nội dung Gutenberg trong CPT */
.kdch-wrap .skd-hex-content p {
    margin: 0 0 14px;
}

.kdch-wrap .skd-hex-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 14px;
}

.kdch-wrap .skd-hex-content li {
    position: relative;
    padding-left: 22px;
    margin: 0 0 10px;
}

.kdch-wrap .skd-hex-content li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--kd-gold);
    font-weight: bold;
}

/* Title của quẻ (h3 do plugin tạo) — gọn, sang, không “hét” */
.kdch-wrap .skd-hex-title {
    font-family: ui-serif, "Noto Serif", "Times New Roman", serif;
    font-weight: 800;
    letter-spacing: .2px;
    text-transform: none;
    /* bỏ UPPERCASE cho học thuật */
    color: var(--kd-red-deep);
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.15;

    margin: 0 0 14px;
    padding: 10px 12px 10px 14px;
    border-left: 4px solid var(--kd-gold);
    background: linear-gradient(180deg, rgba(195, 154, 82, .20), rgba(195, 154, 82, .08));
    border-radius: 12px;
}

/* 3) Khối nội dung: bỏ gradient nặng, chuyển sang “paper card” */
.kdch-wrap .skd-hex-content {
    background: var(--kd-paper);
    border: 1px solid var(--kd-line);
    border-radius: 16px;

    padding: var(--kd-space-3xl-local) var(--kd-space-4xl-local);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);

    color: var(--kd-ink);
    font-family: ui-serif, "Noto Serif", "Times New Roman", serif;
    font-size: 18px;
    /* đọc “đã” hơn */
    line-height: 1.95;
    letter-spacing: .1px;

    /* giới hạn độ dài dòng cho “học thuật” (không quá rộng) */
    max-width: 920px;
}

/* 4) Reset heading bên trong Gutenberg: tránh H1/H2 quá bự */
.kdch-wrap .skd-hex-content h1,
.kdch-wrap .skd-hex-content h2,
.kdch-wrap .skd-hex-content h3,
.kdch-wrap .skd-hex-content h4 {
    font-family: ui-serif, "Noto Serif", "Times New Roman", serif;
    color: var(--kd-red-deep);
    font-weight: 850;
    letter-spacing: .2px;
    line-height: 1.25;

    margin: 22px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--kd-gold-line);
}

/* scale vừa phải, không “giật” */
.kdch-wrap .skd-hex-content h1 {
    font-size: clamp(24px, 2.4vw, 32px);
}

.kdch-wrap .skd-hex-content h2 {
    font-size: clamp(21px, 2.0vw, 26px);
}

.kdch-wrap .skd-hex-content h3 {
    font-size: clamp(19px, 1.7vw, 22px);
}

.kdch-wrap .skd-hex-content h4 {
    font-size: 18px;
}

/* 5) Paragraph + nhấn mạnh */
.kdch-wrap .skd-hex-content p {
    margin: 0 0 14px;
    color: var(--kd-ink);
}

.kdch-wrap .skd-hex-content strong,
.kdch-wrap .skd-hex-content b {
    color: var(--kd-ink);
    font-weight: 800;
}

/* 6) List: chuyển sang “học thuật” (disc) + đẹp, gọn */
.kdch-wrap .skd-hex-content ul {
    list-style: disc;
    padding-left: 22px;
    margin: 0 0 14px;
}

.kdch-wrap .skd-hex-content li {
    margin: 8px 0;
}

/* nếu anh vẫn thích icon ✦ thì dùng class riêng (không ép toàn bộ) */
/* .kdch-wrap .skd-hex-content .is-style-starlist ul{ list-style:none; padding-left:0; }
.kdch-wrap .skd-hex-content .is-style-starlist li{ position:relative; padding-left:22px; }
.kdch-wrap .skd-hex-content .is-style-starlist li:before{content:"✦"; position:absolute; left:0; color:var(--kd-gold); font-weight:900;}
*/

/* 7) Quote & separator đẹp như bài luận */
.kdch-wrap .skd-hex-content blockquote {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 4px solid var(--kd-gold);
    background: rgba(201, 162, 77, .10);
    border-radius: 12px;
    color: var(--kd-ink-2);
}

.kdch-wrap .skd-hex-content hr {
    border: 0;
    height: 1px;
    background: var(--kd-line);
    margin: 18px 0;
}

/* 8) Mobile: chữ vẫn sang nhưng không quá to */
@media (max-width: 600px) {
    .kdch-wrap .skd-hex-content {
        padding: 14px 14px;
        font-size: 16.8px;
        line-height: 1.9;
    }

    .kdch-wrap .skd-hex-title {
        padding: 10px 12px;
    }
}

/* ===== KHUNG TIÊU ĐỀ QUẺ (HOÀNG GIA – HỌC THUẬT) ===== */
.kdch-wrap .skd-hex-title {
    position: relative;
    background: linear-gradient(180deg,
            rgba(201, 162, 77, 0.30),
            rgba(201, 162, 77, 0.12));
    border: 1.5px solid rgba(201, 162, 77, 0.65);
    border-radius: 14px;

    padding: 14px 18px 14px 20px;
    margin-bottom: var(--kd-space-3xl-local);

    font-family: ui-serif, "Noto Serif", "Times New Roman", serif;
    font-weight: 900;
    color: #6f0f0f;
    /* đỏ rượu */
    letter-spacing: .5px;
}

/* vạch nhấn vàng bên trái */
.kdch-wrap .skd-hex-title::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg,
            #f5d98a,
            #c9a24d);
}

/* =========================================================
KĐCH – STYLE TIÊU ĐỀ QUẺ (ĂN CẢ: title do plugin + title trong editor)
========================================================= */

/* A) Nếu title do plugin render (class skd-hex-title hoặc kdch-hex-title) */
.kdch-wrap .skd-hex-title,
.kdch-wrap .kdch-hex-title {
    position: relative;
    background: linear-gradient(180deg, rgba(201, 162, 77, .30), rgba(201, 162, 77, .10)) !important;
    border: 1.5px solid rgba(201, 162, 77, .65) !important;
    border-radius: 14px !important;
    padding: 14px 18px 14px 22px !important;
    margin: 0 0 18px !important;

    font-family: ui-serif, "Noto Serif", "Times New Roman", serif !important;
    font-weight: 900 !important;
    color: #6f0f0f !important;
    letter-spacing: .5px !important;
}

.kdch-wrap .skd-hex-title::before,
.kdch-wrap .kdch-hex-title::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #edd28f, #c39a52);
}

/* B) Nếu title là H1/H2 trong nội dung editor (như ảnh anh) */
.kdch-wrap .kdch-hex-content h1,
.kdch-wrap .kdch-hex-content h2:first-of-type {
    position: relative;
    background: linear-gradient(180deg, rgba(201, 162, 77, .30), rgba(201, 162, 77, .10)) !important;
    border: 1.5px solid rgba(201, 162, 77, .65) !important;
    border-radius: 14px !important;
    padding: 14px 18px 14px 22px !important;
    margin: 10px 0 18px !important;

    font-family: ui-serif, "Noto Serif", "Times New Roman", serif !important;
    font-weight: 900 !important;
    color: #6f0f0f !important;
    letter-spacing: .5px !important;
}

.kdch-wrap .kdch-hex-content h1::before,
.kdch-wrap .kdch-hex-content h2:first-of-type::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #edd28f, #c39a52);
}

/* C) Khung tiêu đề mục trong bài */
.kdch-wrap .kdch-hex-content h2,
.kdch-wrap .kdch-hex-content h3 {
    background: linear-gradient(180deg, #f7e6b9, #ead093) !important;
    border: 1px solid rgba(201, 162, 77, .55) !important;
    border-radius: var(--kd-radius-md-local) !important;
    padding: 10px 14px !important;
    margin: 26px 0 14px !important;
    font-family: ui-serif, "Noto Serif", serif !important;
    font-weight: 850 !important;
    color: var(--kd-red-soft) !important;
}

.kdch-wrap .kdch-hex-content h2::after,
.kdch-wrap .kdch-hex-content h3::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin-top: 6px;
    background: linear-gradient(90deg, #c39a52, #eed08b);
    border-radius: 3px;
}

/* D) Chữ nhấn */
.kdch-wrap .kdch-hex-content strong,
.kdch-wrap .kdch-hex-content b {
    color: var(--kd-red-soft) !important;
    font-weight: 900 !important;
    background: linear-gradient(180deg, rgba(201, 162, 77, .25), rgba(201, 162, 77, .10)) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
}

/* =========================================================
KĐCH – TINH SANG / HỌC THUẬT (OVERRIDE)
========================================================= */

/* 1) H1 quẻ: bớt vàng, sang hơn, giống đề mục sách */
.kdch-wrap .kdch-hex-content h1,
.kdch-wrap .kdch-hex-content h2:first-of-type {
    background: linear-gradient(180deg, rgba(201, 162, 77, .16), rgba(201, 162, 77, .06)) !important;
    border: 1px solid rgba(201, 162, 77, .45) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .05) !important;
    padding: 14px 18px 14px 26px !important;
    letter-spacing: .6px !important;
}

.kdch-wrap .kdch-hex-content h1::before,
.kdch-wrap .kdch-hex-content h2:first-of-type::before {
    width: 3px !important;
    opacity: .95 !important;
}

/* 2) H2/H3: chuyển sang “thanh tiêu đề” nhẹ, gọn, học thuật */
.kdch-wrap .kdch-hex-content h2,
.kdch-wrap .kdch-hex-content h3 {
    background: rgba(201, 162, 77, .10) !important;
    border: 1px solid rgba(201, 162, 77, .35) !important;
    box-shadow: none !important;
    padding: 10px 14px 10px 14px !important;
    border-radius: var(--kd-radius-md-local) !important;
    color: #611010 !important;
}

.kdch-wrap .kdch-hex-content h2::after,
.kdch-wrap .kdch-hex-content h3::after {
    width: 44px !important;
    height: 2px !important;
    opacity: .85 !important;
}

/* 3) Chữ nhấn (strong/b): đổi sang highlight “bút dạ” */
.kdch-wrap .kdch-hex-content strong,
.kdch-wrap .kdch-hex-content b {
    background: linear-gradient(180deg,
            rgba(255, 233, 155, .75),
            rgba(255, 233, 155, .35)) !important;
    color: #5a1010 !important;
    border-radius: 6px !important;
    padding: 1px 6px 2px !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* 4) Bullet list: cho “dịch học” hơn (nhẹ, thẳng hàng) */
.kdch-wrap .kdch-hex-content ul {
    padding-left: 18px !important;
}

.kdch-wrap .kdch-hex-content li {
    margin: 10px 0 !important;
    line-height: 1.85 !important;
}

.kdch-wrap .kdch-hex-content li::marker {
    color: rgba(122, 26, 26, .75);
    font-weight: 900;
}

/* 5) Body chữ: dễ đọc hơn, “sách” hơn */
.kdch-wrap .kdch-hex-content {
    font-size: 16.5px !important;
    line-height: 1.92 !important;
    color: #1f2937 !important;
}

.kdch-wrap .kdch-hex-content p {
    margin: 0 0 14px !important;
}

/* 6) Mobile: giảm padding để không “bự quá” */
@media (max-width: 768px) {

    .kdch-wrap .kdch-hex-content h1,
    .kdch-wrap .kdch-hex-content h2:first-of-type {
        padding: 12px 14px 12px 22px !important;
        font-size: 22px !important;
    }

    .kdch-wrap .kdch-hex-content {
        font-size: 16px !important;
        line-height: 1.9 !important;
    }
}

/* =========================================================
KĐCH – KHUNG ĐOẠN (KIỂU SÁCH) – OVERRIDE
- Tạo “khung luận” cho đoạn văn
- Tạo box cho trích dẫn / ghi chú
========================================================= */

/* 1) Khung cho từng đoạn p: nhẹ, sang, không lố */
.kdch-wrap .kdch-hex-content p {
    background: rgba(255, 255, 255, .72) !important;
    border: 1px solid rgba(0, 0, 0, .06) !important;
    border-left: 4px solid rgba(201, 162, 77, .85) !important;
    border-radius: var(--kd-radius-md-local) !important;
    padding: var(--kd-space-lg-local) var(--kd-space-xl-local) !important;
    margin: 0 0 14px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .04) !important;
}

/* 2) Nếu trong p có strong/b -> nhấn vẫn “bút dạ”, nhưng bớt gắt */
.kdch-wrap .kdch-hex-content p strong,
.kdch-wrap .kdch-hex-content p b {
    background: linear-gradient(180deg, rgba(255, 233, 155, .70), rgba(255, 233, 155, .30)) !important;
}

/* 3) List: bọc thành “khung gạch đầu dòng” riêng (đọc rất đã) */
.kdch-wrap .kdch-hex-content ul {
    background: rgba(255, 255, 255, .70) !important;
    border: 1px solid rgba(0, 0, 0, .06) !important;
    border-left: 4px solid rgba(122, 26, 26, .65) !important;
    border-radius: var(--kd-radius-md-local) !important;
    padding: 12px 18px 12px 34px !important;
    margin: 12px 0 16px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .04) !important;
}

/* 4) Quote (nếu anh dùng blockquote trong bài): thành “trích dẫn sách” */
.kdch-wrap .kdch-hex-content blockquote {
    margin: 14px 0 !important;
    padding: 14px 16px !important;
    background: rgba(201, 162, 77, .10) !important;
    border: 1px solid rgba(201, 162, 77, .35) !important;
    border-left: 5px solid rgba(201, 162, 77, .95) !important;
    border-radius: var(--kd-radius-md-local) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .05) !important;
}

.kdch-wrap .kdch-hex-content blockquote p {
    background: transparent !important;
    border: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 5) Mobile: giảm padding cho “đỡ dài” */
@media (max-width: 768px) {
    .kdch-wrap .kdch-hex-content p {
        padding: 10px 12px !important;
        border-radius: 11px !important;
    }

    .kdch-wrap .kdch-hex-content ul {
        padding: 10px 14px 10px 28px !important;
        border-radius: 11px !important;
    }
}

/* KDCH SAFE WRAP (NO HORIZONTAL SCROLL) */
.kdch-wrap {
    width: auto !important;
    max-width: var(--pkds-shell-max-local) !important;
    margin: var(--pkds-shell-margin-y-local) auto !important;
    padding: 0 var(--pkds-shell-pad-x-local) !important;
    box-sizing: border-box !important;
}

/* =========================================
KDCH – FIX DESKTOP, GIỮ NGUYÊN MOBILE
Mục tiêu:
- Desktop: sát khung vàng, không choáng
- Mobile: giữ nguyên (đã OK)
========================================= */

/* CHỈ ÁP DỤNG TỪ DESKTOP */
@media (min-width: 1024px) {

    /* Khóa vùng plugin, không cho bung full màn hình */
    .entry-content .kdch-ui {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Container chính – sát nền vàng */
    .entry-content .kdch-ui .kdch-wrap {
        width: auto !important;
        max-width: var(--pkds-shell-max-local) !important;
        margin: var(--pkds-shell-margin-y-local) auto !important;
        padding: 0 var(--pkds-shell-pad-x-local) !important;
        box-sizing: border-box !important;
    }
}

/* ===== KDCH: ĐỔI THANH ĐIỂM ĐEN -> VÀNG MAY MẮN (ĐÚNG CHỖ) ===== */

/* Khung thanh */
.entry-content .kdch-meter {
    height: 12px !important;
    background: #dcc08a !important;
    /* nền be */
    border-radius: 999px !important;
    overflow: hidden !important;
    border: 1px solid rgba(201, 162, 77, .55) !important;
}

/* Thanh chạy (đang bị #111 trong plugin) */
.entry-content .kdch-meter>span {
    background: linear-gradient(90deg, #c39a52 0%, #e0bc72 50%, #aa7f32 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(201, 162, 77, .35) !important;
}

.entry-content .kdch-meter>span {
    transition: width .8s ease-out;
}


/* =========================
   MOBILE: Danh sách SIM dạng card (cho trang chọn SIM phù hợp)
========================= */
.kdch-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.kdch-mcard {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: #fff;
    padding: 12px
}

.kdch-mrow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px
}

.kdch-msim {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: .5px
}

.kdch-mprice {
    font-weight: 900;
    font-size: 18px;
    white-space: nowrap
}

.kdch-msub {
    margin-top: 6px;
    color: rgba(31, 41, 55, .85);
    font-weight: 700
}

.kdch-msub .dot {
    margin: 0 6px;
    opacity: .6
}

.kdch-mmeta {
    margin-top: 6px;
    color: rgba(31, 41, 55, .9);
    font-weight: 700
}

.kdch-mnote {
    margin-top: 6px;
    color: rgba(31, 41, 55, .75);
    font-size: 14px;
    line-height: 1.35
}

.kdch-mactions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap
}

.kdch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 900
}

.kdch-btn-primary {
    background: var(--kd-red);
    color: #fff
}

.kdch-btn-primary:hover {
    opacity: .95
}

.kdch-link {
    font-weight: 900;
    text-decoration: none
}

.kdch-link:hover {
    text-decoration: underline
}

@media (min-width: 769px) {
    .kdch-mobile-list {
        display: block
    }
}

/* Hold modal compact v2 */
.kdch-hold-modal-compact{width:min(620px,100%)}
.kdch-hold-note{margin:0 0 12px;opacity:.92}
.kdch-hold-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}
.kdch-hold-card{padding:10px 12px;border:1px solid rgba(169,123,24,.18);border-radius:14px;background:#f7ecd1}
.kdch-hold-card span{display:block;font-size:11.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#8a6a2a;margin-bottom:4px}
.kdch-hold-card b{display:block;font-size:18px;line-height:1.25;color:#2a1a06;word-break:break-word}
.kdch-lead-compact{padding:12px;border:1px solid rgba(169,123,24,.14);border-radius:16px;background:#fcf6e8}
.kdch-lead-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.kdch-hold-field{display:flex;flex-direction:column;gap:6px}
.kdch-hold-field label{font-size:12px;font-weight:800;color:#6b4b10}
.kdch-hold-field .kdch-input{width:100%;min-height:46px;padding:12px 14px;border-radius:14px;border:1px solid rgba(169,123,24,.38);background:#fff;color:#2a1a06;outline:none;box-sizing:border-box}
.kdch-hold-field .kdch-input:focus{border-color:#c79e3e;box-shadow:0 0 0 3px rgba(199,158,62,.12)}
.kdch-hold-field-full{grid-column:1/-1}
.kdch-hold-primary{width:100%;margin-top:12px;min-height:48px}
.kdch-hold-status{margin-top:8px;padding:10px 12px;border-radius:12px;background:#f7ecd1;color:#6a4b12;line-height:1.5}
.kdch-hold-actions-compact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.kdch-hold-actions-compact .kdch-btn{width:100%}
@media (max-width: 767px){
  .kdch-hold-summary,
  .kdch-lead-grid,
  .kdch-hold-actions-compact{grid-template-columns:1fr}
}
.kdch-hold-more{margin-top:10px;text-align:center}
.kdch-hold-more a{font-size:13px;font-weight:800;color:#8a620b;text-decoration:none}
.kdch-hold-more a:hover{text-decoration:underline}

.kdch-hold-page-wrap{max-width:var(--pkds-shell-max-local);margin:0 auto}
.kdch-hold-page{padding:28px;border:1px solid rgba(169,123,24,.18);border-radius:28px;background:linear-gradient(180deg,#fcf6e8 0%,#f1e1bb 100%);box-shadow:0 18px 40px rgba(77,52,12,.08)}
.kdch-hold-page-top{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.kdch-hold-page-kicker{font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#a1761e;margin-bottom:10px}
.kdch-hold-page-title{margin:0 0 10px;font-size:38px;line-height:1.08;color:#402707}
.kdch-hold-page-lead{max-width:760px;font-size:15px;line-height:1.75;color:#5a4425}
.kdch-hold-page-badges{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;max-width:340px}
.kdch-hold-page-shell{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);gap:18px}
.kdch-hold-page-panel{padding:20px;border:1px solid rgba(169,123,24,.15);border-radius:24px;background:#fcf6e8}
.kdch-hold-page-panel-title{margin:0 0 14px;font-size:18px;font-weight:900;color:#51340b}
.kdch-hold-page-summarybox .kdch-hold-summary{margin-bottom:14px}
.kdch-hold-page-note{display:grid;gap:10px;padding:14px 16px;border-radius:18px;background:#f8ebcd;color:#5a431a;line-height:1.7}
.kdch-lead-page{padding:0;border:0;background:transparent}
.kdch-hold-page-actions{margin-top:14px}
@media (max-width: 991px){
  .kdch-hold-page{padding:22px}
  .kdch-hold-page-top{flex-direction:column}
  .kdch-hold-page-badges{justify-content:flex-start;max-width:none}
  .kdch-hold-page-shell{grid-template-columns:1fr}
  .kdch-hold-page-title{font-size:32px}
}


@media (max-width: 767px){
    .kdch-wrap,
    .entry-content .kdch-ui .kdch-wrap {
        width: auto !important;
        max-width: none !important;
        margin: 16px auto !important;
        padding: 0 var(--pkds-shell-pad-x-mobile-local) !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 420px){
    .kdch-wrap,
    .entry-content .kdch-ui .kdch-wrap {
        padding: 0 var(--pkds-shell-pad-x-mobile-sm-local) !important;
    }
}


/* ===== KDCH mobile tune v1.4.3: pillar table + shell align to kho sim ===== */
@media (max-width: 767px){
  .kdch-wrap,
  .entry-content .kdch-ui .kdch-wrap{
    width:auto !important;
    max-width:none !important;
    margin:16px auto !important;
    padding:0 var(--pkds-shell-pad-x-mobile-local) !important;
    box-sizing:border-box !important;
  }

  .kdch-wrap,
  .kdch-wrap *,
  .kdch-card,
  .kdch-pillar-card,
  .kdch-batu-intro > .kdch-card,
  .kdch-batu-deep-grid > .kdch-card,
  .kdch-flow-grid > .kdch-card{
    box-sizing:border-box;
    min-width:0;
  }

  .kdch-card,
  .kdch-pillar-card,
  .kdch-batu-intro > .kdch-card,
  .kdch-batu-deep-grid > .kdch-card,
  .kdch-flow-grid > .kdch-card{
    width:100% !important;
    max-width:100% !important;
    overflow:hidden;
  }

  .kdch-pillar-card{
    padding:10px 8px !important;
    border-radius:14px;
  }

  .kdch-pillar-table{
    display:table !important;
    width:100% !important;
    max-width:100% !important;
    table-layout:fixed !important;
    border-radius:12px;
    overflow:hidden !important;
  }

  .kdch-pillar-table thead th,
  .kdch-pillar-table th,
  .kdch-pillar-table td{
    min-width:0 !important;
    padding:8px 6px !important;
    font-size:11px;
    line-height:1.3;
    word-break:break-word;
    overflow-wrap:anywhere;
  }

  .kdch-pillar-table thead th{
    font-size:10.5px;
    letter-spacing:.02em;
  }

  .kdch-pillar-table .rowhead{
    width:64px;
    min-width:64px !important;
    position:static !important;
    left:auto !important;
    z-index:auto !important;
    font-size:10.5px;
    line-height:1.25;
  }

  .kdch-pillar-main{
    font-size:13px;
    line-height:1.18;
  }

  .kdch-pillar-sub{
    margin-top:3px;
    font-size:10px;
    line-height:1.3;
  }

  .kdch-pillar-sub .sep{margin:0 2px;}
  .kdch-pillar-cell{min-height:0;}
}

@media (max-width: 420px){
  .kdch-wrap,
  .entry-content .kdch-ui .kdch-wrap{
    padding:0 var(--pkds-shell-pad-x-mobile-sm-local) !important;
  }

  .kdch-pillar-card{padding:8px 6px !important;}

  .kdch-pillar-table thead th,
  .kdch-pillar-table th,
  .kdch-pillar-table td{
    padding:7px 5px !important;
    font-size:10px;
  }

  .kdch-pillar-table .rowhead{
    width:56px;
    min-width:56px !important;
    font-size:10px;
  }

  .kdch-pillar-main{font-size:12px;}
  .kdch-pillar-sub{font-size:9.5px;line-height:1.25;}
}


/* =========================================================
   KDCH COLOR LOCK v1.4.7
   Khóa tone màu theo chuẩn Kho SIM, tránh fallback kem trắng cũ
   ========================================================= */
.kdch-ui,
.kdch-wrap,
.kdch-wrap.kdch-pick-v2{
  --kdch-sync-bg-1: var(--pkds-panel-bg-1, #fcf6e8) !important;
  --kdch-sync-bg-2: var(--pkds-panel-bg-2, #f1e1bb) !important;
  --kdch-sync-bg-3: var(--pkds-panel-soft, #f7ecd1) !important;
  --kdch-sync-bg-4: var(--pkds-panel-soft-2, #f2dfb1) !important;
  --kdch-sync-chip: var(--pkds-bg-cream, #faefd7) !important;
  --kdch-sync-card: var(--pkds-panel-bg-1, #fcf6e8) !important;
  --kdch-sync-card-2: var(--pkds-panel-soft, #f7ecd1) !important;
  --kdch-sync-line: rgba(169,123,24,.22) !important;
  --kdch-sync-line-strong: rgba(169,123,24,.34) !important;
  --kdch-sync-gold-1: var(--pkds-gold-1, #dcc08a) !important;
  --kdch-sync-gold-2: var(--pkds-gold-2, #c39a52) !important;
  --kdch-sync-gold-3: var(--pkds-gold-4, #a67821) !important;
  --kdch-sync-red-1: var(--pkds-red-1, #7f1414) !important;
  --kdch-sync-red-2: var(--pkds-red-2, #9e1a1a) !important;
  --kdch-sync-red-3: var(--pkds-red-deep, #651010) !important;
  --kdch-sync-text: var(--pkds-text-soft, #5f4512) !important;
  --kdch-sync-text-soft: var(--pkds-text-mute, #8a734b) !important;
}

.kdch-wrap .kdch-card,
.kdch-wrap .kdch-score-card,
.kdch-wrap .kdch-summary-box,
.kdch-wrap .kdch-reading-step,
.kdch-wrap .kdch-element-row,
.kdch-wrap .kdch-hold-card,
.kdch-wrap .kdch-lead-compact,
.kdch-wrap .pkds-panel,
.kdch-wrap .kdchp-pick-card,
.kdch-wrap .pkds-hex-box,
.kdch-wrap .pkds-laso-premium .pkds-lh-tag{
  background: linear-gradient(180deg, var(--kdch-sync-card) 0%, var(--kdch-sync-card-2) 100%) !important;
  border-color: var(--kdch-sync-gold-1) !important;
}

.kdch-wrap .kdch-pillar-table,
.kdch-wrap .pkds-laso-premium .pkds-laso-tablewrap,
.kdch-wrap .pkds-laso-premium table.pkds-lh-table{
  background: var(--kdch-sync-card) !important;
  border-color: var(--kdch-sync-gold-1) !important;
}

.kdch-wrap .kdch-pillar-table thead th{
  background: var(--kdch-sync-card-2) !important;
}

.kdch-wrap .kdch-pillar-table .rowhead{
  background: var(--kdch-sync-card) !important;
}

.kdch-wrap .kdch-meter,
.kdch-wrap .kdchp-bar,
.kdch-wrap .pkds-bar{
  background: #efe7d6 !important;
  border-color: rgba(169,123,24,.18) !important;
}

.kdch-wrap .kdch-pick-v2-filter-card,
.kdch-wrap .kdch-pick-v2-item,
.kdch-wrap .kdch-pick-v2-metric-card,
.kdch-wrap .kdch-pick-v2 .kdch-sales-summary{
  background: linear-gradient(180deg, var(--kdch-sync-card) 0%, var(--kdch-sync-card-2) 100%) !important;
  border-color: var(--kdch-sync-gold-1) !important;
}

.kdch-wrap .kdch-pick-v2 .kdch-pick-v2-buybox,
.kdch-wrap .kdch-flow-intro{
  background: linear-gradient(180deg, var(--kdch-sync-bg-1) 0%, var(--kdch-sync-bg-3) 100%) !important;
  border-color: var(--kdch-sync-gold-1) !important;
}


/* =========================================================
   KDCH TEXT SOFTEN ONLY v1.4.9
   Chỉ tinh chỉnh màu chữ, KHÔNG đụng width/padding/margin/layout
   ========================================================= */
.kdch-ui,
.kdch-wrap{color:var(--pkds-text-soft,#5f4512)!important;}

.kdch-wrap .kdch-title,
.kdch-wrap .kdch-h2,
.kdch-wrap .kdch-hero-title,
.kdch-wrap .kdch-flow-title,
.kdch-wrap .kdch-score-card .title,
.kdch-wrap .kdch-pick-v2 .kdch-h2,
.kdch-wrap .kdch-pick-v2 .kdch-hero-title,
.kdch-wrap .kdch-pick-v2 .kdch-pick-v2-metric-top,
.kdch-wrap .kdch-pick-v2 .kdch-pick-v2-metric-top b,
.kdch-wrap .kdch-radar-node-label,
.kdch-wrap .kdch-radar-center-title,
.kdch-wrap .kdch-radar-center-value,
.kdch-wrap .kdch-element-row .name,
.kdch-wrap .kdchp-pick-title,
.kdch-wrap .kdch-hold-title{color:var(--pkds-text,#3b2a12)!important;fill:var(--pkds-text,#3b2a12)!important;}

.kdch-wrap .kdch-sub,
.kdch-wrap .kdch-small,
.kdch-wrap .kdch-flow-note,
.kdch-wrap .kdch-kv .k,
.kdch-wrap .kdch-pick-v2 .kdch-pick-v2-lead,
.kdch-wrap .kdch-pick-v2 .kdch-pick-v2-lead p,
.kdch-wrap .kdch-pick-v2 .skd-filter-head p,
.kdch-wrap .kdch-pick-v2 .skd-active-filters-note,
.kdch-wrap .kdch-sim-note,
.kdch-wrap .kdch-hold-note,
.kdch-wrap .kdch-hold-status{color:var(--pkds-text-mute,#8a734b)!important;}

.kdch-wrap .kdch-hold-card b,
.kdch-wrap .kdch-hold-field .kdch-input,
.kdch-wrap .kdch-kv .v{color:var(--pkds-text,#3b2a12)!important;}

.kdch-wrap .kdch-btn.kdch-btn-ghost,
.kdch-wrap .kdch-pick-v2 .kdch-btn-ghost{color:var(--pkds-red-1,#7f1414)!important;}


/* =========================================================
   KDCH NGU HANH TEXT VISIBILITY HOTFIX v1.7.3.8
   Sửa đúng gốc cho block ngũ hành + tứ trụ: tăng độ đọc, không đổi layout
   ========================================================= */
.kdch-wrap .kdch-card .kdch-h2{
  color:var(--pkds-text,#5a3b08)!important;
  letter-spacing:.012em!important;
}

.kdch-wrap .kdch-card .kdch-small,
.kdch-wrap .kdch-card .kdch-note-bottom,
.kdch-wrap .kdch-card .kdch-note-block{
  color:var(--pkds-text-soft,#7b6641)!important;
  line-height:1.82!important;
  letter-spacing:.008em!important;
}

.kdch-wrap .kdch-card .kdch-small.kdch-note-bottom,
.kdch-wrap .kdch-card .kdch-note-block.kdch-radar-summary{
  max-width:68ch;
}

.kdch-wrap .kdch-card .kdch-note-block b,
.kdch-wrap .kdch-card .kdch-small b{
  color:var(--pkds-text,#5a3b08)!important;
}

.kdch-wrap .kdch-radar-node-label{
  fill:var(--pkds-text,#5f4512)!important;
  font-size:12px!important;
  font-weight:900!important;
  letter-spacing:.01em!important;
}

.kdch-wrap .kdch-radar-node-value{
  fill:var(--pkds-red-1,#8a2a12)!important;
  font-size:11px!important;
  font-weight:900!important;
  letter-spacing:.01em!important;
}

.kdch-wrap .kdch-radar-center-title{
  fill:var(--pkds-text-soft,#8a734b)!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.05em!important;
}

.kdch-wrap .kdch-radar-center-value{
  fill:var(--pkds-text,#3b2a12)!important;
  font-size:18px!important;
  font-weight:950!important;
  letter-spacing:.01em!important;
}

.kdch-wrap .kdch-pillar-table thead th{
  letter-spacing:.05em!important;
}

.kdch-wrap .kdch-pillar-main{
  letter-spacing:.01em!important;
}

.kdch-wrap .kdch-pillar-sub{
  line-height:1.62!important;
  letter-spacing:.006em!important;
}


/* =========================================================
   KDCH NGU HANH COLOR TUNE v1.7.3.9
   Chỉ tinh chỉnh màu sắc cho dễ xem hơn, không đổi layout
   ========================================================= */
.kdch-wrap .kdch-radar-link{
  stroke:rgba(169,123,24,.34)!important;
}

.kdch-wrap .kdch-radar-node-label{
  fill:#4e3814!important;
}

.kdch-wrap .kdch-radar-node-value{
  fill:#8d1f14!important;
}

.kdch-wrap .kdch-radar-center-title{
  fill:#735a2b!important;
}

.kdch-wrap .kdch-radar-center-value{
  fill:#3b2a12!important;
}

.kdch-wrap .kdch-radar-summary,
.kdch-wrap .kdch-small.kdch-note-block.kdch-radar-summary{
  color:#7a6847!important;
}

.kdch-wrap .kdch-radar-summary b,
.kdch-wrap .kdch-small.kdch-note-block.kdch-radar-summary b{
  color:#5a3b08!important;
}
