.marriage-biodata-page {
    --bd-accent: #8b0000;
    --bd-border: #333;
}

.marriage-biodata-page .biodata-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.marriage-biodata-page .biodata-form-col {
    flex: 0 0 42%;
    max-width: 42%;
    min-width: 280px;
}

.marriage-biodata-page .biodata-preview-col {
    flex: 1 1 55%;
    min-width: 300px;
    position: sticky;
    top: 1rem;
}

.marriage-biodata-page .biodata-form-section {
    margin-bottom: 1.25rem;
}

.marriage-biodata-page .form-label {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.marriage-biodata-page .biodata-form-section .bd-section-heading,
.marriage-biodata-page .biodata-form-section h3.bd-section-heading {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--bd-accent);
    font-weight: 700;
}

.marriage-biodata-page .bd-photo-upload {
    display: block;
    border: 2px dashed #ccc;
    border-radius: 0.5rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.marriage-biodata-page .bd-photo-upload:hover {
    border-color: var(--bd-accent);
    background: #fff8f8;
}

.marriage-biodata-page .bd-photo-upload-text {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.marriage-biodata-page .bd-astrology-note {
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    background: #f8f9fa;
    border-radius: 0.35rem;
    border-left: 3px solid var(--bd-accent);
}

.marriage-biodata-page .place-results {
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
}

.marriage-biodata-page .theme-picker .btn-check:checked + .btn {
    background: var(--bd-accent);
    border-color: var(--bd-accent);
    color: #fff;
}

.marriage-biodata-page #biodata-export-root {
    background: #fff;
    color: #111;
    padding: 1.25rem;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    line-height: 1.35;
}

.marriage-biodata-page .bd-suzhi {
    display: none;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.marriage-biodata-page .bd-suzhi-svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--bd-accent);
}

.marriage-biodata-page .bd-export-prep .bd-suzhi,
.marriage-biodata-page .bd-export-clone .bd-suzhi {
    display: flex;
}

.marriage-biodata-page .bd-export-footer {
    display: none;
}

