/* --- 공통 패널 및 폼 디자인 --- */
.panel {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-silver);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 16px;
    flex-shrink: 0;
}

label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-sub);
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: 0.3s ease;
    user-select: auto;
    -webkit-user-select: auto;
}

option {
    background: #0A1128;
    color: #E2E8F0;
}

input:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

input::placeholder {
    color: #64748B;
}

/* --- 입력 필드 그룹 (단위 포함) --- */
.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding-right: 14px;
    transition: 0.3s ease;
}

.input-group input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    flex: 1;
}

.input-group:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.input-suffix {
    color: var(--text-sub);
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 4px;
    white-space: nowrap;
    user-select: none;
}

/* --- 버튼 스타일 --- */
.btn-group {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    flex-direction: column;
}

button {
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit {
    background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
    color: #020617;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.1);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
    margin-top: auto;
    font-size: 0.85rem;
    padding: 10px;
}

.btn-delete:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* --- 즐겨찾기 목록 --- */
.fav-sort-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.btn-sort {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sort:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-sort.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
    font-weight: 700;
}

.fav-info {
    text-align: center;
    color: var(--text-sub);
    font-size: 0.9rem;
    padding-top: 40px;
}

.fav-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.fav-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.fav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.15);
}

.fav-main {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.fav-sub {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.btn-fav-delete {
    color: var(--danger);
    font-size: 0.85rem;
    padding: 4px 8px;
    margin-right: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-fav-delete:hover {
    background: rgba(255, 107, 107, 0.15);
}

.fav-actions {
    display: flex;
    align-items: center;
}

/* --- 히어로 섹션 (중앙 신묘한 만세력 카드) --- */
#hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
    gap: 20px;
    align-items: center;
    z-index: 1;
}

#hero-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(148, 163, 184, 0.15) 0%, transparent 60%);
    filter: blur(50px);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(25px); /* 블러 약간 강화 */
    -webkit-backdrop-filter: blur(25px);
    padding: 48px 64px; /* 여백 대폭 확보 */
    border-radius: 40px; /* 곡률 강화 */
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.05);
    position: relative; /* 자식 요소(버튼) 배치를 위함 */
    max-width: 500px;
    width: 90%;
    margin-bottom: auto;
}

/* --- 팝업 내 즐겨찾기(메뉴) 버튼 --- */
.btn-hero-fav {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 60px; /* 크기 대폭 확대 (기존 44px) */
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; /* 곡률 조정 */
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
}

.btn-hero-fav:hover {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateY(-2px);
}

.btn-hero-fav img {
    width: 30px; /* 아이콘 크기 확대 (기존 22px) */
    height: 30px;
    opacity: 0.8;
}

/* --- 상단 광고 컨테이너 --- */
.ad-container-top {
    width: 320px; /* 광고 너비 고정 */
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0; /* gap으로 조절 */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

.kakao_ad_area {
    margin: 0 auto !important;
}

.hero-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px; /* 여백 다시 확보 (기존 36px보다 넓게) */
    animation: floatIcon 4s ease-in-out infinite;
}

.hero-icon {
    width: 130px; /* 크기 복구 (기존 130px) */
    height: 130px;
    border-radius: 50%;
    background-image: url('../images/icon.png?v=20260312');
    background-size: 120%;
    background-position: 52% 50%;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: auraPulse 4s ease-in-out infinite;
    filter: contrast(1.1) brightness(1.05);
}

.hero-title {
    font-size: 2.3rem; /* 크기 약간 더 확대 */
    font-weight: 800;
    margin-bottom: 24px; /* 여백 복구 */
    background: linear-gradient(135deg, #FFFFFF 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
    letter-spacing: -0.5px;
}

.hero-desc {
    font-size: 1.15rem; /* 크기 약간 확대 */
    color: var(--text-sub);
    font-weight: 500;
    line-height: 1.6;
    opacity: 0.9;
}

/* --- 버전 정보 --- */
#version-info {
    margin-top: 36px; /* 여백 확보 (기존 40px 수준) */
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.notice-card-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 40px 24px 24px 24px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.notice-card-box h2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 9px 16px 7px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(30, 160, 180, 0.95) 0%, rgba(40, 90, 180, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(34, 211, 238, 0.2);
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
    z-index: 2;
}

.notice-card-box ul {
    display: inline-block;
    text-align: left;
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.notice-card-box li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.4;
}

.notice-card-box li:last-child {
    margin-bottom: 0;
}

.notice-card-box li::before {
    content: "✨";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9em;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.8));
}

