/* phong-thuy-style.css - Obsidian Gold and Neon Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark Mode (Default) */
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-input: #1f2937;
    --border-color: rgba(243, 198, 35, 0.2);
    --border-glow: rgba(243, 198, 35, 0.4);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #f59e0b; /* Amber / Gold */
    --primary-hover: #d97706;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --glass-blur: blur(12px);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    
    /* Compass Rings colors (Dark Theme) */
    --ring-bg-1: #111827;
    --ring-bg-2: #1f2937;
    --ring-line: #4b5563;
    --ring-text-yang: #ef4444;
    --ring-text-yin: #38bdf8;
    --ring-text-neutral: #cbd5e1;
}

[data-theme="light"] {
    /* Light Mode */
    --bg-main: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;
    --border-color: rgba(180, 130, 20, 0.2);
    --border-glow: rgba(180, 130, 20, 0.3);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --primary: #b45309; /* Darker Amber */
    --primary-hover: #92400e;
    --accent-red: #dc2626;
    --accent-green: #059669;
    --accent-blue: #2563eb;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Compass Rings colors (Light Theme) */
    --ring-bg-1: #ffffff;
    --ring-bg-2: #f9fafb;
    --ring-line: #9ca3af;
    --ring-text-yang: #dc2626;
    --ring-text-yin: #0284c7;
    --ring-text-neutral: #1f2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.preview-body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    overflow-x: hidden;
}
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* App Simulator Frame for Desktop */
.app-container {
    width: 100%;
    max-width: 540px; /* Standard phone width on desktop */
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding-bottom: 75px; /* Leave space for bottom nav bar */
}

/* On Tablet, make the frame look like a premium device shell */
@media (min-width: 768px) and (max-width: 991px) {
    body {
        padding: 20px 0;
    }
    .app-container {
        border-radius: 40px;
        min-height: 880px;
        height: 92vh;
        max-height: 960px;
        overflow-y: auto;
        border: 4px solid #1e293b;
    }
    
    /* Hide scrollbar but keep functionality */
    .app-container::-webkit-scrollbar {
        width: 6px;
    }
    .app-container::-webkit-scrollbar-track {
        background: transparent;
    }
    .app-container::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
}

/* Desktop Grid Layout (Screens 992px and above) */
@media (min-width: 992px) {
    body {
        display: block !important;
        padding: 0;
        background-color: var(--bg-main);
    }

    .app-container {
        max-width: 1200px;
        margin: 0 auto !important;
        min-height: 100vh;
        height: auto;
        max-height: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding-bottom: 90px !important; /* Leave space for bottom nav bar */
    }

    /* Keep bottom-nav fixed at the bottom on desktop */
    .ptth-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 1200px;
        height: 70px;
        background: var(--bg-card);
        backdrop-filter: var(--glass-blur);
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        border-radius: 0;
        padding: 0 20px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
    }

    .app-header {
        order: 1;
        border-bottom: 1px solid var(--border-color);
    }

    .app-content {
        order: 3;
        display: grid;
        grid-template-columns: 360px 1fr;
        gap: 24px;
        padding: 24px 20px;
        align-items: start;
    }

    /* Keep the Unified Input Card sticky on the left column */
    #unified-input-card {
        grid-column: 1;
        position: sticky;
        top: 80px;
        margin-bottom: 0;
    }

    /* Hide the collapse arrow on desktop and style title as default */
    #input-card-arrow {
        display: none !important;
    }
    #unified-input-card .card-title {
        cursor: default !important;
    }
    #input-card-body {
        display: block !important; /* Always display body on desktop */
    }

    /* Make the active tab content occupy the right column */
    .tab-content {
        grid-column: 2;
    }

    .tab-content.active {
        display: block;
    }

    .ptth-nav-item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        font-size: 0.8rem;
        padding: 0;
        height: 100%;
        transition: all 0.2s ease;
    }

    .ptth-nav-item.active {
        color: var(--primary);
        font-weight: 700;
    }

    .nav-icon {
        font-size: 1.2rem;
    }

    .pwa-badge {
        grid-column: 1 / span 2;
    }
}

/* Header Styling */
.app-header {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    box-shadow: 0 0 10px var(--border-glow);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle, .pwa-download {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
}

.theme-toggle:hover, .pwa-download:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--border-glow);
}

/* Main Content Area */
.app-content {
    padding: 20px;
    flex: 1;
}

/* App Card styling */
.app-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.app-card.neon-glow {
    box-shadow: 0 0 15px var(--border-glow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Unified Form Layout */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    flex: 0 0 100%;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary) !important;
}

.input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px var(--border-glow);
}

.radio-group, .checkbox-group {
    display: flex;
    gap: 16px;
    padding: 6px 0;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

input[type="radio"], input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    width: 100%;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

/* Bottom Navigation Bar */
.ptth-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    height: 70px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
}

@media (min-width: 768px) and (max-width: 991px) {
    .ptth-bottom-nav {
        border-bottom-left-radius: 36px;
        border-bottom-right-radius: 36px;
    }
}

.ptth-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    height: 100%;
}

.nav-icon {
    font-size: 1.35rem;
}

.ptth-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

/* Compass and Map Container */
.ptth-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 20px auto;
    aspect-ratio: 1;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ptth-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.ptth-google-map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.ptth-compass-dragger {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    cursor: move;
    transform-origin: center center;
}

#compass-canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    pointer-events: none;
    transform-origin: center center;
}

/* Compass Controls Sliders */
.ptth-compass-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px auto 0 auto;
    max-width: 720px;
    width: 100%;
}

.ptth-control-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ptth-control-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

input[type="range"] {
    accent-color: var(--primary);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

/* Dynamic sub-forms */
.dynamic-fields-section {
    display: none;
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.dynamic-fields-section.active {
    display: block;
}

/* Result Tables */
.result-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table.fengshui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-primary);
}

table.fengshui-table th {
    background: rgba(245, 158, 11, 0.1);
    color: var(--primary);
    font-weight: 600;
    padding: 10px;
    border: 1px solid var(--border-color);
}

table.fengshui-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* Grid layout for Flying Stars (3x3) */
.flying-stars-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 1;
    background: var(--border-color);
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
}

.palace-cell {
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px;
}

.palace-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    position: absolute;
    bottom: 4px;
}

