/* ===== Incident Index  ===== */
#incident-index {
    width: min(560px, 100%);
    margin: 24px auto;
    padding-bottom: 16px;
    overflow-x: hidden;
    /* 가로 스크롤 가드 */
}

#incident-index * {
    box-sizing: border-box;
}

#incident-index,
#incident-index * {
    font-family: 'AppleSDGothicNeo', 'Apple SD Gothic Neo',
                 -apple-system, BlinkMacSystemFont, 'Noto Sans KR',
                 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


.incident-title {
    font-size: 20px !important;; 
    font-weight: 600 !important;;
    margin: 0 0 24px !important;
    text-align: center;
}

/* 2컬럼 고정 레이아웃 */
#incident-index .ii-top {
    display: flex;
    flex-direction: row !important;
    /* 혹시 남아있을 column 규칙 무력화 */
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
    /* 한 줄 유지 */
}

/* 5:5 비율, 내용이 밀어내지 못하도록 min-width:0 필수 */
#incident-index .ii-donut,
#incident-index .ii-metrics-container {
    flex: 1 1 0;
    min-width: 0;
}

/* 막대 영역 오른쪽 살짝 띄우기 */
#incident-index .ii-metrics-container {
    padding-right: 16px;
}

/* 바/라벨(이건 레이아웃이므로 유지) */
#incident-index .ii-bar-row {
    width: 100%;
    margin-bottom: 12px;
}

#incident-index .ii-bar-label {
    display: grid;
    grid-template-columns: 1fr auto;
    /* 라벨 | 숫자 */
    column-gap: 8px;
    align-items: center;
    font-weight: 600;
    /* 폰트 크기는 JS가 아니라 CSS가 맡아도 무방 → 레이아웃 범주 */
    font-size: clamp(12px, 3.4vw, 14px);
}

#incident-index .ii-bar-label span:first-child {
    min-width: 0;
}

#incident-index .ii-bar-label span:last-child {
    white-space: nowrap;
}

#incident-index .ii-bar-track {
    width: 100%;
    height: clamp(6px, 1.4vw, 8px);
    background: #E0E0E0;
    border-radius: 999px;
    overflow: hidden;
}

#incident-index .ii-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 1s ease;
}

/* 단계 텍스트/CTA는 기존 유지 */
#ii-stageText {
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    margin: 16px 0;
}

.ii-stage-icon {
    font-size: 16px;
    vertical-align: -2px;
}

.ii-stage-blurb {
    margin-top: 4px;
}

#incident-index .ii-page-cta {
    width: min(420px, 80%);
    margin: 16px auto 0;
}

#ii-openDetail {
    width: 100%;
    height: 38px;
    border-radius: 14px;
    border: 1px solid #111;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* 모달은 그대로 */
#ii-detailBackdrop {
    position: fixed;
    inset: 0;
    height: var(--vh-fixed, 100svh);
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    z-index: 9999;
}

#incident-index .ii-modal {
    width: min(520px, 90vw);
    max-height: calc(var(--vh-fixed, 100svh) - 12vh);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    scrollbar-gutter: stable;
    -ms-overflow-style: none;
}

#incident-index .ii-modal::-webkit-scrollbar {
    display: none;
}

#incident-index .ii-modal .title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin: 4px 0 16px;
}

#incident-index .ii-modal .summary {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 18px;
}

#incident-index .ii-modal .section {
    margin: 14px 0 18px;
}

#incident-index .ii-modal .section .head {
    color: #1E88E5;
    font-weight: 800;
    margin-bottom: 6px;
}

#incident-index .ii-modal .section .body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

#ii-closeDetailCta {
    width: 70%;
    height: 38px;
    margin: 18px auto 0;
    display: block;
    border-radius: 14px;
    border: 1px solid #111;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* 컴포넌트 내부 라벨-바 간격/줄높이 표준화 */
#incident-index .ii-bar-label,
#incident-index-m .ii-bar-label {
display: grid;
grid-template-columns: 1fr auto; /* 라벨 | 점수 */
column-gap: 8px;
align-items: center;
line-height: 1.45;               /* 전역 line-height 영향 제거 */
}

#incident-index .ii-bar-label span,
#incident-index-m .ii-bar-label span {
line-height: 1.45 !important;    /* 전역 span 규칙을 확실히 이김 */
}

#incident-index .ii-bar-track,
#incident-index-m .ii-bar-track {
margin-top: 6px;                 /* 라벨-바 사이 최소 여백 */
height: 8px;
background: #E0E0E0;
border-radius: 999px;
}

#incident-index .ii-bar-row,
#incident-index-m .ii-bar-row {
margin-bottom: 14px;             /* 행 간격 */
}