.notice-tag {
    display: inline-block;
    background: rgba(34, 211, 238, 0.12);
    color: #22d3ee;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.1);
}

.version-debug-tag {
    color: #e88;
    font-size: 0.85em;
    vertical-align: middle;
    margin-left: 4px;
}

/* 히어로 섹션 하단 소유주 인증용 레이블 스타일 (v0.6.6) */
.hero-powered-label {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-sub);
    font-weight: 500;
    opacity: 0.5;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* --- 결과 뷰 화면 --- */
#result-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020617;
    z-index: 2;
    flex-direction: column;
    padding: 24px 32px 80px 32px;
    overflow-y: auto;
    animation: fadeSlideUp 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scrollbar-width: none;
}

#result-view::-webkit-scrollbar {
    display: none;
}

.result-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    gap: 12px;
    position: sticky;
    top: -24px;
    padding-top: 24px;
    background: #020617;
    z-index: 100;
}

.res-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 10px; /* 모든 버튼 간격을 10px로 통일 */
    align-items: center;
}

/* 데스크탑 결과 화면 헤더용 닫기 버튼: absolute에서 정적 배치로 전환 */
.header-actions .info-modal-close {
    position: static;
    margin: 0;
    flex-shrink: 0;
}

.btn-prompt-header {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 140px; /* 두 버튼의 사이즈를 동일하게 고정 */
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 25px;
    background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulseGlow 2.5s infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.btn-prompt-header:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.15);
    animation: none;
    box-shadow: 0 10px 25px rgba(34, 211, 238, 0.6);
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
    transform: translateZ(0);
}

@media (hover: hover) and (pointer: fine) {
    .btn-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* 사주 원국표 */
.saju-grid {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.saju-pillar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 80px;
}

.pillar-title {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-weight: 700;
}

.saju-char {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Times New Roman', serif;
    border-radius: 20px;
    position: relative;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.saju-label {
    position: absolute;
    bottom: -6px;
    right: -6px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #FFFFFF;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* 오행 카운터 */
.element-counter-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-right: 20px;
    margin-right: 10px;
    border-right: 1px dashed var(--glass-border);
}

.elem-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.elem-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.elem-badge .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.elem-wood {
    background: var(--wood);
}

.elem-fire {
    background: var(--fire);
}

.elem-earth {
    background: var(--earth);
}

.elem-metal {
    background: var(--metal);
}

.elem-water {
    background: var(--water);
}

.elem-unknown {
    background: var(--unknown);
}

/* 운의 흐름 */
/* 대운 섹션 + 우측 배너를 가로로 배치하는 래퍼 */
.luck-daewun-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.luck-daewun-wrapper .luck-section {
    flex: 1;
    min-width: 0; /* flex 자식의 overflow 방지 */
}

/* 데스크탑 전용 배너 (대운 우측) */
#ad-result-banner {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* 모바일 전용 배너 (사주 분석 카드 안내 라벨 하단): 데스크탑에서는 숨김 */
#ad-result-banner-mobile {
    display: none;
}

.luck-section {
    margin-bottom: 24px;
}

.luck-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-cyan);
    padding-left: 12px;
}

.luck-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-right: 8px;
}

.luck-scroll-area {
    display: flex;
    overflow-x: auto;
    padding: 4px 4px 16px 4px;
    gap: 12px;
    scrollbar-width: none;
}

.luck-scroll-area::-webkit-scrollbar {
    display: none;
}

.luck-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    min-width: 90px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.luck-card.current {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--accent-cyan);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    z-index: 5;
}

.luck-header {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 6px;
    font-weight: 600;
}

.luck-ganzhi {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.luck-char {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    color: #fff;
    font-family: serif;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.luck-korean {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 700;
}

.luck-footer {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 4px;
    font-weight: 500;
}

/* 로딩 화면 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(192, 192, 192, 0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

/* --- 모달 공통 --- */
#prompt-modal,
#contact-modal,
#doc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(15, 23, 42, 0.9);
    width: 90%;
    max-width: 500px;
    padding: 28px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
}

.modal-tags-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.modal-tag-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.modal-tag {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap; /* [v0.6.7] 줄바꿈 절대 방지 */
}

.modal-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.modal-tag.active {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

/* 궁합 모드 단독 버튼 스타일 */
.modal-tag-row.gunghap-mode .modal-tag {
    max-width: none; /* [v0.6.7] 텍스트가 잘리지 않도록 제한 해제 */
    font-size: 0.95rem;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

#modal-inquiry-box {
    width: 100% !important;
    height: 110px !important;
    padding: 16px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    color: #E2E8F0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    resize: none !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}

#modal-inquiry-box:focus {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2) !important;
}

#modal-inquiry-box::placeholder {
    color: #94A3B8 !important;
}

.app-link-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    width: 100%;
    flex-wrap: wrap;
}

