.manse-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.manse-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 800;
    font-size: 1.8rem;
}

.manse-form {
    background: #fdfdfd;
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 15px;
    margin-bottom: 30px;
}

/* Saju Grid Styling */
.saju-grid-wrapper {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 15px;
}

.saju-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 600px;
}

.saju-row {
    display: table-row;
    border-bottom: 1px solid #eee;
}

.saju-row:last-child {
    border-bottom: none;
}

.saju-header-cell {
    display: table-cell;
    width: 80px;
    background: #f9f9f9;
    padding: 15px 10px;
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
    color: #666;
    border-right: 1px solid #eee;
    font-size: 0.9rem;
}

.saju-data-cell {
    display: table-cell;
    padding: 15px 5px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px dotted #eee;
}

.saju-data-cell:last-child {
    border-right: none;
}

/* Pillar Blocks */
.gan-ji-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gj-top {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.gj-hangul {
    font-size: 1.8rem;
    font-weight: 700;
}

.gj-hanja {
    font-size: 1.5rem;
    font-family: "Noto Serif KR", serif;
    font-weight: 700;
}

.gj-sub {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: -5px;
}

.sipseong-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.jijanggan-text {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: #444;
}

.etc-text {
    font-size: 0.95rem;
    color: #333;
}

/* Element Colors */
.elem-wood {
    color: #2ecc71;
}

.elem-fire {
    color: #e74c3c;
}

.elem-earth {
    color: #d4a017;
}

/* Ochre */
.elem-metal {
    color: #7f8c8d;
}

.elem-water {
    color: #3498db;
}

/* Gender Toggle or buttons if needed */
.btn-manse {
    min-width: 180px;
    padding: 12px 40px;
    font-size: 1.05rem;
    font-weight: 700;
    background: #4a90e2;
    border: none;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transition: all 0.2s;
}

.btn-manse:hover {
    background: #357abd;
    transform: translateY(-2px);
}

@media (max-width: 576px) {
    .saju-header-cell {
        width: 60px;
        font-size: 0.8rem;
    }

    .gj-hangul {
        font-size: 1.4rem;
    }

    .gj-hanja {
        font-size: 1.2rem;
    }

    .sipseong-text {
        font-size: 0.85rem;
    }
}