/* result.css — V9 Clean Mint 결과 화면 3섭션 아코디언 및 상단 배너 전용 스타일 */
/* 다국어 성분명 줄바꾸금 */
.ingredient-name, .ingredient-row, .result-section-title, .banner-title, .banner-desc {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* 1. 상단 즉시 판정 배너 인터랙션 */
.banner-danger, .banner-warning, .banner-safe {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.banner-danger:hover, .banner-warning:hover, .banner-safe:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.banner-danger:active, .banner-warning:active, .banner-safe:active {
    transform: translateY(0);
}

/* 2. 3섹션 아코디언 커스텀 스타일 */
details.result-accordion {
    transition: all 0.2s ease-in-out;
}

details.result-accordion summary {
    position: relative;
    outline: none;
}

details.result-accordion summary::-webkit-details-marker {
    display: none;
}

details.result-accordion summary::after {
    content: "▾";
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-left: 6px;
    transition: transform 0.2s ease;
    display: inline-block;
}

details.result-accordion[open] summary::after {
    transform: rotate(180deg);
}

/* 3. 태그 및 뱃지 보정 */
.pastel-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ingredient-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 0.68rem 0.82rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    min-width: 0;
    overflow: hidden;
    transition: background-color 0.15s ease;
}

.ingredient-row.caution-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35); /* 일반 공인 알레르겐: 주황색 테두리 */
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, rgba(255, 255, 255, 0.98) 100%);
    padding: 0.75rem 0.85rem;
}

.ingredient-row.caution-row.user-flagged-row {
    border: 2px solid #EF4444 !important; /* 사용자가 직접 등록한 개인 기피 성분: 선명하고 두꺼운 Danger 레드 테두리 */
    border-left: 6px solid #DC2626 !important; /* 좌측 강렬한 6px 솔리드 레드 액센트 바 */
    background: linear-gradient(135deg, #FFF5F5 0%, #FFFFFF 100%) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.16) !important;
}

.ingredient-row.caution-row.user-flagged-row .card-head-name,
.ingredient-row.caution-row.user-flagged-row .ingredient-name-main {
    color: #991B1B;
    font-weight: 800;
}

/* ============================================================
   🏷️ 사이트 전역 마스터 성분 카드 헤더 규격 (Master Card)
   ============================================================ */
.ingredient-master-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 5px;
}

.ingredient-master-card .card-head-name,
.caution-top-row .card-head-name {
    width: 100%;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.ingredient-master-card .card-head-inci,
.caution-top-row .card-head-inci {
    width: 100%;
    font-size: 0.78rem;
    color: var(--text-secondary);
    word-break: keep-all;
    overflow-wrap: anywhere;
    user-select: text;
    line-height: 1.35;
    margin-top: -1px;
}

.ingredient-master-card .card-head-actions,
.caution-top-row .card-head-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.card-head-actions .badge-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* 갤럭시 플립 / 폴드 커버 등 초협소 화면 (<340px) 반응형 자동 적층 */
@media (max-width: 340px) {
    .ingredient-master-card .card-head-actions,
    .caution-top-row .card-head-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .ingredient-master-card .card-head-actions .btn-single-allergen-add,
    .caution-top-row .card-head-actions .btn-single-allergen-add {
        width: 100%;
        justify-content: center;
    }
}

.caution-top-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: 100%;
}

