/* ============================================================
 * Xem hướng bàn làm việc — kế thừa xtvc-* (xem-tuoi.css) cho form,
 * và bổ sung xhblv-* cho phần kết quả + la bàn SVG.
 * ============================================================ */

.xhblv-wrap { max-width: 980px; margin: 0 auto; }

/* ============ Result Header ============ */
.xhblv-result {
    margin-top: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5d9b8;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.xhblv-header {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
    align-items: center; padding-bottom: 16px;
    border-bottom: 2px solid #f0e6cc;
}
.xhblv-names strong { font-size: 18px; }
.xhblv-meta { color: #555; font-weight: 400; font-size: 14px; }
.xhblv-purpose-chip {
    display: inline-block; padding: 6px 14px; border-radius: 18px;
    background: linear-gradient(135deg,#b8860b,#d4a52f);
    color: #fff; font-weight: 600; font-size: 13px;
}

/* ============ TL;DR ============ */
.xhblv-tldr {
    margin: 20px 0; padding: 18px 20px;
    background: linear-gradient(135deg,#fff8e1,#fdf5d0);
    border-left: 5px solid #b8860b; border-radius: 8px;
}
.xhblv-tldr-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.xhblv-tldr-header h4 { margin: 0; color: #7b5a14; font-size: 16px; }
.xhblv-tldr-badge {
    display: inline-block; padding: 6px 14px;
    background: #b8860b; color: #fff;
    border-radius: 20px; font-weight: 700; font-size: 16px;
}
.xhblv-tldr-line { margin: 8px 0; font-size: 15.5px; line-height: 1.6; }
.xhblv-tldr-score {
    display: inline-block; margin-left: 8px;
    padding: 2px 8px; background: #fff; border: 1px solid #b8860b;
    border-radius: 4px; color: #7b5a14; font-weight: 600; font-size: 13px;
}
.xhblv-tldr-intro {
    margin: 6px 0 0; font-style: italic; color: #555;
    font-size: 14px;
}

/* ============ Section common ============ */
.xhblv-section {
    margin-top: 24px; padding-top: 18px;
    border-top: 1px solid #f0e6cc;
}
.xhblv-section-title {
    margin: 0 0 14px; color: #7b1414;
    font-size: 18px; font-weight: 700;
}
.xhblv-subtitle {
    margin: 18px 0 10px; color: #7b1414;
    font-size: 15px; font-weight: 600;
}

/* ============ Lá số rút gọn ============ */
.xhblv-mini-chart {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.xhblv-chip {
    padding: 6px 12px; background: #f9f3e0; border-radius: 16px;
    font-size: 13px; border: 1px solid #e5d9b8;
}
.xhblv-note {
    color: #555; font-style: italic; font-size: 14.5px;
    line-height: 1.5; margin: 6px 0 0;
}

/* ============ Compass SVG ============ */
.xhblv-compass-section { text-align: center; }
.xhblv-compass-wrap {
    display: flex; justify-content: center;
    margin: 8px auto 12px; max-width: 460px;
}
.xhblv-compass {
    width: 100%; height: auto; max-width: 400px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.08));
}
.xhblv-wedge { transition: opacity .2s; }
.xhblv-wedge-best { filter: brightness(1.05); }
.xhblv-compass-legend {
    display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
    margin-top: 10px; font-size: 12px; color: #666;
}
.xhblv-leg { white-space: nowrap; }
.xhblv-leg-best { color: #b8860b; font-weight: 600; }
.xhblv-leg-good { color: #3a8a3a; }
.xhblv-leg-bad  { color: #c33; }

/* ============ Direction list ============ */
.xhblv-dir-list { display: flex; flex-direction: column; gap: 10px; }
.xhblv-dir {
    display: flex; gap: 14px; padding: 14px 16px;
    border-radius: 8px; border: 1px solid #e5d9b8;
    background: #fff;
}
.xhblv-dir-good { border-left: 4px solid #3a8a3a; background: #f7fbef; }
.xhblv-dir-best {
    border-left: 5px solid #b8860b;
    background: linear-gradient(135deg,#fff8e1,#fdf5d0);
    box-shadow: 0 2px 8px rgba(184,134,11,.15);
}
.xhblv-dir-bad  { border-left: 4px solid #c33; background: #fdf2f2; }
.xhblv-dir-rank {
    flex: 0 0 36px; height: 36px; border-radius: 50%;
    background: #b8860b; color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.xhblv-dir-best .xhblv-dir-rank { background: #7b5a14; }
.xhblv-dir-body { flex: 1; }
.xhblv-dir-head {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 6px;
}
.xhblv-dir-name { font-size: 17px; color: #333; }
.xhblv-dir-best .xhblv-dir-name { color: #7b5a14; font-size: 18px; }
.xhblv-dir-khi {
    display: inline-block; padding: 2px 8px; background: #e6f4d6;
    color: #3a8a3a; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.xhblv-dir-khi-bad { background: #fde0e0; color: #c33; }
.xhblv-dir-score {
    padding: 2px 8px; background: #fff; border: 1px solid #b8860b;
    color: #7b5a14; border-radius: 4px; font-size: 12px; font-weight: 700;
}
.xhblv-dir-meaning { margin: 4px 0 6px; color: #444; font-size: 14px; }
.xhblv-dir-reasons {
    margin: 6px 0 0; padding-left: 18px; color: #666;
    font-size: 14px; line-height: 1.6;
}
.xhblv-dir-reasons li { margin: 2px 0; }

/* ============ Tip list ============ */
.xhblv-tip-list {
    margin: 8px 0 0; padding-left: 22px;
    line-height: 1.7; font-size: 15.5px; color: #333;
}
.xhblv-tip-list li { margin: 4px 0; }
.xhblv-tip-list-bad li::marker { color: #c33; }

/* ============ Matter (vật phẩm) ============ */
.xhblv-matter-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 10px;
}
.xhblv-matter-card {
    padding: 14px; background: #fdfaf3; border-radius: 8px;
    border: 1px solid #e5d9b8;
}
.xhblv-matter-card h4 {
    margin: 0 0 8px; color: #7b1414; font-size: 14px; font-weight: 700;
}
.xhblv-matter-card ul {
    margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6;
}
.xhblv-matter-card li { margin: 2px 0; }
.xhblv-matter-numbers .xhblv-numbers {
    margin: 8px 0 0; display: flex; gap: 8px; flex-wrap: wrap;
}
.xhblv-num-badge {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg,#b8860b,#d4a52f);
    color: #fff; display: inline-flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 16px;
}

/* ============ Lá số section ============ */
.xhblv-chart-section { background: #fdfaf3; padding: 16px; border-radius: 8px; }
.xhblv-chart-card {
    padding: 14px; background: #fff; border-radius: 8px;
    border: 1px solid #e5d9b8;
}
.xhblv-chart-subtitle {
    margin: 0 0 6px; color: #7b1414;
    font-size: 14px; font-weight: 600;
}
.xhblv-chart-group {
    margin: 0 0 6px; font-size: 15px;
}
.xhblv-chart-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 12px;
}
.xhblv-chart-card h4 {
    margin: 0 0 8px; color: #7b1414; font-size: 14px;
}
.xhblv-chart-stars { margin: 0 0 8px; }
.xhblv-star-chip {
    display: inline-block; padding: 3px 10px;
    background: linear-gradient(135deg,#7b1414,#a02828);
    color: #fff; border-radius: 12px; font-size: 12px;
    margin-right: 4px; margin-bottom: 4px;
}
.xhblv-chart-vibe {
    margin: 6px 0 0; color: #444; font-size: 15px;
    line-height: 1.6;
}
.xhblv-chart-hint {
    margin-top: 14px; padding: 12px 14px;
    background: #fff8e1; border-left: 4px solid #b8860b;
    border-radius: 6px; font-size: 15px; line-height: 1.6;
}

/* ============ Direction extended: relation + narrative + mitigation ============ */
.xhblv-dir-relation {
    display: inline-block; padding: 2px 8px; font-size: 11px;
    background: #f5e9c8; color: #7b5a14;
    border-radius: 10px; border: 1px solid #d4b783;
    font-weight: 500;
}
.xhblv-dir-relation-bisinh { background: #d4eccd; color: #2e6e22; border-color: #8cc977; }
.xhblv-dir-relation-cung   { background: #e8e8e8; color: #555;    border-color: #bbb; }
.xhblv-dir-relation-sinh   { background: #fff3c4; color: #7b5a14; border-color: #d4b783; }
.xhblv-dir-relation-khac   { background: #fde0d0; color: #a04020; border-color: #d49870; }
.xhblv-dir-relation-bikhac { background: #fde0e0; color: #c33;    border-color: #e09090; }
.xhblv-dir-narrative {
    margin: 8px 0; padding: 10px 12px;
    background: #fdfaf3; border-left: 3px solid #b8860b;
    border-radius: 4px; font-size: 15px; line-height: 1.65;
}
.xhblv-dir-narrative strong { color: #7b5a14; }
.xhblv-dir-narrative p { margin: 4px 0 0; }
.xhblv-dir-narrative-bad {
    background: #fef5f5; border-left-color: #c33;
}
.xhblv-dir-narrative-bad strong { color: #a02020; }
.xhblv-dir-mitigation {
    margin: 8px 0 0; padding: 10px 12px;
    background: #eef7e3; border-left: 3px solid #3a8a3a;
    border-radius: 4px; font-size: 15px; line-height: 1.65;
}
.xhblv-dir-mitigation strong { color: #2e6e22; }
.xhblv-dir-mitigation p { margin: 4px 0 0; }
.xhblv-dir-reasons-wrap {
    margin-top: 8px; font-size: 12.5px;
}
.xhblv-dir-reasons-wrap summary {
    cursor: pointer; color: #888;
    font-size: 12px; padding: 4px 0;
}
.xhblv-dir-reasons-wrap summary:hover { color: #b8860b; }
.xhblv-dir-reasons-wrap[open] summary { color: #7b5a14; font-weight: 600; }

/* ============ Tu Hoa (P5) ============ */
.xhblv-tuhoa-section { background: #fffaf0; padding: 16px; border-radius: 8px; }
.xhblv-tuhoa-summary {
    margin: 0 0 14px; padding: 10px 14px;
    background: #fff; border-left: 4px solid #b8860b;
    border-radius: 4px; font-size: 15.5px; line-height: 1.65;
}
.xhblv-tuhoa-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.xhblv-tuhoa-card {
    padding: 14px; background: #fff; border-radius: 8px;
    border: 1px solid #e5d9b8;
}
.xhblv-tuhoa-card h4 {
    margin: 0 0 10px; color: #7b1414; font-size: 14px;
    padding-bottom: 6px; border-bottom: 1px solid #f0e6cc;
}
.xhblv-tuhoa-item {
    margin: 0 0 12px; padding: 10px 12px;
    border-radius: 6px; background: #fdfaf3;
    border-left: 3px solid #b8860b;
}
.xhblv-tuhoa-item:last-child { margin-bottom: 0; }
.xhblv-tuhoa-name {
    display: block; margin-bottom: 6px;
    font-size: 14px; color: #7b5a14;
}
.xhblv-tuhoa-item p { margin: 0; font-size: 15px; line-height: 1.65; color: #333; }
.xhblv-tuhoa-hoa-loc   { border-left-color: #b8860b; background: #fff8e1; }
.xhblv-tuhoa-hoa-quyen { border-left-color: #7b1414; background: #fdf0f0; }
.xhblv-tuhoa-hoa-khoa  { border-left-color: #3a8a3a; background: #f4faec; }
.xhblv-tuhoa-hoa-ki    { border-left-color: #c33;    background: #fef5f5; }

/* ============ Bagua 9 cung mặt bàn (P6) ============ */
.xhblv-bagua-section { background: #fdfaf3; padding: 16px; border-radius: 8px; }
.xhblv-bagua-intro {
    margin: 0 0 14px; padding: 10px 14px;
    background: #fff; border-left: 4px solid #7b1414;
    border-radius: 4px; font-size: 15px; line-height: 1.65;
}
.xhblv-bagua-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0;
}
.xhblv-bagua-cell {
    padding: 12px; background: #fff;
    border: 1px solid #e5d9b8; border-radius: 6px;
    min-height: 140px;
}
.xhblv-bagua-priority {
    background: linear-gradient(135deg, #fff8e1, #fdf5d0);
    border: 2px solid #b8860b;
    box-shadow: 0 2px 8px rgba(184,134,11,.15);
}
.xhblv-bagua-cell-head {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.xhblv-bagua-icon { font-size: 18px; }
.xhblv-bagua-label { font-size: 13px; color: #7b1414; }
.xhblv-bagua-priority-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    background: #b8860b; color: #fff;
    border-radius: 8px; font-weight: 600;
}
.xhblv-bagua-items {
    margin: 0; padding-left: 16px;
    font-size: 12px; line-height: 1.55; color: #444;
}
.xhblv-bagua-items li { margin: 3px 0; }
.xhblv-bagua-legend {
    margin: 14px 0 0; padding: 8px;
    background: #fff; border-radius: 4px;
    font-size: 12px; color: #666; text-align: center;
}

/* Element accent borders for Bagua cells */
.xhblv-bagua-el-moc  { border-top: 3px solid #4a8b3a; }
.xhblv-bagua-el-hoa  { border-top: 3px solid #c33;    }
.xhblv-bagua-el-tho  { border-top: 3px solid #b8860b; }
.xhblv-bagua-el-kim  { border-top: 3px solid #9ea3a8; }
.xhblv-bagua-el-thuy { border-top: 3px solid #3d70b2; }

/* ============ Narrative (P7) ============ */
.xhblv-narrative-section {
    background: linear-gradient(135deg, #fdfaf3, #fff8e1);
    padding: 18px; border-radius: 8px;
    border: 1px solid #d4b783;
}
.xhblv-narrative-block {
    margin-bottom: 18px; padding: 14px 16px;
    background: #fff; border-radius: 6px;
    border-left: 4px solid #b8860b;
}
.xhblv-narrative-block:last-child { margin-bottom: 0; }
.xhblv-narrative-block h4 {
    margin: 0 0 10px; color: #7b1414;
    font-size: 15px; font-weight: 700;
}
.xhblv-narrative-block p {
    margin: 0; font-size: 15.5px; line-height: 1.75;
    color: #333; text-align: justify;
}
.xhblv-action-items {
    margin: 14px 0 0; padding-left: 22px;
    font-size: 15.5px; line-height: 1.7;
}
.xhblv-action-items li {
    margin: 8px 0; color: #333;
}

/* ============ Disclaimer ============ */
.xhblv-disclaimer {
    margin: 24px 0 0; padding: 12px;
    background: #fafafa; border-radius: 6px;
    color: #888; font-size: 14px; line-height: 1.6;
    text-align: center;
}

/* ============ Mobile ============ */
@media (max-width: 600px) {
    .xhblv-header { flex-direction: column; align-items: flex-start; }
    .xhblv-tldr-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .xhblv-dir { flex-direction: column; }
    .xhblv-dir-rank { flex: 0 0 auto; width: 36px; }
    .xhblv-compass-legend { gap: 8px; font-size: 11px; }
    .xhblv-matter-grid { grid-template-columns: 1fr 1fr; }
    .xhblv-bagua-grid {
        grid-template-columns: 1fr;
    }
    .xhblv-bagua-cell { min-height: auto; }
    .xhblv-tuhoa-grid { grid-template-columns: 1fr; }
}