.app-radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    max-width: 120px;
}

.app-radio-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.75;
}

.app-radio-label.active .app-radio-icon {
    opacity: 1;
}

.app-radio-label:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.app-radio-label input[type="radio"] {
    display: none;
}

.app-radio-label.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.modal-footer button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-confirm {
    background: linear-gradient(135deg, #94A3B8 0%, #C0C0C0 100%);
    color: #020617;
    border: none;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.2);
}

.btn-confirm:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
    transform: translateY(-1px);
}

/* --- 문서 뷰어 특화 --- */
#doc-modal {
    z-index: 2000;
    padding: 20px;
}

.doc-modal-content {
    background: rgba(10, 17, 40, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.doc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.doc-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.doc-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.doc-modal-close img,
.info-modal-close img,
.modal-close-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    pointer-events: none;
    filter: brightness(0.8) contrast(1.2); /* 아이콘 선명도 조절 */
}

.doc-modal-close:hover img,
.info-modal-close:hover img,
.modal-close-btn:hover img {
    filter: brightness(1);
}


.doc-modal-body {
    padding: 28px 32px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-main);
    line-height: 1.8;
    font-size: 0.9rem;
}

.doc-modal-body h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-modal-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-top: 28px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-cyan);
    padding-left: 10px;
}

.doc-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.doc-modal-body img:hover {
    transform: scale(1.02);
}

/* --- 커스텀 알림/확인창 --- */
#custom-alert-overlay,
#custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#custom-alert-overlay.show,
#custom-confirm-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-alert-box,
.custom-confirm-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    width: 85%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#custom-alert-overlay.show .custom-alert-box,
#custom-confirm-overlay.show .custom-confirm-box {
    transform: scale(1);
}

.custom-alert-message,
.custom-confirm-message {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    white-space: pre-line;
    word-break: keep-all;
    font-weight: 500;
}

.custom-alert-btn,
.btn-confirm-action,
.custom-confirm-btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-alert-btn,
.btn-confirm-action {
    background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}

.custom-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.custom-confirm-actions .custom-confirm-btn {
    flex: 1;
    max-width: 120px;
}

/* --- 기타 --- */
/* --- AI 프롬프트 팝업 토글 로우 --- */
.prompt-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 5px 0;
}

.easy-explain-btn {
    flex: 1; /* 가로 가득 채우기 */
    max-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-sub);
    cursor: pointer;
    font-weight: 500;
    padding: 9px 8px 8px 8px; /* 패딩 조정 */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.easy-explain-btn.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    border: 1px solid rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.4);
    font-weight: 700;
}

/* --- 인포그래픽 모달 (카드 뉴스) --- */
#infographic-modal,
.info-modal-master {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000; /* 궁합 모달 등 최상위 노출 보장 */
    display: none;
    /* JS에서 제어 */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.info-modal-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh; /* 화면의 90%를 넘지 않도록 제한 */
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 내부 스크롤을 위해 고정 */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-modal-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

#info-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: normal;
}

/* 인포그래픽/궁합 모달 프리미엄 원형 닫기 버튼: 
   헤더 내부에서는 정적 위치(static)로 정렬하여 타이틀과 수평을 맞춤 */
.info-modal-header .info-modal-close {
    position: static;
    margin: 0;
    flex-shrink: 0;
    align-self: center; /* 수직 중앙 정렬 강제 */
}

.info-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    flex-shrink: 0;
}

.info-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 궁합 설정 모달 전용 닫기 버튼 */
.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* 카드 컨테이너 및 뷰 */
.info-card-container {
    position: relative;
    padding: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

#info-card-view {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: block; /* Flex 대신 Block으로 설정하여 정교한 스크롤 유도 */
    overflow-y: auto; 
    overflow-x: hidden;
    position: relative;
    padding: 0;
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
}

#info-card-view::-webkit-scrollbar {
    width: 6px;
}

#info-card-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