.marriage-biodata-page .bd-export-header {
    text-align: center;
    border-bottom: 2px solid var(--bd-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.marriage-biodata-page .bd-personal-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.marriage-biodata-page .bd-personal-main {
    flex: 1;
    min-width: 0;
    order: 1;
}

.marriage-biodata-page .bd-personal-row .bd-photo-wrap {
    flex-shrink: 0;
    order: 2;
    display: flex;
    align-items: flex-start;
}

.marriage-biodata-page .bd-personal-row .bd-table-personal {
    height: 100%;
}

/* Passport size ~35×45mm (4:5) */
.marriage-biodata-page .bd-photo {
    width: 170px;
    height: 215px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid #ccc;
    background: #f5f5f5;
    display: block;
}

.marriage-biodata-page .bd-photo-placeholder {
    width: 170px;
    height: 215px;
    border: 1px dashed #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    padding: 0.25rem;
    box-sizing: border-box;
}

.marriage-biodata-page .bd-title-block {
    text-align: center;
}

.marriage-biodata-page .bd-god-heading {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.marriage-biodata-page .bd-main-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.marriage-biodata-page .bd-section-title {
    font-weight: 700;
    margin: 0.75rem 0 0.35rem;
    padding: 0.2rem 0.4rem;
    background: #f0f0f0;
    font-size: 0.85rem;
}

.marriage-biodata-page .bd-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

.marriage-biodata-page .bd-table td {
    border: 1px solid #ccc;
    padding: 0.35rem 0.5rem;
    vertical-align: top;
}

.marriage-biodata-page .bd-label {
    width: 38%;
    font-weight: 600;
    background: #fafafa;
}

.marriage-biodata-page .theme-classic {
    --bd-accent: #8b0000;
    --bd-border: #8b0000;
}

.marriage-biodata-page .theme-classic .bd-section-title {
    background: #8b0000;
    color: #fff;
}

.marriage-biodata-page .theme-modern {
    --bd-accent: #1565c0;
    --bd-border: #1565c0;
}

.marriage-biodata-page .theme-modern .bd-export-header {
    border-bottom-color: #1565c0;
}

.marriage-biodata-page .theme-modern .bd-section-title {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}

.marriage-biodata-page .theme-elegant {
    --bd-accent: #4a148c;
    --bd-border: #9e9e9e;
}

.marriage-biodata-page .theme-elegant .bd-personal-row {
    flex-direction: column;
    align-items: center;
}

.marriage-biodata-page .theme-elegant .bd-personal-main,
.marriage-biodata-page .theme-elegant .bd-photo-wrap {
    order: unset;
    width: 100%;
}

.marriage-biodata-page .theme-elegant .bd-photo-wrap {
    display: flex;
    justify-content: center;
}

.marriage-biodata-page .charts-container.biodata-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.marriage-biodata-page .chart-box {
    flex: 1 1 45%;
    min-width: 200px;
    max-width: 320px;
}

.marriage-biodata-page .chart-title {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.marriage-biodata-page .kattam-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    aspect-ratio: 1;
    max-width: 280px;
    margin: 0 auto;
    font-size: 0.65rem;
}

.marriage-biodata-page .kattam-table .box {
    border: 1px solid #333;
    position: relative;
    padding: 2px;
    min-height: 36px;
    background: #fff;
}

.marriage-biodata-page .kattam-table .b12 { grid-area: 1 / 1; }
.marriage-biodata-page .kattam-table .b1 { grid-area: 1 / 2; }
.marriage-biodata-page .kattam-table .b2 { grid-area: 1 / 3; }
.marriage-biodata-page .kattam-table .b3 { grid-area: 1 / 4; }
.marriage-biodata-page .kattam-table .b11 { grid-area: 2 / 1; }
.marriage-biodata-page .kattam-table .b4 { grid-area: 2 / 4; }
.marriage-biodata-page .kattam-table .b10 { grid-area: 3 / 1; }
.marriage-biodata-page .kattam-table .b5 { grid-area: 3 / 4; }
.marriage-biodata-page .kattam-table .b9 { grid-area: 4 / 1; }
.marriage-biodata-page .kattam-table .b8 { grid-area: 4 / 2; }
.marriage-biodata-page .kattam-table .b7 { grid-area: 4 / 3; }
.marriage-biodata-page .kattam-table .b6 { grid-area: 4 / 4; }

.marriage-biodata-page .kattam-table .center-box {
    grid-area: 2 / 2 / 4 / 4;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    background: #f9f9f9;
}

.marriage-biodata-page .k-sign {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.55rem;
    opacity: 0.75;
}

.marriage-biodata-page .k-planets {
    display: block;
    text-align: center;
    padding-top: 10px;
    line-height: 1.2;
}

.marriage-biodata-page .k-p {
    display: inline-block;
    margin: 0 1px;
}

.marriage-biodata-page .bd-export-prep {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 794px;
    z-index: -1;
}

/* A4 export capture (template-5 style: compact tables, side-by-side charts) */
.marriage-biodata-page .bd-export-a4 {
    width: 794px;
    background: #fff;
}

.marriage-biodata-page .bd-export-a4 #biodata-export-root,
.marriage-biodata-page .bd-export-a4.bd-export-clone {
    width: 794px;
    max-width: 794px;
    padding: 6px 8px;
    font-size: 0.72rem;
    line-height: 1.22;
    box-sizing: border-box;
}

.marriage-biodata-page .bd-export-a4 .bd-personal-row {
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.marriage-biodata-page .bd-export-a4 .bd-personal-row .bd-section-title {
    margin-top: 0;
}

.marriage-biodata-page .bd-export-a4 .bd-section-title {
    font-size: 0.7rem;
    margin: 0.35rem 0 0.15rem;
    padding: 0.2rem 0.4rem;
}

.marriage-biodata-page .bd-export-a4 .bd-table td {
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
}

.marriage-biodata-page .bd-export-a4 .bd-table td:not(.bd-label) {
    word-break: break-word;
    white-space: pre-wrap;
}

.marriage-biodata-page .bd-export-a4 .bd-label {
    font-size: 0.68rem;
    width: 34%;
}

.marriage-biodata-page .bd-export-a4 .bd-main-title {
    font-size: 0.92rem;
}

.marriage-biodata-page .bd-export-a4 .bd-photo {
    width: 200px;
    height: 250px;
}

.marriage-biodata-page .bd-export-a4 .bd-photo-placeholder {
    width: 200px;
    height: 250px;
    font-size: 0.7rem;
}

.marriage-biodata-page .bd-export-a4 .bd-export-header {
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
}

.marriage-biodata-page .bd-export-a4 .bd-suzhi-svg {
    width: 2rem;
    height: 2rem;
}

.marriage-biodata-page .bd-export-a4 .charts-container.biodata-charts {
    margin-top: 0.35rem;
    gap: 0.4rem;
    justify-content: space-between;
    width: 100%;
}

.marriage-biodata-page .bd-export-a4 .chart-box {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    max-width: none;
}

.marriage-biodata-page .bd-export-a4 .kattam-table {
    max-width: 100%;
    width: 100%;
    font-size: 0.54rem;
}

.marriage-biodata-page .bd-export-a4 .kattam-table .box {
    min-height: 26px;
}

.marriage-biodata-page .bd-export-a4 .bd-table {
    width: 100%;
}

.marriage-biodata-page .bd-export-a4 .bd-export-footer,
.marriage-biodata-page .bd-export-clone .bd-export-footer {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    margin-top: 0.4rem;
    padding-top: 0.3rem;
    border-top: 1px solid #ccc;
    color: #444;
    line-height: 1.3;
}

@media (max-width: 992px) {
    .marriage-biodata-page .biodata-form-col,
    .marriage-biodata-page .biodata-preview-col {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .marriage-biodata-page .biodata-preview-col {
        position: static;
    }
}
