/* ========================================================
   Manse (나의 만세력) - Modern Korean Minimalist Style
   Warm White / Ivory, Charcoal, Deep Navy & Muted Accents
   ======================================================== */

body.manse-body {
    background-color: #faf8f5; /* Warm Ivory White */
    color: #1e293b;            /* Dark Charcoal */
    font-family: 'Pretendard', sans-serif;
    line-height: 1.6;
}

.manse-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
    width: 100%;
    box-sizing: border-box;
}

/* 카드 기본 레이아웃 */
.manse-card {
    background: #ffffff;
    border: 1px solid #e8e4dc;
    border-radius: 1rem;
    padding: 2.25rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    position: relative;
}

.card-header-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.card-badge-accent {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.manse-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.manse-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

/* 폼 스타일 */
.manse-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.925rem;
    font-weight: 700;
    color: #334155;
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
}

.date-input-group {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.6rem;
}

.date-input-group input,
.time-input-group input,
.form-select {
    background-color: #faf9f6;
    border: 1px solid #e2ddd5;
    color: #0f172a;
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.date-input-group input:focus,
.time-input-group input:focus,
.form-select:focus {
    border-color: #1e3a8a;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 220px;
}

.time-sep {
    font-weight: 700;
    color: #94a3b8;
}

/* 라디오 & 세그먼트 버튼 */
.radio-pill-group {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.radio-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: #faf9f6;
    border: 1px solid #e2ddd5;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.radio-pill.active {
    background: #eff6ff;
    border-color: #1e3a8a;
    color: #1e3a8a;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    padding: 0.5rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.segment-group {
    display: flex;
    background: #faf9f6;
    border: 1px solid #e2ddd5;
    padding: 0.25rem;
    border-radius: 0.5rem;
    gap: 0.25rem;
    max-width: 200px;
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.segment-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 제출 버튼 */
.btn-calculate {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    border: none;
    padding: 1.05rem;
    border-radius: 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
    margin-top: 0.5rem;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
}

/* 2. 결과 화면 */
.result-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.result-user-meta {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
}

/* 사주 네 기둥 그리드 (Four Pillars Grid) */
.pillars-card-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.75rem;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.pillars-card-desc {
    font-size: 0.925rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.pillar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    background: #faf9f6;
    border: 1px solid #e8e4dc;
    border-radius: 0.75rem;
    padding: 1rem 0.5rem 1.25rem;
    transition: all 0.2s;
}

.pillar-column.pillar-me {
    background: #f8fafc;
    border: 2px solid #1e3a8a;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.1);
}

.pillar-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}

.pillar-header.highlight-me {
    color: #1e3a8a;
}

.pillar-box {
    width: 100%;
    max-width: 90px;
    height: 105px;
    background: #ffffff;
    border: 1px solid #e2ddd5;
    border-radius: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pillar-box.me-box {
    border-color: #93c5fd;
}

.hanja-char {
    font-family: 'Noto Serif KR', serif;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.hangul-sub {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.god-badge {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    background: #f1f5f9;
    color: #475569;
}

.god-badge.me-badge {
    background: #1e3a8a;
    color: #ffffff;
}

/* 쉬운 설명 모드 & 일간 성향 */
.section-subheading {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.day-master-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #faf8f5;
    border: 1px solid #e8e4dc;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
}

.day-master-icon {
    font-size: 2.75rem;
    line-height: 1;
}

.day-master-info h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.day-master-info p {
    font-size: 0.925rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

.divider-line {
    height: 1px;
    background-color: #e8e4dc;
    margin: 2rem 0;
}

/* 오행 분포 게이지 */
.elements-subtext {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}

.elements-bars-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.element-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.el-label {
    width: 65px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.el-wood { background: #16a34a; }
.el-fire { background: #dc2626; }
.el-earth { background: #d97706; }
.el-metal { background: #64748b; }
.el-water { background: #0284c7; }

.el-track {
    flex: 1;
    height: 12px;
    background: #f1ede6;
    border-radius: 9999px;
    overflow: hidden;
}

.el-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.el-wood-fill { background: linear-gradient(90deg, #22c55e, #16a34a); }
.el-fire-fill { background: linear-gradient(90deg, #f87171, #dc2626); }
.el-earth-fill { background: linear-gradient(90deg, #fbbf24, #d97706); }
.el-metal-fill { background: linear-gradient(90deg, #94a3b8, #475569); }
.el-water-fill { background: linear-gradient(90deg, #38bdf8, #0284c7); }

.el-val {
    width: 45px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
    color: #334155;
}

.element-summary-box {
    margin-top: 1.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.65rem;
    padding: 1rem 1.25rem;
    font-size: 0.925rem;
    color: #166534;
}

.element-summary-box p {
    margin-top: 0.35rem;
    margin-bottom: 0;
    color: #15803d;
}

/* 전문가 모드 토글 */
.btn-toggle-advanced {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
    cursor: pointer;
    padding: 0;
}

.advanced-details-panel {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e4dc;
}

.advanced-table-wrapper {
    overflow-x: auto;
}

.advanced-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: center;
}

.advanced-table th,
.advanced-table td {
    padding: 0.75rem 0.5rem;
    border: 1px solid #e8e4dc;
}

.advanced-table th {
    background: #faf9f6;
    color: #475569;
    font-weight: 700;
}

.advanced-table .row-header {
    background: #faf9f6;
    font-weight: 700;
    color: #334155;
    text-align: left;
    padding-left: 0.75rem;
}

/* 면책 조항 */
.manse-disclaimer {
    margin-top: 2rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.825rem;
    color: #64748b;
    line-height: 1.6;
}

/* 모바일 최적화 */
@media (max-width: 520px) {
    .manse-container {
        padding: 1.5rem 1rem 4rem;
    }
    .manse-card {
        padding: 1.5rem 1.25rem;
    }
    .pillars-grid {
        gap: 0.4rem;
    }
    .pillar-box {
        height: 90px;
    }
    .hanja-char {
        font-size: 1.75rem;
    }
    .god-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
    }
    .day-master-summary {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}