/* 개별 카드 스타일 */
.info-card {
    min-width: 100%;
    padding: 20px; /* 30px -> 20px로 축소 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card-img-wrapper {
    width: 240px;
    height: 240px;
    margin-bottom: 24px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent-silver);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.info-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    word-break: keep-all;
    max-width: 320px;
}

/* 내비게이션 버튼 */
.info-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.info-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.info-nav-btn.prev {
    left: 10px;
}

.info-nav-btn.next {
    right: 10px;
}

.info-nav-btn:disabled {
    opacity: 0;
    pointer-events: none;
}

/* 푸터 및 액션 */
.info-modal-footer {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: rgba(2, 6, 23, 0.2);
}

.info-pagination {
    display: flex;
    gap: 8px;
}

.info-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
}

.info-dot.active {
    background: var(--accent-cyan);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.btn-info-download {
    padding: 12px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-info-download:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-silver);
    transform: translateY(-2px);
}

.btn-info-download .icon {
    font-size: 1.1rem;
}

/* 애니메이션 */
@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.card-enter-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.card-enter-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

/* 모바일 대응 */
@media screen and (max-width: 480px) {
    .info-modal-content {
        max-width: 100%;
        height: auto;
        border-radius: 24px;
    }

    .info-card-img-wrapper {
        width: 180px;
        height: 180px;
    }

    .info-card-container {
        min-height: 400px;
    }

    .info-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* 사주 원국 하단 안내 문구 */
.saju-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin: -10px 0 25px 0;
    font-weight: 500;
    opacity: 0.8;
    animation: pulseGlowText 2s infinite;
}

@keyframes pulseGlowText {
    0% {
        opacity: 0.6;
        text-shadow: 0 0 5px rgba(34, 211, 238, 0);
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    }

    100% {
        opacity: 0.6;
        text-shadow: 0 0 5px rgba(34, 211, 238, 0);
    }
}

/* 모바일 전용 줄바꿈 제어 */
.mobile-br {
    display: none !important;
}

/* --- 인포그래픽 모달 (카드 뉴스) 스타일 --- */
#hero-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* 수직 정렬로 변경 (배너 + 팝업) */
    justify-content: center;
    align-items: center;
    z-index: 1;
    gap: 20px; /* 배너와 팝업 사이 간격 */
}

/* 모바일 전용 요소 데스크탑에서 숨김 */
.mobile-only,
.btn-drawer-close {
    display: none !important;
}

/* 데스크탑에서 메인 그룹의 레이아웃 간섭 방지 */
.hero-main-group {
    display: contents; /* 부모 flex 컨테이너에 직접 자식처럼 동작하게 함 */
}


.info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.info-modal-content {
    position: relative;
    width: 92%;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.9); /* 투명도 0.6 -> 0.9로 상향 (가독성 확보) */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    backdrop-filter: blur(20px); /* 블러 강화 */
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;

    flex-direction: column;
    animation: modalShow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* (중복 스타일 제거됨 - 1196번 라인 통합) */

/* 기존 1528번 라인 중복 스타일 제거 (1183번 통합 적용) */

.info-card-container {
    padding: 0px 24px 15px; /* 하단 패딩 20px -> 15px로 더 축소 */
    position: relative;
    min-height: auto; /* 고정 최소 높이 제거하여 짤림 방지 */
}

/* --- Card 1: 본질 (Essence) 전용 스타일 --- */
.card-essence {
    display: flex;
    flex-direction: column;
    gap: 0; /* gap 제거하고 margin으로만 정밀 제어 */
    animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.essence-visual-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0px 0 25px; /* 하단 10px -> 25px로 늘려 텍스트 블록 전체를 아래로 밀어냄 */
    padding: 0;
    animation: cardFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 세로 일주 텍스트 */
.essence-pillar-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: serif;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    padding: 15px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

/* .char-unit, .hanja, .hangul 클래스는 이제 .saju-char 스타일로 대체됨 */

.essence-image-wrapper {
    position: relative;
    width: 154px; 
    height: 180px; /* 수직 높이를 이미지 마스크에 가깝게 축소 */
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sphere-mask {
    width: 154px;
    /* 마스크 크기 대폭 확장 */
    height: 154px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.5);
    /* 글로우 강화 */
    background: rgba(255, 255, 255, 0.05);
}

.sphere-image {
    width: 240px;
    /* 고정 이미지 크기 확장 */
    height: 240px;
    object-fit: cover;
    flex-shrink: 0;
}

@keyframes sphereFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.sphere-glow {
    position: absolute;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(20px);
}

.essence-mulsang-box {
    text-align: center;
    margin-bottom: 0px; /* 2px -> 0px로 제거하여 키워드 영역과 독립적 관리 */
    padding: 0 10px;
}

.mulsang-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent-cyan);
    line-height: 1.4; /* 줄 간격 1.6 -> 1.4로 축소 */
    word-break: keep-all;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: pre-line;
}

