/* 학교·기관·공개 설문 화면의 공통 보완 스타일. 기본 레이아웃은 sub.css에서 관리한다. */
/* 단계 구분에는 :where를 사용해 기존 선택자의 우선순위를 유지한다. */

.surveyPage .srvyStep.surveyTwoSteps li:nth-child(2)::after {
    display: none;
}

.surveyPage .surveyHistoryNotice {
    margin-top: 12px;
    font-size: var(--fs14);
    line-height: 1.5;
}

.surveyPage .surveySchoolListWrap {
    overflow-x: auto;
}

.surveyPage .surveySchoolListTable {
    min-width: 880px;
}

.surveyPage .surveySchoolListWithStages {
    min-width: 1000px;
}

.surveyPage .surveySchoolListTable .srvyBtSt {
    min-width: 10rem;
    white-space: nowrap;
}

.surveyPage .surveySchoolListTable .surveyHistoryLink {
    min-width: 11rem;
}

.surveyPage .surveySchoolListTable .surveyStage {
    white-space: nowrap;
}

.surveyPage .surveyStage.surveyPreparing {
    background-color: #EFEFEF;
}

.surveyPage .surveyStage.surveyInProgress {
    background-color: rgba(217, 237, 119, 0.50);
}

.surveyPage .surveyStage.surveyClosed {
    background-color: #C8F7FF;
}

.surveyPage .surveyStageHeader {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.surveyPage .surveySchoolListTable .surveyStageHelp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
    height: 24px;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    cursor: help;
}

.surveyPage .surveyStageHelp:focus-visible {
    outline: 2px solid #2F7DFE;
    outline-offset: 3px;
}

.surveyPage .surveyStageHelpIcon {
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background: var(--info) center / contain no-repeat;
}

/* body에 표시하여 가로 스크롤 표 안에서도 설명이 잘리지 않게 한다. */
.surveyPage .surveyStageTooltip {
    position: fixed;
    z-index: 101;
    width: 400px;
    max-width: calc(100vw - 24px);
    margin: 0;
    padding: 12px 16px;
    box-sizing: border-box;
    border: 1px solid #cbd4df;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.surveyPage .surveyStageTooltip[hidden] {
    display: none;
}

.surveyPage .surveyStageTooltip dl {
    margin: 0;
    overflow-y: auto;
}

.surveyPage .surveyStageTooltip dt {
    font-weight: 700;
}

.surveyPage .surveyStageTooltip dd {
    margin: 2px 0 12px;
}

.surveyPage .surveyStageTooltip dd:last-child {
    margin-bottom: 0;
}

.surveyPage .surveyStageTooltip::before {
    content: '';
    position: absolute;
    left: var(--survey-tooltip-arrow-left);
    width: 8px;
    height: 8px;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
}

.surveyPage .surveyStageTooltip[data-side="bottom"]::before {
    top: -5px;
    border-top: 1px solid #cbd4df;
    border-left: 1px solid #cbd4df;
}

.surveyPage .surveyStageTooltip[data-side="top"]::before {
    bottom: -5px;
    border-bottom: 1px solid #cbd4df;
    border-right: 1px solid #cbd4df;
}

:where(.surveyStep2) .srvyRespondent .respondentTitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
}

:where(.surveyStep2) .srvyRespondent .respondentTitle .btnRefreshAllResponseCount {
    width: 3.2rem !important;
    min-width: 3.2rem !important;
    height: 3.2rem !important;
    padding: 0 !important;
    background-position: center !important;
    font-size: 0;
    line-height: 0;
}

:where(.surveyStep2) .analysisSummaryList .analysisTitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
}

:where(.surveyStep2) .analysisSummaryList .srvyStart .analysisTitle .btnRefreshAnalysisStatus {
    position: static !important;
    display: inline-block !important;
    width: 3.2rem !important;
    min-width: 3.2rem !important;
    height: 3.2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d7d7d7;
    border-radius: .4rem !important;
    color: #555;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle;
    background-image: var(--bt4-refresh) !important;
    background-size: 1.4rem auto;
    background-repeat: no-repeat;
    background-position: center !important;
}

:where(.surveyStep2) .analysisSummaryList .srvyStart .analysisTitle .btnRefreshAnalysisStatus::before {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 3rem;
}

:where(.surveyStep2) .caution {
    margin: 0 !important;
}