.allergen-easy-desc {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.74rem;
    color: #92400e;
    background: rgba(245, 158, 11, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1.45;
    border: 1px solid rgba(245, 158, 11, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.allergen-desc-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.allergen-desc-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1.2;
}

.allergen-symptoms-text {
    color: #b45309;
    font-weight: 500;
    font-size: 0.72rem;
    padding-top: 4px;
    margin-top: 2px;
    border-top: 1px dashed rgba(245, 158, 11, 0.25);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.allergen-symptoms-label {
    font-weight: 700;
    color: #92400e;
    margin-right: 4px;
}

.ingredient-row.unmatched-row {
    border-style: dashed;
}

.ingredient-info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.ingredient-name-main {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: keep-all;
    letter-spacing: -0.01em;
}

.ingredient-name-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: keep-all;
    user-select: text;
    font-weight: 400;
}

.ingredient-badge-col {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* 4. 기준 상세 모달 애니메이션 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================
   ✨ 5. 화장품 배합목적 분석 카드 (Pill Gauge Infographic)
   ============================================================ */

.purpose-card {
    background: var(--bg-card);
    border: 1.5px solid rgba(90, 191, 173, 0.22);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(90, 191, 173, 0.08), 0 2px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.purpose-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8 0%, #2dd4bf 30%, #fde047 70%, #fb7185 100%);
    opacity: 0.85;
}

.purpose-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.purpose-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.purpose-badge-total {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0d9488;
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.35);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.purpose-headline {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: keep-all;
}

.purpose-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1rem;
}

/* 탭 가이드 및 정렬 뱃지 반응형 액션바 (언어별 길이 차이에 완벽 대응) */
.purpose-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.purpose-tap-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 170px;
    line-height: 1.35;
}

.purpose-sort-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

/* 캡슐 게이지 바 차트 컨테이너 (부드러운 가로 스크롤 & 고른 간격 보장) */
.purpose-gauge-container {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px;
    padding: 0.75rem 0.35rem 0.6rem 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(90, 191, 173, 0.35) transparent;
}

.purpose-gauge-container::-webkit-scrollbar {
    height: 4px;
}

.purpose-gauge-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.purpose-gauge-container::-webkit-scrollbar-thumb {
    background: rgba(90, 191, 173, 0.35);
    border-radius: 4px;
}

/* 개별 게이지 컬럼 아이템 (다국어 텍스트 길이에 대응 가능한 유연한 폭 66px~82px 보장) */
.purpose-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 66px;
    min-width: 66px;
    max-width: 84px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    padding: 6px 4px 8px 4px;
    border-radius: 12px;
    border: 1px solid transparent;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.purpose-col:hover {
    background: rgba(90, 191, 173, 0.06);
    transform: translateY(-2px);
}

.purpose-col.active {
    background: rgba(90, 191, 173, 0.12);
    box-shadow: 0 4px 12px rgba(90, 191, 173, 0.15);
    border: 1px solid rgba(90, 191, 173, 0.35);
}

.purpose-col.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(90, 191, 173, 0.5);
}

.purpose-count {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.purpose-col.has-count .purpose-count {
    color: var(--text-primary);
}

.purpose-col.active .purpose-count {
    transform: scale(1.15);
}

/* 수직 캡슐 트랙 & 필 */
.pill-gauge-track {
    width: 26px;
    height: 74px;
    background: rgba(0, 0, 0, 0.03);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.pill-gauge-fill {
    width: 100%;
    border-radius: 999px;
    position: relative;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.purpose-col.active .pill-gauge-track {
    border-color: currentColor;
    box-shadow: 0 0 10px rgba(90, 191, 173, 0.35);
}

/* 목적 아이콘 및 레이블 (단어 중간 철자 분절 방지, 자연스러운 다국어 줄바꿈 보장) */
.purpose-icon {
    font-size: 1.1rem;
    margin-top: 6px;
    line-height: 1;
}

.purpose-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-secondary);
    margin-top: 5px;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal; /* 단어 중간 임의 분절 방지 */
    line-height: 1.22;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.purpose-col.has-count .purpose-label {
    color: var(--text-primary);
}

.purpose-col.active .purpose-label {
    font-weight: 800;
    color: var(--accent-hover);
}

/* 인터랙티브 성분 목록 드로어 (Detail Panel) */
.purpose-detail-drawer {
    margin-top: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    animation: fadeInScale 0.25s ease-out;
}

.purpose-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.purpose-detail-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.purpose-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.purpose-chip {
    font-size: 0.74rem;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.purpose-chip-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 0;
}

/* 법적 면책 고지 박스 */
.purpose-disclaimer-box {
    margin-top: 0.9rem;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px dashed var(--card-border);
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ============================================================
   🛡️ 6. 개별 기피 성분 즉시 등록 버튼
   ============================================================ */
.btn-single-allergen-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 14px;
    cursor: pointer;
    border: 1.5px solid #ef4444;
    background: #ffffff;
    color: #ef4444;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
    user-select: none;
    line-height: 1.25;
}

.btn-single-allergen-add:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.22);
}

.btn-single-allergen-add.added {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.25);
}

.btn-single-allergen-add.added:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-single-allergen-add .btn-icon {
    font-weight: 800;
    font-size: 0.74rem;
}

/* ============================================================
   🏷️ 7. 골든 터치 존 & 반응 태깅 스타일
   ============================================================ */
.golden-touch-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.golden-touch-card:hover {
    box-shadow: 0 4px 16px rgba(79, 140, 201, 0.12);
}

.reaction-tag-btn {
    user-select: none;
    outline: none;
}

.reaction-tag-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.reaction-tag-btn:active {
    transform: translateY(0);
}