/* 키워드 태그 */
.essence-keywords {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 0px; /* 5px -> 0px로 축소 */
}

.keyword-chips-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.keyword-divider {
    width: 90%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 10px var(--accent-cyan);
    opacity: 0.7;
}

.keyword-divider.top {
    margin-top: 10px; /* 상단 5px -> 10px로 늘려 균형 확보 */
    margin-bottom: 10px; /* 5px -> 10px로 일관성 유지 */
}

.keyword-divider.bottom {
    margin-top: 10px; /* 5px -> 10px */
    margin-bottom: 10px; /* 하단 5px -> 10px로 상단과 동일하게 조정 */
}

.keyword-chip {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-silver);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}

.keyword-chip:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

/* --- Card 2: 환경 (Environment) 전용 스타일 --- */
.card-environment {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: cardFadeIn 0.6s ease-out;
}

.env-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 12px;
    text-align: left;
    padding-left: 5px;
    border-left: 3px solid var(--accent-cyan);
}

/* 오행 기운 분포 막대 (v1.3) */
.env-bars-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px; /* 평균 라벨 공간 확보 */
    margin-top: 20px; 
    position: relative;
}

.env-avg-line {
    position: absolute;
    top: -5px;
    bottom: 0;
    width: 0;
    border-left: 1px dashed rgba(255, 255, 255, 0.4);
    z-index: 2;
    pointer-events: none;
}

/* 바의 실제 영역(이름 50px + 간격 12px 이후)에 정확히 맞추기 위한 레이어 */
.env-guide-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 62px; /* 50px(name) + 12px(gap) */
    right: 67px; /* 55px(keyword) + 12px(gap) */
    pointer-events: none;
    z-index: 1;
}

.avg-label {
    position: absolute;
    top: -18px;
    left: 0;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-sub);
    white-space: nowrap;
    opacity: 0.8;
}

.env-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.env-bar-name {
    width: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub);
    white-space: nowrap;
}

.env-bar-container {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.env-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden; /* 바 영역 내에서만 광원이 흐르도록 */
}

.env-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); /* 광원 강도 증가 */
    animation: bar-glow 2s infinite linear; /* 속도 및 인지성 개선 */
}

.env-bar-keyword {
    width: 55px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-align: right;
}

@keyframes bar-glow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 에너지 무게중심 시각화 (v1.3 - 구체 제외) */
.env-balance-row {
    margin-top: 10px;
}

.balance-visual-container {
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    perspective: 1000px;
}

.balance-bar {
    width: 260px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    border-radius: 2px;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.balance-pivot {
    position: absolute;
    bottom: 35px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid rgba(255,255,255,0.1);
}

.balance-weight {
    position: absolute;
    font-weight: 800;
    color: var(--text-main);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    bottom: 10px; /* 바 위에 위치하도록 조정 */
}

.balance-weight.self {
    left: 5px;
}

.balance-weight.environment {
    right: 5px;
}

/* 상태별 위치 및 기울기 (v0.5.1: 5단계 확장) */
.pos-very-strong .balance-bar { transform: rotate(-15deg); }
.pos-very-strong .balance-weight.self {
    text-shadow: 0 0 28px var(--accent-cyan);
    font-size: 1.15em;
}

.pos-strong .balance-bar { transform: rotate(-8deg); }
.pos-strong .balance-weight.self { text-shadow: 0 0 20px var(--accent-cyan); }

.pos-balanced .balance-bar { transform: rotate(0deg); }

.pos-weak .balance-bar { transform: rotate(10deg); }
.pos-weak .balance-weight.environment { text-shadow: 0 0 20px var(--accent-cyan); }

.pos-very-weak .balance-bar { transform: rotate(18deg); }
.pos-very-weak .balance-weight.environment {
    text-shadow: 0 0 28px var(--accent-cyan);
    font-size: 1.15em;
}

.balance-comment {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-cyan); /* 모든 카드의 설명 문구 색상 변경 */
    line-height: 1.4;
    padding: 0 15px;
}