/* 버튼 태그와 링크형 버튼에 같은 비활성 색상을 적용한다. 단계 표시는 기존 디자인을 유지한다.
   기본 버튼의 hover 배경과 페이지별 색상보다 비활성 상태를 우선한다. */
.surveyPage :is(button, a):is(:disabled, .disabled, [aria-disabled="true"]):not(.srvyStep a) {
    background-color: #ccc !important;
    background-image: var(--survey-disabled-icon, none) !important;
    border-color: #ccc !important;
    color: #777 !important;
    cursor: default;
    opacity: 1;
}

/* 새로고침 아이콘은 지우지 않고 회색 버튼 위에 그대로 표시한다. */
.surveyPage .refresh:is(:disabled, .disabled, [aria-disabled="true"]) {
    --survey-disabled-icon: var(--bt4-refresh);
}

.surveyPage a:is(.disabled, [aria-disabled="true"]) {
    cursor: default;
    pointer-events: none;
}

.surveyPage .stepBt .srvyNext:is(.disabled, [aria-disabled="true"])::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 6.5L15 12.5L9 18.5' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:where(.surveyStep2) .analysisSummaryList > li {
    min-height: 25rem;
    box-sizing: border-box;
}

:where(.surveyStep2) .analysisSummaryList .respondentMeta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 2rem;
}

:where(.surveyStep2) .analysisSummaryList .respondentDivider {
    width: 1px;
    height: 2rem;
    background: #d8d8d8;
}

:where(.surveyStep2) .analysisSummaryList .statusBasis,
:where(.surveyStep2) .analysisSummaryList .statusMessage {
    display: block;
}

:where(.surveyStep2) .analysisSummaryList .statusBasis {
    margin-bottom: .8rem;
}

:where(.surveyStep2) .analysisSummaryList .statusMessage {
    min-height: 2.4rem;
}

:where(.surveyStep2) .analysisSummaryList .statusMessage.hasNewResponse {
    font-weight: 700;
}

/* 초기 숨김은 .show()/.hide()/.toggle()로 전환하므로 !important를 사용하지 않는다. */
.surveyPage .surveyReportForm,
.surveyPage .surveyInitiallyHidden,
.surveyPage .layerPop.srvyLoding .analysisLoadingClose {
    display: none;
}

.surveyPage .layerPop.srvyLoding,
.surveyPage .layerPop.srvyLayer {
    z-index: 102;
    display: none;
}

.surveyPage .layerPop.srvyLoding .bottom .analysisLoadingNotice {
    font-size: 17px;
}

/* 기관 step2: 마감 관리와 설문 보고서 진입 */
.surveyPage .surveyClosingPanel {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    font-size: var(--fs14);
    line-height: 1.6;
}

.surveyPage .surveyClosingPanel h3 {
    margin-bottom: 12px;
    font-size: var(--fs18);
    font-weight: 700;
}

.surveyPage .surveyClosingActions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

/* 기관 step3: 설문 이력과 보고서 조회 */
.surveyPage #surveyRoundHistory {
    margin-top: 40px;
}

.surveyPage #analysisHistoryArea .tableWrap {
    overflow-x: auto;
}

.surveyPage #analysisHistoryArea table {
    min-width: 660px;
}

.surveyPage .surveyHistoryDescription,
.surveyPage .surveyHistoryLoading {
    margin-bottom: 16px;
    font-size: var(--fs14);
    line-height: 1.5;
}

.surveyPage #analysisHistoryArea .historyReport {
    white-space: nowrap;
}

.surveyPage #analysisHistoryArea .surveyClosingTable {
    min-width: 880px;
}

.surveyPage .surveyClosingNotice {
    margin: 24px 0;
    padding: 24px;
    border: 1px solid #d8d8d8;
    background: #f5f7f9;
    font-size: var(--fs14);
    line-height: 1.6;
}

/* 보고서 조회 화면 */
.surveyPage .surveyReportError {
    padding: 20px;
    border: 1px solid #ddd;
    background: #fafafa;
}

.surveyPage .surveyReportErrorTitle {
    font-weight: bold;
    margin-bottom: 10px;
}

.surveyPage .surveyReportAction {
    padding: 40px 20px;
    text-align: center;
}

.surveyPage .surveyReportMessage {
    margin-bottom: 20px;
}
