/* ── 검색 패널 ── */
#search-panel-box {
    position: absolute;
    top: 8px;
    left: 52px;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    border-radius: 10px;
    padding: 8px;
    width: 280px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: 'Malgun Gothic', sans-serif;
}

.search-input-row {
    display: flex;
    gap: 6px;
}

#search-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: 'Malgun Gothic', sans-serif;
    outline: none;
}
#search-input:focus { border-color: #1565C0; }

#search-clear-btn {
    display: none;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
#search-clear-btn:hover { background: #fce4e4; color: #f44336; border-color: #f44336; }

#search-submit-btn {
    background: #1565C0;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Malgun Gothic', sans-serif;
    white-space: nowrap;
}
#search-submit-btn:hover { background: #0d47a1; }

#search-results-list {
    margin-top: 6px;
    max-height: 340px;
    overflow-y: auto;
}

.search-result-item {
    padding: 8px 6px;
    border-radius: 6px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #eef3ff; }

.search-result-name {
    font-weight: bold;
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-addr {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-cat {
    font-size: 10px;
    color: #aaa;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-actions {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}
.result-route-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'Malgun Gothic', sans-serif;
    font-weight: bold;
}
.result-route-btn.start-btn { background: #4CAF50; color: white; }
.result-route-btn.end-btn   { background: #F44336; color: white; }
.result-route-btn:hover { opacity: 0.82; }

#search-requery-bar {
    margin: 4px 0 2px 0;
}
#search-requery-btn {
    width: 100%;
    background: #f5f7ff;
    border: 1px dashed #9ab0e8;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    font-family: 'Malgun Gothic', sans-serif;
    color: #1565C0;
    cursor: pointer;
    text-align: center;
}
#search-requery-btn:hover { background: #dce8ff; border-color: #1565C0; }

.search-no-result {
    padding: 10px;
    color: #999;
    font-size: 12px;
    text-align: center;
}

html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        #map {
            width: 100%;
            height: 100vh;
        }

        /* ── 확대/축소 버튼 아이콘 ── */
        .ol-zoom {
            top: 8px;
            left: 8px;
            background: rgba(255,255,255,0.95);
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.18);
            padding: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .ol-zoom .ol-zoom-in,
        .ol-zoom .ol-zoom-out {
            width: 36px;
            height: 36px;
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0;
            color: transparent;
            padding: 0;
            transition: background 0.15s;
        }
        .ol-zoom .ol-zoom-in {
            border-bottom: 1px solid #e0e0e0;
            border-radius: 10px 10px 0 0;
        }
        .ol-zoom .ol-zoom-out {
            border-radius: 0 0 10px 10px;
        }
        .ol-zoom .ol-zoom-in:hover {
            background: #f0f4ff;
            border-radius: 10px 10px 0 0;
        }
        .ol-zoom .ol-zoom-out:hover {
            background: #f0f4ff;
            border-radius: 0 0 10px 10px;
        }
        /* + 아이콘 */
        .ol-zoom .ol-zoom-in::after {
            content: '';
            display: block;
            width: 20px;
            height: 20px;
            background: url("assets/icon-zoom-in.svg") center/contain no-repeat;
        }
        /* - 아이콘 */
        .ol-zoom .ol-zoom-out::after {
            content: '';
            display: block;
            width: 20px;
            height: 20px;
            background: url("assets/icon-zoom-out.svg") center/contain no-repeat;
        }

        .layer-switch {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255,255,255,0.95);
            border-radius: 14px;
            padding: 10px 12px;
            font-family: 'Malgun Gothic', sans-serif;
            z-index: 1000;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
            min-width: 180px;
        }

        .ls-title {
            font-size: 11px;
            color: #aaa;
            font-weight: bold;
            margin-bottom: 6px;
            letter-spacing: 0.03em;
        }

        /* 기본 지도 탭 버튼 */
        .ls-basemap-row {
            display: flex;
            background: #f0f2f5;
            border-radius: 8px;
            padding: 3px;
            gap: 2px;
            margin-bottom: 8px;
        }
        .ls-map-btn {
            flex: 1;
            display: block;
            margin: 0;
            cursor: pointer;
        }
        .ls-map-btn input[type=radio] { display: none; }
        .ls-map-btn span {
            display: block;
            text-align: center;
            font-size: 12px;
            padding: 4px 2px;
            border-radius: 6px;
            color: #666;
            font-weight: 500;
            transition: background 0.15s, color 0.15s;
            white-space: nowrap;
        }
        .ls-map-btn input[type=radio]:checked + span {
            background: white;
            color: #1565C0;
            font-weight: bold;
            box-shadow: 0 1px 4px rgba(0,0,0,0.12);
        }

        /* 레이어 토글 버튼 */
        #layer-toggle-btn {
            width: 100%;
            background: none;
            border: none;
            border-top: 1px solid #eee;
            padding: 7px 0 0 0;
            font-size: 13px;
            font-family: 'Malgun Gothic', sans-serif;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            color: #333;
        }
        #layer-toggle-btn:hover .ls-toggle-label { color: #1565C0; }

        .ls-icon {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            vertical-align: middle;
        }

        .ls-toggle-label {
            font-size: 13px;
            font-weight: bold;
            color: #333;
            flex: 1;
            text-align: left;
        }
        .ls-count {
            font-size: 11px;
            color: #aaa;
            margin-right: 6px;
        }
        .ls-arrow {
            font-size: 10px;
            color: #aaa;
            transition: transform 0.2s;
            display: inline-block;
        }
        .ls-arrow.open { transform: rotate(90deg); }

        /* 레이어 항목 */
        #layer-panel { margin-top: 6px; }
        .ls-layer-item {
            display: flex;
            align-items: center;
            gap: 7px;
            padding: 4px 0;
        }
        .ls-dot {
            font-size: 10px;
            color: #1565C0;
            flex-shrink: 0;
        }
        .ls-dot-off { color: #ccc; }
        .ls-layer-name {
            flex: 1;
            font-size: 12px;
            color: #444;
        }

        /* ── 경로 버튼 ── */
        #route-toggle {
            position: absolute;
            top: 165px;
            right: 10px;
            z-index: 1000;
            background: rgba(255,255,255,0.9);
            border: 1px solid #ccc;
            border-radius: 8px;
            padding: 6px 16px;
            font-size: 14px;
            cursor: pointer;
            font-family: 'Malgun Gothic', sans-serif;
            box-shadow: 0 1px 4px rgba(0,0,0,0.15);
        }
        #route-toggle:hover { background: #f0f0f0; }
        #route-toggle.active { background: #1565C0; color: white; border-color: #1565C0; }

        /* ── 경로 패널 ── */
        #route-panel {
            display: none;
            position: absolute;
            top: 203px;
            right: 10px;
            z-index: 1000;
            background: rgba(255,255,255,0.97);
            border-radius: 10px;
            padding: 12px;
            width: 200px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            font-family: 'Malgun Gothic', sans-serif;
            font-size: 13px;
        }

        .panel-title {
            font-weight: bold;
            font-size: 14px;
            margin-bottom: 8px;
            color: #333;
        }

        .point-row {
            display: flex;
            align-items: center;
            padding: 5px 8px;
            border-radius: 6px;
            cursor: pointer;
            margin-bottom: 4px;
            border: 2px solid transparent;
            background: #f5f5f5;
            gap: 8px;
            transition: background 0.15s;
        }
        .point-row:hover { background: #eef3ff; }
        .point-row.selecting {
            border-color: #1565C0;
            background: #e3edf9;
        }

        .point-badge {
            min-width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 11px;
            flex-shrink: 0;
        }

        .coord-text {
            flex: 1;
            color: #999;
            font-size: 11px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .coord-text.set { color: #333; }

        .coord-input {
            flex: 1;
            border: none;
            background: transparent;
            font-size: 11px;
            font-family: 'Malgun Gothic', sans-serif;
            color: #999;
            outline: none;
            min-width: 0;
            cursor: text;
            padding: 0;
        }
        .coord-input.set { color: #333; }
        .coord-input:focus { color: #1565C0; background: #f0f5ff; border-radius: 3px; padding: 1px 3px; }
        .coord-input::placeholder { color: #bbb; }

        .clear-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: #bbb;
            padding: 2px 4px;
            font-size: 14px;
            flex-shrink: 0;
            line-height: 1;
        }
        .clear-btn:hover { color: #f44336; }

        #add-via-btn {
            width: 100%;
            background: none;
            border: 1px dashed #bbb;
            border-radius: 6px;
            padding: 5px;
            cursor: pointer;
            color: #888;
            font-size: 12px;
            margin: 2px 0 4px 0;
            font-family: 'Malgun Gothic', sans-serif;
        }
        #add-via-btn:hover { background: #f5f5f5; border-color: #999; }

        hr.panel-divider {
            border: none;
            border-top: 1px solid #eee;
            margin: 8px 0;
        }

        .gyeongbuk-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #333;
            cursor: pointer;
            font-weight: bold;
        }
        #use-sk {
            width: 15px;
            height: 15px;
            accent-color: #1565C0;
            cursor: pointer;
        }

        .route-actions {
            display: flex;
            gap: 6px;
            margin-top: 8px;
        }

        #search-btn {
            flex: 1;
            background: #1565C0;
            color: white;
            border: none;
            border-radius: 6px;
            padding: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            font-family: 'Malgun Gothic', sans-serif;
        }
        #search-btn:hover { background: #0d47a1; }
        #search-btn:disabled { background: #90a4ae; cursor: default; }

        #clear-all-btn {
            background: #f5f5f5;
            border: 1px solid #ddd;
            border-radius: 6px;
            padding: 8px 12px;
            cursor: pointer;
            font-size: 13px;
            font-family: 'Malgun Gothic', sans-serif;
        }
        #clear-all-btn:hover { background: #e0e0e0; }

        /* ── 교통정보 토글 ── */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 22px;
            flex-shrink: 0;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute;
            inset: 0;
            background: #ccc;
            border-radius: 22px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .toggle-slider::before {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            left: 3px;
            top: 3px;
            background: white;
            border-radius: 50%;
            transition: transform 0.2s;
        }
        .toggle-switch input:checked + .toggle-slider { background: #1565C0; }
        .toggle-switch input:checked + .toggle-slider::before { transform: translateX(30px); }

        .method-sep {
            width: 1px;
            height: 18px;
            background: #ddd;
            flex-shrink: 0;
            margin: 0 4px;
        }

        .height-input {
            width: 60px;
            border: 1px solid #ccc;
            border-radius: 6px;
            padding: 4px 6px;
            font-size: 12px;
            font-family: 'Malgun Gothic', sans-serif;
            text-align: center;
            outline: none;
            background: #fafafa;
        }
        .height-input:focus { border-color: #1565C0; }
        .height-input:disabled { background: #eee; color: #aaa; cursor: not-allowed; }

        /* ── 경로 옵션 ── */
        .method-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }
        .method-label {
            font-size: 12px;
            color: #555;
            white-space: nowrap;
        }
        /* ── panel-select ── */
        .panel-select {
            flex: 1;
            border: 1px solid #ccc;
            border-radius: 6px;
            padding: 5px 8px;
            font-size: 12px;
            font-family: 'Malgun Gothic', sans-serif;
            background: #fafafa;
            cursor: pointer;
            outline: none;
        }
        .panel-select:focus { border-color: #1565C0; }

        #route-info {
            font-size: 12px;
            color: #1565C0;
            margin-top: 6px;
            text-align: center;
            font-weight: bold;
        }

        .select-hint {
            font-size: 11px;
            color: #888;
            margin-bottom: 6px;
        }

        /* ── 우클릭 컨텍스트 메뉴 ── */
        #ctx-menu, #marker-ctx-menu {
            display: none;
            position: fixed;
            z-index: 2000;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.22);
            padding: 6px 0;
            min-width: 140px;
            font-family: 'Malgun Gothic', sans-serif;
            font-size: 14px;
            overflow: hidden;
        }
        .ctx-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 16px;
            cursor: pointer;
            color: #222;
        }
        .ctx-item:hover { background: #f0f5ff; }
        .ctx-icon {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 12px;
            flex-shrink: 0;
        }
        /* ── 도로 속성 팝업 ── */
        #road-attr-popup {
            display: none;
            position: fixed;
            z-index: 3000;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.28);
            width: 320px;
            max-height: 420px;
            font-family: 'Malgun Gothic', sans-serif;
            font-size: 13px;
            overflow: hidden;
            flex-direction: column;
        }
        .road-attr-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #6A1B9A;
            color: white;
            padding: 10px 14px;
            font-weight: bold;
            cursor: move;
            user-select: none;
            font-size: 13px;
        }
        .road-attr-close {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            font-size: 15px;
            line-height: 1;
            padding: 0;
        }
        .road-attr-close:hover { opacity: 0.75; }
        #road-attr-body {
            overflow-y: auto;
            max-height: 360px;
            padding: 8px 0;
        }
        .road-attr-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }
        .road-attr-table tr:nth-child(even) { background: #f9f4ff; }
        .road-attr-table td {
            padding: 5px 14px;
            vertical-align: top;
            border-bottom: 1px solid #f0e6ff;
        }
        .road-attr-table td:first-child {
            color: #6A1B9A;
            font-weight: bold;
            white-space: nowrap;
            width: 40%;
        }
        .road-attr-table td:last-child {
            color: #333;
            word-break: break-all;
        }
        .road-attr-no-feat {
            padding: 20px;
            text-align: center;
            color: #999;
            font-size: 12px;
        }

        .ctx-divider {
            border: none;
            border-top: 1px solid #eee;
            margin: 4px 0;
        }