/* --- 모달 하단 컨트롤 (내비게이션 & 액션) --- */
.info-modal-footer {
    padding: 0 24px 24px; /* 하단 여백 32px -> 24px로 축소 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; /* 요소 간 간격 20px -> 12px로 축소 */
}

.info-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
}

.info-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-info-download {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
    color: #FFFFFF;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-info-download:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(34, 211, 238, 0.5);
    filter: brightness(1.1);
}

.btn-info-close-footer {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-info-close-footer:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* 내비게이션 화살표 (오버레이형) */
.info-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.info-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.1);
    border-color: var(--accent-cyan);
}

.info-nav-btn.prev {
    left: -10px;
}

.info-nav-btn.next {
    right: -10px;
}

/* 모바일 대응 (범위를 768px로 확장) */
@media (max-width: 768px) {
    .info-nav-btn {
        display: flex; /* 모바일에서도 노출 */
        width: 36px; /* 크기 약간 축소 */
        height: 36px;
        font-size: 1rem;
    }

    .info-nav-btn.prev {
        left: 0px; /* 화면 안쪽으로 배치 */
    }

    .info-nav-btn.next {
        right: 0px; /* 화면 안쪽으로 배치 */
    }

    /* 모바일은 스와이프 고려하여 화살표 숨김 가능 */
    .info-modal-content {
        width: 95%;
        max-width: 360px; /* 모바일 전폭 방지 및 정렬 유지 */
        border-radius: 24px;
        margin: 0 auto; /* 상단 margin 제거하여 짤림 방지 */
    }

    .info-card-container {
        padding: 0px 15px 10px; /* 모바일 패딩 추가 축소 */
    }

    .essence-pillar-vertical .saju-char {
        width: 60px; /* 문자 크기 약간 축소 */
        height: 60px;
        font-size: 1.8rem;
    }

    .mulsang-text {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .info-card {
        padding: 10px 10px; /* 모바일 전용 패딩 대폭 축소 (20px -> 10px) */
        min-height: auto;
        display: block;
    }

    .info-modal-footer {
        padding: 0 15px 20px; /* 푸터 여백 축소 */
        gap: 8px;
    }
    
    .btn-info-download, .btn-info-close-footer {
        padding: 10px; /* 버튼 높이 축소 */
        font-size: 0.95rem;
    }
}

/* --- 사주 그리드 클릭 안내 문구 --- */
.saju-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    margin-top: -10px;
    margin-bottom: 30px;
    font-weight: 700;
    animation: pulseHint 2s infinite;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
    line-height: 1.5;
}

@keyframes pulseHint {

    0%,
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* 카드 슬라이드 애니메이션 */
.card-enter-right {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-enter-left {
    animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Card 3: Orientation (Radar Chart) --- */
.card-orientation {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.info-card-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    text-align: center;
}

.radar-chart-container {
    width: 220px;
    height: 220px;
    margin-bottom: 25px;
    position: relative;
    /* filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.15)); */
}

.radar-chart-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.radar-grid {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 0.5;
}

.radar-axis {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.radar-label {
    fill: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.radar-label-value {
    fill: var(--accent-cyan);
    font-size: 10px;
    font-weight: 800;
}

.radar-polygon {
    fill: rgba(34, 211, 238, 0.25);
    stroke: var(--accent-cyan);
    stroke-width: 2.5;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.4));
    transform-origin: center;
    animation: radarSpread 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes radarSpread {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.orientation-value-row {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* v0.5.2: 태그가 많아질 경우 줄바꿈 허용 */
    gap: 8px; /* 태그 간 간격 */
}

.value-chip-primary {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.4);
    color: #FFFFFF;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    word-break: keep-all; /* v0.5.2: 단어 중간 잘림 방지 */
    white-space: nowrap; /* 개별 태그 내부 줄바꿈 방지 */
}

.orientation-comment {
    text-align: left; /* v0.5.2: 좌측 정렬 */
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-cyan);
    line-height: 1.6;
    word-break: keep-all;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .radar-chart-container {
        width: 190px;
        height: 190px;
        margin-bottom: 20px;
    }
    
    .orientation-comment {
        font-size: 0.85rem;
    }
    
    .value-chip-primary {
        font-size: 0.9rem;
        padding: 6px 14px;
    }
}
/* --- Card 4: Dynamics (Energy & Luck) --- */
.card-dynamics {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.dynamics-gauges-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.gauge-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gauge-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 4px;
}

.gauge-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub);
}

.gauge-name small {
    font-weight: 500;
    opacity: 0.7;
}

.gauge-val-text {
    font-size: 0.9rem;
    font-weight: 800;
}

.gauge-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
}