/* 진입 애니메이션 (선택적으로 사용) */
.ii-reveal {
    animation: iiFadeUp .5s ease-out;
}

@keyframes iiFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모바일 전용 스타일 복제 및 오버라이드 */
#incident-index-m {
    width: min(560px, 100%);
    margin: 24px auto;
    padding-bottom: 16px;
    font-family: sans-serif;
    overflow-x: hidden;
}

#incident-index-m * {
    box-sizing: border-box;
}

#incident-index-m .incident-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px ;
    text-align: center;
}

#incident-index-m .ii-top {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
}

#incident-index-m .ii-donut,
#incident-index-m .ii-metrics-container {
    flex: 1 1 0;
    min-width: 0;
}

#incident-index-m .ii-metrics-container {
    padding-right: 16px;
}

#incident-index-m .ii-bar-row {
    width: 100%;
    margin-bottom: 12px;
}

#incident-index-m .ii-bar-label {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    align-items: center;
    font-weight: 600;
    font-size: clamp(12px, 3.4vw, 14px);
}

#incident-index-m .ii-bar-label span:first-child {
    min-width: 0;
}

#incident-index-m .ii-bar-label span:last-child {
    white-space: nowrap;
}

#incident-index-m .ii-bar-track {
    width: 100%;
    height: clamp(6px, 1.4vw, 8px);
    background: #E0E0E0;
    border-radius: 999px;
    overflow: hidden;
}

#incident-index-m .ii-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 1s ease;
}

#incident-index-m #ii-stageText {
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    margin: 16px 0;
}

#incident-index-m .ii-stage-icon {
    font-size: 16px;
    vertical-align: -2px;
}

#incident-index-m .ii-stage-blurb {
    margin-top: 4px;
}

#incident-index-m .ii-page-cta {
    width: min(420px, 80%);
    margin: 16px auto 0;
}

#incident-index-m #ii-openDetail {
    width: 100%;
    height: 38px;
    border-radius: 14px;
    border: 1px solid #111;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

#incident-index-m .ii-modal {
    width: min(520px, 90vw);
    max-height: calc(var(--vh-fixed, 100svh) - 12vh);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    scrollbar-gutter: stable;
    -ms-overflow-style: none;
}

#incident-index-m .ii-modal::-webkit-scrollbar {
    display: none;
}

#incident-index-m .ii-modal .title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin: 4px 0 16px;
}

#incident-index-m .ii-modal .summary {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 18px;
}

#incident-index-m .ii-modal .section {
    margin: 14px 0 18px;
}

#incident-index-m .ii-modal .section .head {
    color: #1E88E5;
    font-weight: 800;
    margin-bottom: 6px;
}

#incident-index-m .ii-modal .section .body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

#incident-index-m #ii-closeDetailCta {
    width: 70%;
    height: 38px;
    margin: 18px auto 0;
    display: block;
    border-radius: 14px;
    border: 1px solid #111;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 700px) {
    #incident-index-m {
        width: 100% !important;
        margin: 0;
        padding: 0;
    }

    #incident-index-m .ii-top {
        flex-direction: row !important;
        gap: 12px !important;
    }

    #incident-index-m .ii-bar-label {
        font-size: 14px !important;
    }

    #incident-index-m .ii-bar-track {
        height: 8px !important;
    }

    #incident-index-m .ii-bar-fill {
        background: var(--metric-color) !important; /* 색상 강제 */
    }

    #incident-index-m #ii-openDetail {
        border: 1px solid #111 !important;
        background: #fff !important;
        border-radius: 14px !important;
    }

    #incident-index-m .ii-modal {
        width: 90vw !important;
        padding: 20px !important;
    }

    #incident-index-m .ii-modal .title {
        font-size: 18px !important;
    }

    #incident-index-m .ii-modal .summary,
    #incident-index-m .ii-modal .body {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    .dcm_caseBox #incident-index-m {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        min-height: auto !important;
    }
}

.ii-bar-row[data-key="urgency"] .ii-bar-fill { background: #E53935 !important; }
.ii-bar-row[data-key="outcomeRisk"] .ii-bar-fill { background: #FBC02D !important; }
.ii-bar-row[data-key="complexity"] .ii-bar-fill { background: #FB8C00 !important; }
.ii-bar-row[data-key="selfHelp"] .ii-bar-fill { background: #26A69A !important; }
.ii-bar-row[data-key="lawyerNeed"] .ii-bar-fill { background: #5C6BC0 !important; }

/* 차트/막대/텍스트/버튼까지 포함해 초기 높이 예약 */
#incident-index,
#incident-index-m {
  min-height: 420px;           /* 필요 시 520~580px 범위에서 미세조정 */
}