.star-son {
    color: var(--accent-green);
    font-size: 1.15rem;
    font-weight: 700;
    position: absolute;
    top: 6px;
    left: 8px;
}

.star-huong {
    color: var(--accent-red);
    font-size: 1.15rem;
    font-weight: 700;
    position: absolute;
    top: 6px;
    right: 8px;
}

.star-van {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

.star-nien {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    position: absolute;
    bottom: 20px;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Color Coding Alerts */
.cung-cat {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid var(--accent-green) !important;
}

.cung-benh {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid var(--primary) !important;
}

.cung-hung {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid var(--accent-red) !important;
}

/* Popups and Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Accordion Lessons */
.chapter-accordion {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.chapter-header {
    background: rgba(245, 158, 11, 0.05);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.chapter-body {
    display: none;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.lesson-item {
    border-bottom: 1px solid rgba(243, 198, 35, 0.1);
    padding: 10px 0;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-title {
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
}

.lesson-body {
    display: none;
    padding: 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Energy Flow particle container overlay */
.flow-simulation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* Multi-year Grid Selector */
.multi-year-grid-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-input);
}

.year-btn-select {
    padding: 6px;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
}

.year-btn-select.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* PWA App Promo Badge */
.pwa-badge {
    background: rgba(245, 158, 11, 0.1);
    border: 1.5px dashed var(--primary);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pwa-text {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Day recommendations list */
.day-recommendations {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.day-rec-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-rec-item.good-day {
    border-left: 4px solid var(--accent-green);
}

.day-rec-item.neutral-day {
    border-left: 4px solid var(--primary);
}


/* ==========================================================================
   MERGED STYLES FROM ORIGINAL PLUGINS
   ========================================================================== */

/* --- Source: huyen-khong-phi-tinh - huyen-khong.css --- */
/* huyen-khong.css */

.hkpt-wrapper {
    font-family: Arial, sans-serif;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.hkpt-header {
    text-align: center;
    border-bottom: 2px solid #6a1b9a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.hkpt-title {
    color: #6a1b9a;
    margin: 0 0 5px 0;
    font-size: 2rem;
}

.hkpt-tagline {
    color: #777;
    margin: 0;
    font-style: italic;
}

.hkpt-intro {
    background: #fdfdfd;
    border-left: 4px solid #6a1b9a;
    padding: 10px 15px;
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

/* FORM */
.hkpt-form-section {
    background: #fff9e6;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
}

.hkpt-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.hkpt-form-col {
    flex: 1;
    min-width: 300px;
}

.hkpt-form-group-title {
    margin-bottom: 15px;
    border-bottom: 2px solid #ccc;
    display: flex;
    justify-content: space-between;
}

.hkpt-form-group-title h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #444;
}

.hkpt-form-group {
    margin-bottom: 15px;
}

.hkpt-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.hkpt-radio-group label {
    display: inline-block;
    font-weight: normal;
    margin-right: 15px;
}

.hkpt-note {
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
}

.hkpt-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#hkpt-degree {
    width: 120px;
    display: inline-block;
}

.hkpt-btn-lap {
    display: inline-block;
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hkpt-btn-lap:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(106,27,154,0.4);
}

/* Canvas Container */
.ptth-hkpt-canvas-container {
    position: relative;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 720px;
    margin: 15px auto 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.hkpt-ptth-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Draggable wrapper for compass */
.hkpt-ptth-compass-dragger {
    position: absolute;
    z-index: 2;
    cursor: grab;
    transform-origin: center center;
    text-align: center;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hkpt-ptth-compass-dragger:active {
    cursor: grabbing;
}

#hkpt-compass-canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.hkpt-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    margin: 15px auto 0 auto;
}

#hkpt-controls-sliders {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hkpt-btn-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.hkpt-btn-action:active {
    transform: translateY(0);
}

.hkpt-ptth-control-item {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hkpt-ptth-control-item label {
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    color: #333 !important;
    margin-bottom: 2px;
}

.hkpt-ptth-control-item input[type="range"] {
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.hkpt-summary-box {
    background: #f0f4f8;
    border-left: 4px solid #1976d2;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Hoc huyen khong toggle sections (similar to Ky Mon) */
.hkpt-learn-section { margin-top: 40px; padding-top: 20px; border-top: 2px dashed #eee; }
.hkpt-chapter { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; }
.hkpt-chapter-header { background: #f5f5f5; padding: 15px; cursor: pointer; display: flex; align-items: center; font-weight: bold; }
.hkpt-chapter-header:hover { background: #eaeaea; }
.hkpt-chapter-title { flex-grow: 1; margin-left: 10px; }
.hkpt-chapter-body { display: none; padding: 15px; border-top: 1px solid #ddd; }
.hkpt-lesson-item { margin-bottom: 10px; border: 1px solid #eee; border-radius: 5px; }
.hkpt-lesson-toggle { background: #fafafa; padding: 10px 15px; cursor: pointer; display: flex; align-items: center; }
.hkpt-lesson-toggle:hover { background: #f0f0f0; }
.hkpt-lesson-title { flex-grow: 1; margin-left: 10px; font-weight: 500; color: #444; }
.hkpt-lesson-body { display: none; padding: 15px; line-height: 1.6; color: #555; background: #fff; border-top: 1px dashed #eee;}
.hkpt-lesson-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.hkpt-lesson-table th, .hkpt-lesson-table td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.hkpt-lesson-table th { background: #f5f5f5; }

.hkpt-footer { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; color: #777; }


/* --- Source: huyen-khong-dai-quai - hkdq-style.css --- */
/* huyen-khong-dai-quai.css */

.hkdq-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #fffdf5; /* Warm light yellow tint to match the image UI */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 1000px;
    margin: 0 auto 30px auto;
}

.hkdq-header {
    text-align: center;
    border-bottom: 2px solid #f5b041;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.hkdq-title {
    color: #e65100;
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 700;
}

.hkdq-tagline {
    font-size: 16px;
    color: #5d4037;
    margin: 0;
    font-style: italic;
}

.hkdq-intro {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    background: #fff8e1;
    padding: 15px;
    border-left: 4px solid #f5b041;
    border-radius: 4px;
}

/* Form Styles */
.hkdq-form-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #ffe082;
}

.hkdq-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.hkdq-form-group-title {
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.hkdq-form-group-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #4e342e;
    text-transform: uppercase;
    flex: 1;
}

.hkdq-form-col {
    flex: 1;
    min-width: 300px;
}

.hkdq-form-group {
    margin-bottom: 15px;
}

.hkdq-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.hkdq-input, .hkdq-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.hkdq-input:focus {
    outline: none;
    border-color: #f5b041;
    box-shadow: 0 0 5px rgba(245, 176, 65, 0.3);
}

.hkdq-radio-group, .hkdq-checkbox-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.hkdq-radio-group label, .hkdq-checkbox-group label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin-bottom: 0;
    color: #333;
}

/* Buttons */
.hkdq-btn-lap {
    background: #e65100;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 15px 40px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(230, 81, 0, 0.3);
}

.hkdq-btn-lap:hover {
    background: #bf360c;
    transform: translateY(-2px);
}

/* Summary Box */
.hkdq-summary-box {
    background: #e8f5e9;
    border: 1px solid #81c784;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Canvas Area - Responsive aspects */
.ptth-hkdq-canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Perfect square container */
    max-width: 800px;
    background: #fafafa;
    border: 2px solid #eceff1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 auto;
}

.hkdq-ptth-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transform-origin: center center;
}

.hkdq-ptth-compass-dragger {
    position: absolute;
    z-index: 2;
    cursor: grab;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 1 / 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.hkdq-ptth-compass-dragger:active {
    cursor: grabbing;
}

#hkdq-compass-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    pointer-events: none; /* Drag events pass to container */
    opacity: 0.85;
}

/* Controls Panel - Outside the Canvas for Mobile Responsiveness */
.hkdq-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 800px;
    margin: 15px auto 20px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hkdq-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

#hkdq-controls-sliders {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hkdq-ptth-control-item {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hkdq-ptth-control-item label {
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    color: #4e342e !important;
    margin-bottom: 2px;
}

.hkdq-ptth-control-item input[type="range"] {
    width: 100%;
    cursor: pointer;
    margin: 0;
}

/* Action buttons */
.hkdq-canvas-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hkdq-btn-action {
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.1s;
}

.hkdq-btn-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.hkdq-btn-download {
    background: #1976d2;
}

.hkdq-btn-copy {
    background: #388e3c;
}

/* AI Section Links */
.hkdq-ai-links {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hkdq-btn-ai-link {
    text-decoration: none;
    padding: 10px 18px;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hkdq-btn-ai-link:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.hkdq-btn-gemini {
    background: #1a73e8;
}

.hkdq-btn-chatgpt {
    background: #10a37f;
}

/* 8 Directions Table */
.hkdq-directions-table-section {
    margin-top: 30px;
    background: #ffffff;
    border: 1px solid #ffe082;
    padding: 20px;
    border-radius: 8px;
}

.hkdq-directions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.hkdq-directions-table th {
    background: #fff8e1;
    border: 1px solid #ffe082;
    font-weight: bold;
    color: #4e342e;
    padding: 10px;
}

.hkdq-directions-table td {
    padding: 10px;
    border: 1px solid #eee;
    color: #333;
}

.hkdq-directions-table tr:nth-child(even) td {
    background: #fafafa;
}

/* AI Document Luận Giải */
.hkdq-analysis-doc {
    background: #ffffff;
    border: 1px solid #ffd54f;
    border-radius: 8px;
    padding: 25px;
    color: #333;
}

.hkdq-doc-section {
    margin-top: 20px;
}

.hkdq-doc-section h4 {
    margin: 0 0 10px 0;
    color: #e65100;
    font-size: 1.15rem;
    border-left: 4px solid #e65100;
    padding-left: 10px;
}

.hkdq-doc-section p, .hkdq-doc-section ul {
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Footer */
.hkdq-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 14px;
}

.hkdq-footer p {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hkdq-form-row {
        flex-direction: column;
    }
    
    .hkdq-form-group-title {
        display: none;
    }
    
    .ptth-hkdq-canvas-container {
        max-width: 100%;
        height: auto;
    }
    
    .hkdq-ptth-control-item {
        flex: 100%;
    }
}

/* Learn Section & Accordion Styles */
.hkdq-learn-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed #f5b041;
}

.hkdq-learn-header {
    background: #e65100;
    color: #fff;
    padding: 18px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(230, 81, 0, 0.15);
    margin-bottom: 25px;
}

.hkdq-learn-header h3 {
    margin: 0;
    font-size: 1.55em;
    font-weight: 700;
}

.hkdq-learn-header p {
    margin: 6px 0 0 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.hkdq-chapter {
    margin-bottom: 15px;
    border: 1px solid #ffd54f;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.hkdq-chapter-header {
    background: #fffdf5;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #e65100;
    border-bottom: 1px solid #ffe082;
    transition: background 0.2s;
}

.hkdq-chapter-header:hover {
    background: #fff8e1;
}

.hkdq-chapter-title {
    flex-grow: 1;
    margin-left: 10px;
    font-size: 1.05rem;
}

.hkdq-chapter-body {
    display: none;
    padding: 20px;
    background: #ffffff;
}

.hkdq-lesson-item {
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.hkdq-lesson-toggle {
    background: #f8fafc;
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.hkdq-lesson-toggle:hover {
    background: #f1f5f9;
}

.hkdq-lesson-title {
    flex-grow: 1;
    margin-left: 10px;
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}

.hkdq-lesson-body {
    display: none;
    padding: 15px 20px;
    line-height: 1.7;
    color: #334155;
    background: #fff;
    font-size: 0.95rem;
}

.hkdq-lesson-body p {
    margin-top: 0;
    margin-bottom: 12px;
}

.hkdq-lesson-body ul, .hkdq-lesson-body ol {
    margin-top: 0;
    margin-bottom: 12px;
    padding-left: 20px;
}

.hkdq-lesson-body li {
    margin-bottom: 6px;
}

.hkdq-lesson-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.92rem;
}

.hkdq-lesson-table th, .hkdq-lesson-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
}

.hkdq-lesson-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: bold;
}

.hkdq-lesson-table tr:nth-child(even) td {
    background: #f8fafc;
}



/* --- Source: ky-mon-don-giap - ky-mon.css --- */
/* ============================================================
   KỲ MÔN ĐỘN GIÁP — Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

.kmdg-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ========== HEADER ========== */
.kmdg-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 20px;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 30%, #4a1942 60%, #1a0a2e 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.kmdg-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 60%);
    animation: kmdg-rotate 25s linear infinite;
}

.kmdg-header::after {
    content: '奇門遁甲';
    position: absolute;
    bottom: 15px; right: 25px;
    font-size: 14px;
    color: rgba(255,255,255,0.12);
    letter-spacing: 4px;
}

@keyframes kmdg-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.kmdg-logo-img {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    position: relative; z-index: 1;
    box-shadow: 0 0 30px rgba(212,175,55,0.5);
    border: 3px solid rgba(212,175,55,0.6);
    animation: kmdg-pulse 3s ease-in-out infinite;
}

@keyframes kmdg-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(212,175,55,0.5); }
    50% { transform: scale(1.04); box-shadow: 0 0 45px rgba(212,175,55,0.7); }
}

.kmdg-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 700;
    color: #d4af37;
    margin: 10px 0 5px;
    position: relative; z-index: 1;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.kmdg-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    position: relative; z-index: 1;
    margin: 0;
    letter-spacing: 2px;
}

/* ========== INTRO ========== */
.kmdg-intro {
    background: linear-gradient(135deg, #fdf8f0, #f8f4ec);
    border-left: 4px solid #4a1942;
    padding: 25px 30px;
    margin-bottom: 30px;
    border-radius: 0 12px 12px 0;
    font-size: 14.5px;
    line-height: 1.85;
    color: #333;
}

.kmdg-intro strong { color: #4a1942; }
.kmdg-intro p:last-child { margin-bottom: 0; }

/* ========== TABS ========== */
.kmdg-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    background: #2d1b4e;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.kmdg-tab {
    flex: 1;
    padding: 14px 10px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.kmdg-tab:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.kmdg-tab.active {
    background: #e8740c;
    color: white;
    box-shadow: 0 2px 10px rgba(232,116,12,0.4);
}

/* ========== FORM ========== */
.kmdg-form-section {
    background: #fff;
    border: 1px solid #e0e4e8;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.kmdg-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.kmdg-form-group {
    flex: 1;
    min-width: 120px;
}

.kmdg-form-group.kmdg-full {
    flex: 1 0 100%;
}

.kmdg-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kmdg-form-group label small {
    text-transform: none;
    font-weight: 400;
    color: #999;
}

.kmdg-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 14px;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafbfc;
}

.kmdg-input:focus {
    border-color: #4a1942;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,25,66,0.1);
    background: #fff;
}

.kmdg-btn-group {
    min-width: 190px;
}

.kmdg-btn-row {
    display: flex;
    gap: 6px;
}

.kmdg-btn-now {
    flex: 1;
    height: 46px;
    border: 2px solid #4a1942;
    background: transparent;
    color: #4a1942;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.kmdg-btn-now:hover {
    background: #4a1942;
    color: white;
}

.kmdg-btn-adjust {
    width: 46px;
    height: 46px;
    border: 2px solid #e0e4e8;
    background: #fff;
    color: #555;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.kmdg-btn-adjust:hover {
    border-color: #4a1942;
    color: #4a1942;
}

.kmdg-form-actions {
    text-align: center;
    margin-top: 5px;
}

.kmdg-btn-lap {
    background: linear-gradient(135deg, #e8740c, #d4630a);
    color: white;
    border: none;
    padding: 15px 50px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(232,116,12,0.35);
}

.kmdg-btn-lap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(232,116,12,0.5);
}

.kmdg-btn-lap:active {
    transform: translateY(0);
}

/* ========== FOUR PILLARS ========== */
.kmdg-pillars {
    margin-bottom: 20px;
}

.kmdg-pillars-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 2px solid #e8740c;
    border-radius: 8px;
    overflow: hidden;
}

.kmdg-pillars-table th {
    background: #e8740c;
    color: white;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.kmdg-can-cell {
    text-align: center;
    padding: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #4a1942;
    border-bottom: 1px solid #f0e8e0;
}

.kmdg-chi-cell {
    text-align: center;
    padding: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #e8740c;
}

.kmdg-label-cell {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 8px;
    background: #fdf8f0;
    white-space: nowrap;
}

/* ========== INFO BAR ========== */
.kmdg-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #2d1b4e, #4a1942);
    padding: 16px 20px;
    border-radius: 10px;
}

.kmdg-info-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.kmdg-info-label {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.kmdg-info-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #d4af37;
}

.kmdg-cuc-value {
    font-size: 15px;
    color: #ff9500;
}

/* ========== CỬU CUNG GRID ========== */
.kmdg-cuu-cung-wrapper {
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kmdg-direction-top, .kmdg-direction-bottom {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 6px 0;
    letter-spacing: 4px;
    min-width: 480px;
}

.kmdg-cung-container {
    display: flex;
    align-items: stretch;
    min-width: 480px;
    justify-content: center;
}

.kmdg-direction-left, .kmdg-direction-right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 13px;
    color: #888;
    padding: 0 10px;
    text-align: center;
    line-height: 1.8;
}

.kmdg-grid-3x3 {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border: 3px solid #4a1942;
    border-radius: 4px;
    overflow: hidden;
}

/* ========== PALACE CELL ========== */
.kmdg-palace {
    border: 1px solid #d4c4a0;
    padding: 10px 8px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #fffcf4, #fff8ec);
    position: relative;
    transition: all 0.3s;
}

.kmdg-palace:hover {
    background: linear-gradient(180deg, #fff5dd, #ffedcc);
    z-index: 2;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.kmdg-palace-kw {
    background: linear-gradient(180deg, #f5f0f0, #ece5e5) !important;
    opacity: 0.8;
}

.kmdg-palace-center {
    background: linear-gradient(135deg, #fdf2e0, #f8e8d0) !important;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.kmdg-center-can {
    font-size: 36px;
    font-weight: 700;
    color: #4a1942;
}

.kmdg-center-label {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

.kmdg-center-time {
    font-size: 12px;
    color: #e8740c;
    font-weight: 600;
    margin-top: 3px;
}

/* Palace content */
.kmdg-p-deity {
    font-size: 11px;
    color: #7b2d8e;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.kmdg-p-main {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 4px 0;
}

.kmdg-p-star {
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
}

.kmdg-p-gate {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
}

.kmdg-p-cans {
    display: flex;
    justify-content: space-around;
    margin: 4px 0;
}

.kmdg-p-tcan {
    font-size: 14px;
    font-weight: 600;
    color: #2980b9;
}

.kmdg-p-dcan {
    font-size: 14px;
    font-weight: 600;
    color: #8b6914;
}

.kmdg-p-footer {
    font-size: 10px;
    color: #888;
    text-align: center;
    border-top: 1px solid #e8dcc8;
    padding-top: 4px;
    margin-top: 4px;
}

.kmdg-p-trigram {
    font-size: 13px;
}

.kmdg-p-number {
    font-weight: 700;
    color: #4a1942;
}

.kmdg-kw-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* ========== PHONE BAR ========== */
.kmdg-phone-bar {
    text-align: center;
    padding: 10px;
    background: #fdf8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.kmdg-phone-bar a {
    color: #e8740c;
    font-weight: 700;
    text-decoration: none;
}

/* ========== INTERPRETATION ========== */
.kmdg-interpretation {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.kmdg-interpretation h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #4a1942;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0e8e0;
}

.kmdg-interpretation h4 {
    font-size: 16px;
    color: #4a1942;
    margin: 18px 0 8px;
}

.kmdg-interp-item {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin: 4px 0;
    padding-left: 10px;
}

.kmdg-interp-item strong {
    color: #4a1942;
}

/* ========== RAW TEXT ========== */
.kmdg-rawtext {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.kmdg-rawtext h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #4a1942;
    margin: 0 0 8px;
}

.kmdg-rawtext-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.kmdg-rawtext-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    font-family: monospace;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.kmdg-btn-copy {
    background: #4a1942;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.kmdg-btn-copy:hover {
    background: #6b2a63;
    transform: translateY(-1px);
}

/* ========== FOOTER ========== */
.kmdg-footer {
    text-align: center;
    padding: 25px;
    margin-top: 30px;
    border-top: 2px solid #f0e8e0;
    color: #888;
    font-size: 13px;
}

.kmdg-phone {
    margin-top: 5px;
}

.kmdg-phone a {
    color: #e8740c;
    font-weight: 700;
    text-decoration: none;
    font-size: 16px;
}

/* ========== KNOWLEDGE SECTION ========== */
.kmdg-learn-section {
    margin-top: 40px;
    border-top: 3px solid #4a1942;
    padding-top: 30px;
}

.kmdg-learn-header {
    text-align: center;
    margin-bottom: 25px;
}

.kmdg-learn-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #4a1942;
    margin-bottom: 8px;
}

.kmdg-learn-header p {
    color: #888;
    font-size: 14px;
}

.kmdg-chapter {
    margin-bottom: 12px;
}

.kmdg-chapter-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, #4a1942 0%, #2d1b4e 100%);
    color: #fff;
    border-radius: 10px;
    transition: all 0.3s;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74,25,66,0.25);
}

.kmdg-chapter-header:hover {
    box-shadow: 0 4px 15px rgba(74,25,66,0.4);
    transform: translateY(-1px);
}

.kmdg-chapter-header.active {
    border-radius: 10px 10px 4px 4px;
}

.kmdg-chapter-icon {
    font-size: 24px;
    margin-right: 12px;
}

.kmdg-chapter-title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
}

.kmdg-chapter-body {
    display: none;
    background: #f5f0f5;
    border-radius: 0 0 10px 10px;
    padding: 12px;
    animation: kmdg-slideIn 0.3s ease;
}

@keyframes kmdg-slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kmdg-lesson-item {
    border: 1px solid #e5dde5;
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}

.kmdg-lesson-toggle {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s;
    user-select: none;
}

.kmdg-lesson-toggle:hover { background: #fdf8f0; }

.kmdg-lesson-toggle.active {
    background: #4a1942;
    color: white;
}

.kmdg-lesson-toggle.active .kmdg-lesson-title { color: white; }
.kmdg-lesson-toggle.active .kmdg-lesson-arrow { color: #d4af37; }

.kmdg-lesson-icon {
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
}

.kmdg-lesson-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.kmdg-lesson-arrow {
    font-size: 16px;
    color: #999;
    margin-left: 10px;
    transition: transform 0.3s;
}

.kmdg-lesson-body {
    display: none;
    padding: 18px 22px;
    background: #fafbfc;
    border-top: 1px solid #e5dde5;
    font-size: 13.5px;
    line-height: 1.8;
    color: #444;
    animation: kmdg-slideIn 0.3s ease;
}

.kmdg-lesson-body h5 {
    font-size: 14px;
    color: #4a1942;
    margin: 14px 0 6px;
}

.kmdg-lesson-body ul, .kmdg-lesson-body ol {
    padding-left: 20px;
    margin: 8px 0;
}

.kmdg-lesson-body li { margin-bottom: 5px; }
.kmdg-lesson-body strong { color: #4a1942; }

.kmdg-lesson-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12.5px;
}

.kmdg-lesson-table th {
    background: #4a1942;
    color: white;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}

.kmdg-lesson-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5dde5;
}

.kmdg-lesson-table tr:nth-child(even) td { background: #fdf8f0; }
.kmdg-lesson-table tr:hover td { background: #f5eff5; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .kmdg-tabs { flex-wrap: wrap; }
    .kmdg-tab { flex: 1 0 50%; font-size: 12px; padding: 12px 6px; }
    .kmdg-form-row { flex-direction: column; }
    .kmdg-form-group { min-width: 100%; }
    .kmdg-info-bar { gap: 8px; }
    .kmdg-info-item { min-width: 80px; }
    .kmdg-grid-3x3 { font-size: 11px; }
    .kmdg-palace { padding: 6px 4px; min-height: 90px; }
    .kmdg-p-star { font-size: 13px; }
    .kmdg-p-gate { font-size: 14px; }
    .kmdg-p-tcan, .kmdg-p-dcan { font-size: 12px; }
    .kmdg-center-can { font-size: 28px; }
    .kmdg-direction-left, .kmdg-direction-right { font-size: 11px; padding: 0 4px; }
    .kmdg-can-cell, .kmdg-chi-cell { font-size: 18px; padding: 8px; }
    .kmdg-pillars-table th { font-size: 12px; padding: 8px; }
}

@media (max-width: 480px) {
    .kmdg-wrapper { padding: 20px 10px; }
    .kmdg-title { font-size: 26px; }
    .kmdg-header { padding: 35px 15px; }
    .kmdg-palace { min-height: 75px; padding: 4px 3px; }
    .kmdg-p-deity { font-size: 9px; }
    .kmdg-p-star { font-size: 11px; }
    .kmdg-p-gate { font-size: 12px; }
    .kmdg-p-footer { font-size: 8px; }
    .kmdg-btn-lap { padding: 12px 30px; font-size: 15px; }
}


/* --- Source: luc-nham-dai-don - style.css --- */
/* ============================================================
   LỤC NHÂM ĐẠI ĐỘN — Stylesheet
   Motip tương tự Kỳ Môn Độn Giáp — Học Viện Tâm An
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

.lndd-body-dummy {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f4f1ec;
    color: #333;
}

.lndd-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ========== HEADER ========== */
.lndd-header {
    text-align: center;
    margin-bottom: 35px;
    padding: 45px 20px;
    background: linear-gradient(135deg, #0a1628 0%, #1a2744 30%, #2a1a3e 60%, #0a1628 100%);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.lndd-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(78,205,196,0.07) 0%, transparent 60%);
    animation: lndd-rotate 30s linear infinite;
}

.lndd-header::after {
    content: '大六壬';
    position: absolute;
    bottom: 12px; right: 22px;
    font-size: 15px;
    color: rgba(255,255,255,0.1);
    letter-spacing: 5px;
}

@keyframes lndd-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lndd-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: #4ecdc4;
    margin: 0 0 6px;
    position: relative; z-index: 1;
    letter-spacing: 3px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.lndd-tagline {
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    position: relative; z-index: 1;
    margin: 0;
    letter-spacing: 2px;
}

/* ========== FORM ========== */
.lndd-form-section {
    background: #fff;
    border: 1px solid #dde1e6;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.lndd-form-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a2744;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4ecdc4;
    display: inline-block;
}

.lndd-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lndd-form-group {
    flex: 1;
    min-width: 100px;
}

.lndd-form-group.lndd-wide {
    flex: 2;
    min-width: 200px;
}

.lndd-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lndd-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 2px solid #dde1e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafbfc;
}

.lndd-input:focus {
    border-color: #4ecdc4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78,205,196,0.15);
    background: #fff;
}

.lndd-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: center;
}

.lndd-btn-now {
    height: 42px;
    padding: 0 20px;
    border: 2px solid #1a2744;
    background: transparent;
    color: #1a2744;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lndd-btn-now:hover {
    background: #1a2744;
    color: white;
}

/* ========== QUESTION SECTION ========== */
.lndd-birth-note {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin: 4px 0 0;
}

.lndd-question-section h3 {
    border-bottom-color: #9b59b6;
}

.lndd-optional {
    font-size: 12px;
    font-weight: 400;
    color: #999;
}

.lndd-question-input {
    height: 48px !important;
    font-size: 15px !important;
    border-left: 4px solid #9b59b6 !important;
    padding-left: 16px !important;
    background: #faf8fc !important;
}

.lndd-question-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.lndd-question-input:focus {
    border-color: #9b59b6 !important;
    box-shadow: 0 0 0 3px rgba(155,89,182,0.12) !important;
}

.lndd-btn-lap {
    background: linear-gradient(135deg, #4ecdc4, #44b8b0);
    color: white;
    border: none;
    padding: 14px 45px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(78,205,196,0.35);
}

.lndd-btn-lap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(78,205,196,0.5);
}

.lndd-btn-lap:active { transform: translateY(0); }

/* ========== RESULT: HEADER INFO ========== */
.lndd-header-info {
    background: linear-gradient(135deg, #1a2744, #2a1a3e);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 18px;
    color: white;
}

.lndd-info-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.lndd-info-left, .lndd-info-right {
    flex: 1;
    min-width: 280px;
}

.lndd-info-row {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.6;
}

.lndd-info-label {
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lndd-highlight {
    color: #4ecdc4;
    font-weight: 600;
}

.lndd-kv-text {
    color: #ff6b6b;
    font-size: 12px;
}

.lndd-time-display {
    font-size: 15px;
    font-weight: 700;
    color: #4ecdc4;
    margin-bottom: 8px;
}

.lndd-nt-value {
    color: #ffd93d;
    font-weight: 700;
    font-size: 14px;
}

/* ========== MAIN 4×4 GRID ========== */
.lndd-main-grid-wrapper {
    margin-bottom: 20px;
}

.lndd-dir-top, .lndd-dir-bottom {
    display: flex;
    justify-content: space-around;
    padding: 4px 50px;
    font-size: 12px;
    color: #888;
    letter-spacing: 2px;
}

.lndd-grid-container {
    display: flex;
    align-items: stretch;
}

.lndd-dir-left, .lndd-dir-right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 8px;
    font-size: 12px;
    color: #888;
    text-align: center;
    min-width: 40px;
}

.lndd-grid-4x4 {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    border: 3px solid #1a2744;
    border-radius: 4px;
    overflow: hidden;
}

/* ========== PALACE CELL ========== */
.lndd-palace {
    border: 1px solid #c4b896;
    padding: 8px 6px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fffef8, #fdf8ec);
    position: relative;
    transition: all 0.2s;
}

.lndd-palace:hover {
    background: linear-gradient(180deg, #fff5dd, #ffedcc);
    z-index: 2;
    box-shadow: 0 0 12px rgba(0,0,0,0.1);
}

.lndd-cell-kv {
    background: linear-gradient(180deg, #f5efef, #ece3e3) !important;
    opacity: 0.85;
}

.lndd-cell-tt {
    border-color: #e74c3c !important;
    border-width: 2px;
}

.lndd-p-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e8dcc8;
}

.lndd-p-diban {
    font-size: 10px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lndd-p-thienban {
    font-size: 16px;
    font-weight: 700;
}

.lndd-p-general {
    font-size: 12px;
    color: #7b2d8e;
    font-weight: 700;
    text-align: center;
    margin: 3px 0;
}

.lndd-p-nt {
    font-size: 11px;
    color: #2980b9;
    text-align: center;
    font-weight: 500;
}

.lndd-p-lucthan {
    font-size: 11px;
    color: #c0392b;
    text-align: center;
    font-weight: 600;
    margin: 2px 0;
}

.lndd-p-thansat {
    font-size: 10px;
    color: #e67e22;
    text-align: center;
    margin-top: 1px;
    line-height: 1.3;
}

.lndd-p-kv-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #e74c3c;
    color: white;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* ========== CENTER CELLS ========== */
.lndd-center-cell {
    border: 1px solid #c4b896;
    padding: 8px;
    background: linear-gradient(135deg, #fef9ee, #f8f0dc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lndd-center-title {
    font-size: 11px;
    font-weight: 700;
    color: #1a2744;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-align: center;
}

/* Thời Khóa mini table */
.lndd-tk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.lndd-tk-table th {
    background: #1a2744;
    color: white;
    padding: 3px 4px;
    font-size: 9px;
    font-weight: 600;
}

.lndd-tk-table td {
    padding: 3px 4px;
    text-align: center;
    font-size: 10px;
    border-bottom: 1px solid #e8dcc8;
    color: #333;
    font-weight: 500;
}

.lndd-tk-kv td {
    font-size: 9px;
    color: #e74c3c;
}

/* Nguyệt Tướng center */
.lndd-nt-big {
    font-size: 28px;
    font-weight: 700;
    color: #1a2744;
    text-align: center;
    line-height: 1.2;
}

.lndd-nt-name {
    font-size: 11px;
    color: #2980b9;
    text-align: center;
    margin-bottom: 6px;
}

.lndd-can-chi-table {
    border-collapse: collapse;
    margin-top: 4px;
}

.lndd-can-chi-table .lndd-label {
    font-size: 9px;
    color: #888;
    text-align: center;
    padding: 2px 10px;
}

.lndd-can-chi-table .lndd-val {
    font-size: 14px;
    font-weight: 700;
    color: #4a1942;
    text-align: center;
    padding: 2px 10px;
}

/* Tứ Khóa table */
.lndd-tukhoa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.lndd-tukhoa-table th {
    background: #2a1a3e;
    color: white;
    padding: 3px 4px;
    font-size: 9px;
}

.lndd-tukhoa-table td {
    padding: 3px 4px;
    text-align: center;
    border-bottom: 1px solid #e8dcc8;
}

.lndd-general-name {
    font-size: 9px;
    color: #7b2d8e;
    font-weight: 600;
}

.lndd-tk-top {
    font-size: 12px;
    font-weight: 700;
    color: #c0392b;
}

.lndd-tk-bot {
    font-size: 12px;
    font-weight: 600;
    color: #2980b9;
}

/* Tam Truyền table */
.lndd-tamtruyen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.lndd-tamtruyen-table th {
    background: #c0392b;
    color: white;
    padding: 3px 4px;
    font-size: 9px;
}

.lndd-tamtruyen-table td {
    padding: 3px 4px;
    text-align: center;
    border-bottom: 1px solid #e8dcc8;
    font-size: 11px;
}

.lndd-tt-label {
    font-weight: 700;
    color: #c0392b;
}

.lndd-tt-branch {
    font-weight: 700;
    color: #1a2744;
    font-size: 13px;
}

.lndd-tt-gen {
    font-size: 9px;
    color: #7b2d8e;
}

/* ========== CTA BANNER ========== */
.lndd-cta-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(78, 205, 196, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}
.lndd-cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(78,205,196,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.lndd-cta-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(78,205,196,0.4));
}
.lndd-cta-content {
    flex: 1;
    min-width: 0;
}
.lndd-cta-title {
    font-size: 15px;
    font-weight: 700;
    color: #f0f0f0;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.lndd-cta-desc {
    font-size: 12.5px;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}
.lndd-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44b09e 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(78,205,196,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.lndd-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78,205,196,0.5);
}
.lndd-cta-phone-icon {
    font-size: 16px;
    animation: lndd-ring 1.5s ease-in-out infinite;
}
@keyframes lndd-ring {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-10deg); }
    30% { transform: rotate(8deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(0deg); }
}
@media (max-width: 720px) {
    .lndd-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
    }
    .lndd-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== RAW TEXT ========== */
.lndd-rawtext {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 25px;
}

.lndd-rawtext h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #1a2744;
    margin: 0 0 6px;
}

.lndd-rawtext-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.lndd-rawtext-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px;
    font-size: 12.5px;
    line-height: 1.8;
    color: #333;
    font-family: monospace;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.lndd-btn-copy {
    background: #1a2744;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lndd-btn-copy:hover {
    background: #2a3a5c;
    transform: translateY(-1px);
}

/* ========== INTRO ========== */
.lndd-intro {
    background: #fff;
    border-left: 4px solid #4a1942;
    border-radius: 0 12px 12px 0;
    padding: 22px 28px;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.85;
    color: #444;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.lndd-intro p {
    margin: 0 0 10px;
}

.lndd-intro p:last-child {
    margin-bottom: 0;
}

.lndd-intro strong {
    color: #1a2744;
}

.lndd-intro em {
    color: #7b2d8e;
    font-style: italic;
}

/* ========== GUIDE ========== */
.lndd-guide {
    background: #fff;
    border: 1px solid #dde1e6;
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.lndd-guide h3 {
    font-size: 16px;
    font-weight: 700;
    color: #7b2d8e;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #7b2d8e;
    display: inline-block;
}

.lndd-guide ul {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.lndd-guide li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 13.5px;
    line-height: 1.7;
    color: #444;
    border-bottom: 1px solid #f0ebe3;
}

.lndd-guide li:last-child {
    border-bottom: none;
}

.lndd-guide li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #4ecdc4;
    font-weight: 900;
    font-size: 16px;
}

.lndd-guide li strong {
    color: #1a2744;
}

.lndd-guide-note {
    font-size: 12.5px;
    color: #888;
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

/* ========== LEARN / ACCORDION ========== */
.lndd-learn {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 30px;
}

.lndd-learn-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a2744;
    margin: 0 0 6px;
}

.lndd-learn-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
    font-style: italic;
}

.lndd-accordion {
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.lndd-accordion:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.lndd-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #2a1a3e, #4a1942);
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.lndd-accordion-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.lndd-accordion-arrow {
    margin-left: auto;
    font-size: 22px;
    font-weight: 300;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.lndd-accordion-open .lndd-accordion-arrow {
    transform: rotate(90deg);
}

.lndd-accordion-.lndd-body-dummy {
    max-height: 0;
    overflow: hidden;
    background: #fff;
    padding: 0 22px;
    transition: max-height 0.4s ease, padding 0.4s ease;
    text-align: left;
    font-size: 13.5px;
    line-height: 1.8;
    color: #444;
    border: 1px solid transparent;
}

.lndd-accordion-open .lndd-accordion-.lndd-body-dummy {
    max-height: 600px;
    padding: 18px 22px;
    border-color: #e8dcc8;
    border-top: none;
}

.lndd-accordion-body p {
    margin: 0 0 10px;
}

.lndd-accordion-body p:last-child {
    margin-bottom: 0;
}

.lndd-accordion-body ul {
    padding-left: 20px;
    margin: 0;
}

.lndd-accordion-body li {
    margin-bottom: 6px;
}

.lndd-accordion-body strong {
    color: #1a2744;
}

.lndd-accordion-body em {
    color: #7b2d8e;
}

.lndd-accordion-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: #2a1a3e;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #ddd;
}

.lndd-accordion-body h4:first-child {
    margin-top: 0;
}

.lndd-accordion-body ol {
    padding-left: 22px;
    margin: 8px 0;
}

.lndd-accordion-body ol li {
    margin-bottom: 6px;
}

.lndd-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 14px;
    font-size: 13px;
}

.lndd-compare-table th {
    background: #1a2744;
    color: white;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

.lndd-compare-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}

.lndd-compare-table tr:nth-child(even) td {
    background: #f8f6f3;
}

.lndd-compare-table tr:hover td {
    background: #edf9f8;
}

/* ========== FOOTER ========== */
.lndd-footer {
    text-align: center;
    padding: 22px;
    margin-top: 25px;
    border-top: 2px solid #e8dcc8;
    color: #888;
    font-size: 12px;
}

.lndd-footer a {
    color: #4ecdc4;
    font-weight: 700;
    text-decoration: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .lndd-form-row { flex-direction: column; }
    .lndd-form-group { min-width: 100%; }
    .lndd-main-grid-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        display: block;
    }
    .lndd-grid-container {
        min-width: 480px;
    }
    .lndd-grid-4x4 { font-size: 10px; }
    .lndd-palace { padding: 5px 3px; min-height: 90px; }
    .lndd-p-thienban { font-size: 13px; }
    .lndd-p-general { font-size: 10px; }
    .lndd-center-cell { padding: 5px; }
    .lndd-nt-big { font-size: 22px; }
    .lndd-info-grid { flex-direction: column; }
    .lndd-dir-left, .lndd-dir-right { min-width: 28px; font-size: 10px; }
    .lndd-dir-top, .lndd-dir-bottom { padding: 4px 30px; font-size: 10px; }
}

@media (max-width: 480px) {
    .lndd-wrapper { padding: 15px 8px; }
    .lndd-title { font-size: 24px; }
    .lndd-palace { min-height: 70px; padding: 3px 2px; }
    .lndd-p-diban { font-size: 8px; }
    .lndd-p-thienban { font-size: 11px; }
    .lndd-p-general { font-size: 9px; }
    .lndd-p-nt { font-size: 9px; }
    .lndd-p-lucthan { font-size: 9px; }
    .lndd-center-title { font-size: 9px; }
    .lndd-tk-table, .lndd-tukhoa-table, .lndd-tamtruyen-table { font-size: 8px; }
    .lndd-btn-lap { padding: 12px 28px; font-size: 14px; }
}

/* ========== COLLAPSIBLE AI PROMPT WRAPPER ========== */
.ai-prompt-wrapper {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}
.ai-prompt-header {
    background: rgba(245, 158, 11, 0.05);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    user-select: none;
    border-bottom: 1px solid transparent;
}
.ai-prompt-header:hover {
    background: rgba(245, 158, 11, 0.10);
}
.ai-prompt-body {
    padding: 14px;
    border-top: 1px solid var(--border-color);
}

/* ========== TRẠCH CÁT CALENDAR GRID ========== */
.ptth-calendar-container {
    width: 100%;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-sizing: border-box;
}

.ptth-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.ptth-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.ptth-calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.ptth-calendar-cell:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--primary);
}

.ptth-calendar-cell.ptth-cell-empty {
    background: transparent;
    border: none;
    cursor: default;
    pointer-events: none;
}

.ptth-calendar-cell.ptth-cell-active {
    border: 2px solid var(--primary) !important;
    background: rgba(245, 158, 11, 0.15) !important;
    box-shadow: 0 0 10px var(--border-glow);
}

.ptth-calendar-cell .ptth-cell-solar {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ptth-calendar-cell .ptth-cell-lunar {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Indicators for Good/Bad days */
.ptth-calendar-cell.ptth-day-good {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}
.ptth-calendar-cell.ptth-day-good .ptth-cell-solar {
    color: #4caf50;
}

.ptth-calendar-cell.ptth-day-bad {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}
.ptth-calendar-cell.ptth-day-bad .ptth-cell-solar {
    color: #ef4444;
}

/* Austere indicator dot at the top right of the cell */
.ptth-cell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.ptth-cell-badge-good {
    background-color: #4caf50;
    box-shadow: 0 0 4px #4caf50;
}
.ptth-cell-badge-bad {
    background-color: #ef4444;
    box-shadow: 0 0 4px #ef4444;
}

/* Detail view container */
.ptth-calendar-detail {
    margin-top: 15px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
}

/* Specific overrides to force high readability for all labels on dark backgrounds */
.app-container label,
.app-container .form-group label,
.app-container .form-row label,
.app-container .app-card label,
.app-container .radio-group label,
.app-container .checkbox-group label,
.app-container .hkpt-form-group label,
.app-container .hkpt-radio-group label,
.app-container .hkdq-form-group label,
.app-container .hkdq-radio-group label,
.app-container .hkdq-checkbox-group label,
.app-container .hkdq-ptth-control-item label,
.app-container .kmdg-form-group label,
.app-container .lndd-form-group label {
    color: var(--text-primary) !important;
}