.gauge-bg {
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
}

.gauge-pointer {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 2;
    transition: left 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.temp-gauge .gauge-pointer {
    background: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan);
}

.density-gauge .gauge-pointer {
    background: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue);
}

.dynamics-theme-row {
    margin-bottom: 20px;
}

.dynamics-strategy-box {
    margin-top: 25px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 15px;
    text-align: left;
}

.strategy-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.strategy-content {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
    word-break: keep-all;
}

@media (max-width: 480px) {
    .dynamics-gauges-wrapper {
        gap: 12px;
    }
    .strategy-content {
        font-size: 0.9rem;
    }
}

/* --- Card 5: Thank You (Disclaimer) --- */
.card-thankyou {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 15px;
    animation: cardFadeIn 0.8s ease-out;
}

.thankyou-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-cyan);
    line-height: 1.4;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.thankyou-content-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px 20px;
    width: 100%;
    max-width: 320px;
}

.thankyou-text {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.6;
    word-break: keep-all;
}

.thankyou-divider {
    width: 40px;
    height: 1.5px;
    background: var(--accent-cyan);
    margin: 15px auto;
    opacity: 0.4;
}

.thankyou-text.secondary {
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 480px) {
    .card-thankyou {
        padding: 40px 10px;
    }
    .thankyou-title {
        font-size: 1.4rem;
    }
    .thankyou-content-box {
        padding: 20px 15px;
    }
    .thankyou-text {
        font-size: 0.9rem;
    }
}

