
@media (max-width: 1152px) {
    #searchResult .code-shortcut-change { display: none }
}

@media (max-width: 991px) {
    body { background-color: #fafafa; overflow: auto; height: auto}
    html, body {
        margin: 0;
        padding: 0;
        height: auto !important;
        min-height: 100vh;
    }
    .jstree-proton-responsive .jstree-anchor { height: unset; line-height: 33px; }
    .jstree-proton-responsive .jstree-themeicon { background-position: unset}
    .jstree-proton-responsive .jstree-container-ul { overflow: unset}
    .jstree-anchor {white-space: unset}

    #center {
        position: relative;
        top: 165px;
        height: auto;
        overflow: visible;
        border-top: 1px solid #eee;
        padding-bottom: 24px;
    }
    #center.opened { padding: 10px 20px }

    #searchResult { display: block; height: 100%; margin-top: 0}
    #searchResult.focus { display: block }
    #searchResult .clickable-text { min-width: 33% }
    #searchResult > div:not(#industryTree, #goConsulting) { margin-top: 0; }
    #searchResult .pdf-btn { display: none }
    #searchResult .upper-code-tr { display: none }
    #industryTree { display: none; position: relative; width: 100%; height: 100%; top: unset; border-radius: 15px; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); background: #FFF; border: 1px solid #cacdcd; padding: 0 10px 10px 10px; overflow-x: scroll; scrollbar-width: thin}
    #industryTree.focus {display: none}
    #industryCdTree { width: 100% }

    #industryTitle { display: flex !important; margin-left: unset; position: absolute; top: 67px; width: 100%; flex-wrap: wrap; gap: 6px}
    #industryTree h5 { font-size: 1.2rem }
    #industryTitle select {
        height: 35px;
        border: 1px solid #ced4da;
        border-radius: 20px;
        color: #212529;
        background-color: #fff;
        text-decoration: none;
        text-align: center;
        font-size: 1rem;
        margin-left: unset;

        appearance: none; /* 기본 화살표 제거 */
        -webkit-appearance: none;
        -moz-appearance: none;

        padding: 0px 30px 0px 10px; /* 오른쪽 패딩 확보 */
        border: 1px solid #ccc;
        font-size: 16px;

        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
        background-size: 14px;
        background-repeat: no-repeat;
        background-position: right .75rem center;
        background-size: 16px 12px;
    }
    #industryTitle select:first-child { width: 100% }
    #industryTitle select:last-child { width: 100% }

    #codePostSide { display: none; width: 90vw; height: auto; margin: 15px auto; border-radius: 15px; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); }
    #codePost { display: none !important; }
}
@media  (max-width: 991px) {
    #center{
        top:3rem;
    }
    #industryTitleTop select{
        position: fixed;
        top:5.5rem;
    }
    /* 왼쪽 상단 "분류표" 버튼 */
    #treeModalOpenBtn {
        position: fixed;
        right : 1rem;
        top: 5.2rem;
        z-index: 2000;
        padding: 10px 12px;
        border-radius: 999px;
        border: 1px solid #e5e5e5;
        background: #fff;
        font-weight: 700;
        font-size: 14px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    }

}
@media  (max-width: 768px) {

    #industryTitleTop select{
        top:4.5rem;
    }
    #treeModalOpenBtn{
        top:4.2rem;
    }

}
.changeCategoryAno {
   color:orangered;
    margin-bottom: 0;
    margin-left: 1rem;
}

/* ===================== Mobile Tree Modal (<=600px) ===================== */
.tree-modal-open-btn{
    display:none;
    position: fixed;
    left: 12px;
    top: 7.2rem; /* 헤더 아래 */
    z-index: 1200;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.tree-modal{
    display:none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.tree-modal.open{ display:block; }

.tree-modal-backdrop{
    position:absolute;
    inset:0;
    background: rgba(0,0,0,0.45);
}

.tree-modal-panel{
    position:absolute;
    left: 0;
    top: 0;
    width: 88vw;
    max-width: 420px;
    height: 100%;
    background: #fff;
    box-shadow: 4px 0 18px rgba(0,0,0,0.2);
    display:flex;
    flex-direction: column;
}

.tree-modal-header{
    display:flex;
    align-items:center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.tree-modal-title{
    font-size: 15px;
    font-weight: 800;
}

.tree-modal-close{
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
}

.tree-modal-body{
    flex: 1;
    overflow: auto;
    padding: 10px 10px 20px 10px;
}

/* 모달 안에서는 트리 강제 표시 */
.tree-modal #industryTree{
    display:block !important;
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid #cacdcd;
    padding: 0 10px 10px 10px;
    overflow-x: auto;
}

/* iOS에서 배경 스크롤 방지용 */
body.tree-modal-open{
    overflow:hidden !important;
    touch-action:none;
}

@media (max-width: 991px){
    .tree-modal-open-btn{ display:inline-flex; align-items:center; }
    .changeCategoryAno{
        display: none;
    }
    .connect-wrap { max-height: none; overflow: visible; }

    .connect-wrap table,
    .connect-wrap thead,
    .connect-wrap tbody,
    .connect-wrap th,
    .connect-wrap td,
    .connect-wrap tr {
        display: block;
        width: 100%;
    }

    .connect-wrap thead { display: none; } /* 헤더 숨김 */

    .connect-wrap tr {
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 10px 12px;
        margin: 10px 0;
        background: #fff;
    }

    .connect-wrap td {
        border: none !important;
        padding: 6px 0;
        display: flex;
        gap: 10px;
        align-items: flex-start;
    }

    /* 왼쪽 라벨(헤더) */
    .connect-wrap td::before {
        content: attr(data-label);
        flex: 0 0 70px;
        font-weight: 800;
        color: #666;
        white-space: nowrap;
    }

    /* 오른쪽 값 */
    .connect-wrap td {
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    /* 설명은 좀 더 넓게 */
    .connect-wrap td[data-label="설명"]::before { flex-basis: 50px; }
}