/* --- 합충 상호작용 배지 (Card 2 하단) --- */
.interactions-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.interactions-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.interactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.interaction-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.interaction-badge.stem-harmony   { background: var(--accent-blue); }
.interaction-badge.branch-harmony { background: var(--accent-cyan); color: #020617; }
.interaction-badge.clash          { background: var(--fire); }
.interaction-badge.sanhe          { background: var(--wood); }
.interaction-badge.half-sanhe     { background: var(--wood); opacity: 0.65; }

/* 형파해(刑破害) 추가 배지 색상 */
.interaction-badge.samhyung       { background: #962fbf; }
.interaction-badge.hyung          { background: #d62976; }
.interaction-badge.pa             { background: #fa7e1e; }
.interaction-badge.hae            { background: #4f5bd5; }

/* =========================================================
   궁합(宮合) UI 스타일
========================================================= */

/* 입력 모달 즐겨찾기 목록 추가 스타일 */
.compat-load-tabs {
    display: flex;
    gap: 8px;
    margin: 0 20px 10px; /* 좌우 여백 20px, 하단 10px (최적화) */
}
.compat-load-tabs button {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 12px;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.compat-load-tabs button.active {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent-cyan);
    font-weight: bold;
    border-color: rgba(34, 211, 238, 0.4);
}

/* 궁합 유형 선택 탭 (연애/사업/동료) */
.compat-category-tabs {
    display: flex;
    gap: 6px;
    margin: 0 20px 10px; /* 좌우 여백 20px, 하단 10px (최적화) */
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 16px;
}
.compat-category-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    /* [v0.6.2] 텍스트 줄바꿈 방지 및 넘침 처리 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compat-category-tab.active {
    background: var(--accent-cyan);
    color: #020617;
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}


/* 궁합 결과 카드 디자인 (점수 중심) */
.compat-score-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0 20px;
    width: 100%;
}

.compat-score-large {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #22D3EE 30%, #3B82F6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.3));
    margin-bottom: 8px;
}

.compat-score-unit {
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

.compat-badge-pill {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
}

.compat-badge-pill.grade-s { color: #F59E0B; border-color: #F59E0B; background: rgba(245, 158, 11, 0.1); }
.compat-badge-pill.grade-a { color: #A855F7; border-color: #A855F7; background: rgba(168, 85, 247, 0.1); }
.compat-badge-pill.grade-b { color: #22D3EE; border-color: #22D3EE; background: rgba(34, 211, 238, 0.1); }
.compat-badge-pill.grade-c { color: var(--text-sub); }

.compat-summary-box {
    text-align: center;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    word-break: keep-all;
    padding: 0 20px;
}

.compat-description {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.7;
    color: var(--text-sub);
    font-size: 0.95rem;
    text-align: justify;
}


/* 오행 비교 (레이더 대신 바 차트 형태로 응용) */
.element-bar-pair {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}
.element-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: bold;
}
.element-bar-track {
    height: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}
.element-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}
.element-bar-fill.person-a {
    background: var(--accent-blue);
    opacity: 0.9;
}
.element-bar-fill.person-b {
    background: var(--fire);
    opacity: 0.9;
}

/* 오성 성향 비교 */
.ori-radar-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}
.radar-overlay-b {
    stroke: var(--fire);
    fill: rgba(250, 126, 30, 0.2); 
}

/* --- 궁합 전용 모달 및 레이아웃 최적화 --- */
.compat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2500;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 궁합 결과 하단 AI 버튼 */
.compat-ai-action-box {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 궁합 및 주요 액션 버튼 공통 프리미엄 스타일 */
.btn-compat-action {
    padding: 12px 20px !important; /* 헤더 기본 패딩 */
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important; 
    color: #FFFFFF !important;
    border-radius: 12px !important; /* 헤더에 맞게 살짝 축소 */
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

/* 모달 하단에 위치할 때의 특수 스타일 (너비 가득 차게) */
.modal-footer .btn-compat-action,
.info-modal-content .btn-compat-action,
.compat-ai-action-box .btn-compat-action {
    width: 100% !important;
    padding: 16px !important;
    font-size: 1.05rem !important;
    border-radius: 16px !important;
    font-weight: 800 !important;
}

.btn-compat-action:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-compat-action svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

/* --- 궁합 모달 UI 디자인 최적화 (v0.6.5) --- */
/* 메인 사주 입력폼과 동일한 1열 배치 스타일 유지 */
.compat-form-panel .form-group {
    margin-bottom: 10px; /* 12px -> 10px (통합 조정) */
}

.compat-form-panel .form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-sub);
    font-weight: 500;
}

.compat-form-panel input[type="text"],
.compat-form-panel select {
    width: 100%;
}

#compat-input-modal .modal-content {
    position: relative;    /* 닫기 버튼(absolute)의 기준점 설정 */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;           /* 전역 패딩(28px) 제거 */
    gap: 0;               /* 전역 갭(20px) 제거 */
}

#compat-input-modal .compat-form-panel,
.compat-fav-scroll-box {
    flex: 1;               /* 남은 공간을 가득 채우도록 설정 */
    overflow-y: auto;      /* 내용 초과시 내부 스크롤 발생 */
    padding: 10px 20px;    /* 좌우 패딩 20px 부여 */
    min-height: 200px;     /* 최소 높이 확보 */
}

#compat-input-modal .modal-header {
    display: flex;
    justify-content: center; /* 타이틀 중앙 정렬 */
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

#compat-modal-title {
    width: 100%;
    font-weight: 700;
}

.compat-modal-footer {
    padding: 10px 20px 20px; /* 하단 및 좌우 여백 확보 */
    display: flex;
    width: 100%;
}

#compat-input-modal .modal-close-btn {
    position: absolute;
    right: 15px;
    top: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

#compat-input-modal .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    transform: rotate(90deg);
}

/* --- 궁합 결과 화면 프리미엄 UI 개편 (v0.6.6) --- */
.compat-names {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 20px 0 30px 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #FFF 0%, #A5B4FC 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.compat-names .ampersand {
    font-size: 1.2rem;
    color: var(--text-sub);
    margin: 0 8px;
    opacity: 0.6;
    -webkit-text-fill-color: var(--text-sub);
}

/* 카테고리 탭 및 이동 컨트롤 제거 (궁합 결과 모달 한정) */
.compat-tabs,
#compat-result-modal .info-nav-btn,
#compat-result-modal .info-pagination {
    display: none !important;
}

.compat-score-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.compat-score-large {
    font-size: 5rem; /* 사이즈 업 */
    font-weight: 900;
    letter-spacing: -2px;
    margin: 10px 0;
    background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.3));
}

.compat-badge-pill {
    font-size: 0.95rem;
    padding: 8px 18px;
    border-radius: 50px;
    margin-bottom: 15px;
    display: inline-block;
}

.compat-description-box {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main);
    text-align: center;
    padding: 0 10px;
    margin-bottom: 30px;
}

#compat-result-modal .info-modal-content {
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: radial-gradient(circle at top, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
}
