body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    overflow: hidden;
}

/* ===== 상단 메뉴바 (심플·뉴트럴) ===== */
#topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    box-sizing: border-box;
}
.topbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.01em;
    white-space: nowrap;
    padding-right: 4px;
    border-right: 1px solid #e5e7eb;
}
.brand-ic { font-size: 16px; line-height: 1; }

.topbar-controls label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.topbar-controls input {
    cursor: pointer;
}

/* V-World 인증키 오류 배너(비차단) */
#vworldBanner {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    gap: 10px;
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
}
#vworldBanner button {
    flex-shrink: 0;
    border: 1px solid #d1a04a;
    background: #fff;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}
#vworldBanner button:hover { background: #fffbeb; }

/* 지도는 상단바 아래를 채움 */
#map {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
}

/* 기본: 연한 뉴트럴 버튼 */
.map-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 8px 13px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.map-btn:hover { background: #e5e7eb; }
.map-btn .ic { font-size: 14px; line-height: 1; }

/* 주요 동작(매물 불러오기): 은은한 강조 */
.map-btn.primary {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.map-btn.primary:hover { background: #dbeafe; }

/* 파괴적 동작(초기화): 은은한 빨강 */
.map-btn.danger {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}
.map-btn.danger:hover { background: #fee2e2; }

/* 보조(인증키): 아주 옅게 */
.map-btn.ghost {
    color: #6b7280;
    background: transparent;
    border-color: #e5e7eb;
    font-weight: 600;
}
.map-btn.ghost:hover { background: #f3f4f6; }

/* 버튼 안 작은 캡션 (매물 불러오기) — 버튼 높이는 다른 버튼과 동일하게 유지 */
.import-btn {
    padding-top: 4px;
    padding-bottom: 4px;
}
.import-labels {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.15;
}
.import-cap {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.75;
    white-space: nowrap;
}

/* 사용자 배지 (우측 상단) */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 260px;
}
.user-badge .user-ic { font-size: 14px; line-height: 1; }
.user-badge .user-text { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
    .user-badge .user-text { display: none; } /* 좁은 화면에선 아이콘만 */
}

/* 지도/스카이뷰 세그먼트 토글 */
.seg-group { display: inline-flex; }
.map-btn.seg { border-radius: 0; }
.seg-group .map-btn.seg:first-child { border-radius: 7px 0 0 7px; }
.seg-group .map-btn.seg:last-child { border-radius: 0 7px 7px 0; margin-left: -1px; }
.map-btn.seg.active {
    color: #fff;
    background: #374151;
    border-color: #374151;
}

/* 상단바에 들어온 카카오 그리기 툴박스 */
.toolbox-slot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
/* 텍스트 도구 버튼(그리기 툴박스 옆) */
.text-tool-btn { padding: 6px 11px; }
.text-tool-btn .tt-ic {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}
.text-tool-btn.active {
    color: #fff;
    background: #374151;
    border-color: #374151;
}
.toolbox-slot > * {
    position: static !important;
    margin: 0 !important;
}

#popup, #addressPopup {
    display: none;
    position: absolute;
    /* position: absolute 컨텍스트 — 우상단 닫기 버튼 기준점 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    font-size: 14px;
    font-weight: bold;
    border-radius: 10px;
    width: 300px;
    box-sizing: border-box;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}
.popup-close:hover { background: #fee2e2; color: #dc2626; }

#popup h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 10px;
    text-align: left;
}

#popup label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 3px;
}

#popup input[type="text"],
#popup input[type="color"],
#popup input[type="number"],
#popup textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: 'Arial', sans-serif;
}

#popup textarea {
    height: 40px;
    line-height: 1.4;
    resize: vertical;
}


#submitBtn, #closeAddressPopup {
    background-color: #0008ffde;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

#submitBtn:hover {
    background-color: #0056b3;
}

/* [기능 복원] 주소 팝업 닫기 버튼 스타일 */
#closeAddressPopup {
    background-color: #6c757d;
    width: auto;
    margin-top: 0;
}
#closeAddressPopup:hover {
    background-color: #5a6268;
}

/* 지번조회 팝업: 주소 옆 복사 버튼 */
.addr-copy-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    cursor: pointer;
    vertical-align: middle;
    white-space: nowrap;
}
.addr-copy-btn:hover { background: #e5e7eb; }
.addr-copy-btn.copied { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }

/* 지시선 끝(실제 필지 위치) 점 표시 */
.anchor-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

/* 카드 크기 자동조절: 지도 크기·카드 수에 따라 script.js 가 --card-scale 을 갱신(document.documentElement 에 세팅) */
:root { --card-scale: 1; }
/* 카드 개별 크기: script.js 가 카드 요소에 --card-zoom(기본 1)을 세팅 → 자동 축소 배율과 곱해져 적용 */
.overlay {
    position: relative;
    padding: calc(5px * var(--card-scale, 1) * var(--card-zoom, 1));
    font-size: calc(12pt * var(--card-scale, 1) * var(--card-zoom, 1));
    font-weight: bold;
    cursor: move;
    border: calc(2px * var(--card-scale, 1) * var(--card-zoom, 1)) solid #000;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: calc(10px * var(--card-scale, 1) * var(--card-zoom, 1));
    color: #333;
}

/* 카드 크기 조절 손잡이(오른쪽 아래 모서리) — 마우스를 올렸을 때만 보임, 터치 기기는 항상 보임 */
.card-resize {
    display: none;
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 3;
    touch-action: none;
    border-radius: 0 0 8px 0;
    background:
        linear-gradient(135deg,
            transparent 0 48%, #4b5563 48% 58%,
            transparent 58% 70%, #4b5563 70% 80%,
            transparent 80%);
}
.overlay:hover .card-resize { display: block; }
@media (hover: none) {
    .card-resize { display: block; opacity: 0.8; }
}

/* 경로 순번을 카드 좌상단 모서리에 표시 */
.overlay .route-num {
    position: absolute;
    top: -11px;
    left: -11px;
    min-width: 22px;
    height: 22px;
    padding: 0 3px;
    box-sizing: border-box;
    border-radius: 11px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* 디스코 실거래 카드: 파란 바탕 */
.overlay.overlay-disco {
    background: #d6e6fb;
}
.overlay.overlay-disco td {
    background: rgba(255, 255, 255, 0.55);
}

/* 네이버 매물 카드: 초록 바탕 */
.overlay.overlay-naver {
    background: #d7f0d9;
}
.overlay.overlay-naver td {
    background: rgba(255, 255, 255, 0.55);
}

/* 메모: 줄 없는 자유 메모장(제목 메모 N) — 상단바 톤과 어울리는 뉴트럴/모던 카드. 드래그 이동 + 크기조절 */
.memo {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12), 0 1px 2px rgba(17, 24, 39, 0.06);
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}
.memo-head {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f9fafb;
    padding: 7px 8px 7px 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #6b7280;
    cursor: move;
    border-bottom: 1px solid #f0f1f3;
    user-select: none;
}
/* 제목 앞 앰버 점 (포인트 컬러) */
.memo-head::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
}
.memo-title { flex: 1; }
.memo-del {
    cursor: pointer;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 5px;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.memo-del:hover { color: #dc2626; background: #fef2f2; }
.memo-text {
    display: block;
    width: 180px;
    height: 96px;
    min-width: 130px;
    min-height: 54px;
    border: none;
    background: transparent;
    resize: both;               /* 드래그로 크기 조절 */
    padding: 9px 11px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #374151;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    overflow: auto;
}
.memo-text::placeholder { color: #b9bec7; }

/* ===== 상단바: 주소 입력(이동) + 내 위치 ===== */
.addr-search { gap: 6px; }
.addr-input {
    width: 250px;
    height: 34px;
    box-sizing: border-box;
    padding: 0 11px;
    font-size: 13px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    outline: none;
}
.addr-input:focus { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25); }
.addr-input::placeholder { color: #9ca3af; font-size: 12px; }
.addr-search .map-btn { height: 34px; padding-top: 0; padding-bottom: 0; }
@media (max-width: 600px) {
    .addr-input { width: 150px; }
}

/* 주소 검색 결과 핀(12초 뒤 자동 사라짐) */
.search-pin { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.search-pin .sp-label {
    max-width: 240px;
    padding: 4px 9px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(37, 99, 235, 0.95);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.search-pin .sp-dot {
    width: 14px;
    height: 14px;
    background: #2563eb;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 2px 5px rgba(0, 0, 0, 0.4);
    box-sizing: content-box;
}

/* ===== 텍스트 도구(지도 위 글자) ===== */
.maptext {
    position: relative;
    display: block;
    width: max-content;          /* 내용 길이만큼 가로로 펴짐(좁은 폭에서 한 글자씩 줄바꿈 방지) */
    max-width: none;
    writing-mode: horizontal-tb; /* 항상 가로쓰기 */
    padding: 2px 5px;
    border: 1px dashed transparent;
    border-radius: 5px;
    font-family: 'Arial', sans-serif;
}
.maptext:hover, .maptext:focus-within {
    border-color: #94a3b8;
    background: rgba(255, 255, 255, 0.4);
}
.mt-text {
    min-width: 28px;
    min-height: 1.25em;
    font-weight: 700;
    line-height: 1.25;
    white-space: pre;            /* 자동 줄바꿈 없음 — Enter 로만 줄바꿈 */
    word-break: keep-all;
    writing-mode: horizontal-tb;
    outline: none;
    cursor: text;
    /* 위성/복잡한 배경에서도 읽히도록 흰 테두리 */
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff, 0 0 2px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}
.mt-text:empty::before {
    content: attr(data-ph);
    color: #9ca3af;
    font-weight: 400;
    text-shadow: none;
}
.mt-bar {
    display: none;
    position: absolute;
    left: -1px;
    bottom: 100%;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.15);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
    user-select: none;
    z-index: 2;
}
.maptext:hover .mt-bar, .maptext:focus-within .mt-bar { display: flex; }
.mt-grip { cursor: move; padding: 1px 5px; color: #6b7280; font-size: 13px; }
.mt-btn, .mt-del { cursor: pointer; padding: 1px 5px; border-radius: 4px; }
.mt-btn:hover { background: #f3f4f6; }
.mt-del { color: #9ca3af; font-size: 12px; }
.mt-del:hover { color: #dc2626; background: #fef2f2; }
.mt-color { width: 20px; height: 20px; padding: 0; border: 1px solid #d1d5db; border-radius: 4px; background: none; cursor: pointer; }

/* ===== 도보 경로 ===== */
#routePanel {
    display: none;
    position: absolute;
    top: 64px;
    right: 14px;
    z-index: 1100;
    width: 230px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 12px 14px;
    font-size: 13px;
    color: #333;
}
.rp-title { font-weight: 800; margin-bottom: 8px; font-size: 14px; }
.rp-row { margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.rp-row b { color: #1e40af; }
.rp-row span { flex: 1; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-mini { font-size: 11px; padding: 2px 6px; border: 1px solid #d1d5db; background: #f3f4f6; border-radius: 5px; cursor: pointer; }
.rp-hint { font-size: 11px; color: #777; margin: 8px 0; line-height: 1.4; }
.rp-actions { display: flex; gap: 6px; }
.rp-btn { flex: 1; font-size: 12px; font-weight: 700; padding: 7px 0; border: 1px solid #d1d5db; background: #f3f4f6; color: #374151; border-radius: 6px; cursor: pointer; }
.rp-btn.primary { background: #1e40af; border-color: #1e40af; color: #fff; }
.rp-btn:hover { filter: brightness(0.97); }
#rpResult { margin-top: 10px; font-size: 12px; font-weight: 700; color: #1e40af; min-height: 16px; line-height: 1.4; }

/* 경로 지정 모드일 때 카드에 클릭 유도 표시 */
.overlay.route-pick { cursor: pointer; }
.overlay.route-start { outline: 3px solid #16a34a; outline-offset: 1px; }
.overlay.route-end { outline: 3px solid #dc2626; outline-offset: 1px; }

/* 방문 순서 번호 뱃지 */
.route-badge {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #1e40af;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ===== 내 위치(실시간) ===== */
.geo-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a73e8;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
    animation: geopulse 1.6s ease-out infinite;
}
@keyframes geopulse {
    0%   { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.45), 0 1px 3px rgba(0, 0, 0, 0.4); }
    70%  { box-shadow: 0 0 0 16px rgba(26, 115, 232, 0), 0 1px 3px rgba(0, 0, 0, 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0), 0 1px 3px rgba(0, 0, 0, 0.4); }
}

.overlay table {
    border-collapse: collapse;
    width: 100%;
}

.overlay th, .overlay td {
    border: 1px solid #ddd;
    padding: calc(4px * var(--card-scale, 1) * var(--card-zoom, 1));
    text-align: center;
}

.overlay th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

#contextMenu {
    display: none;
    position: absolute;
    z-index: 1001;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

#contextMenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#contextMenu ul li {
    padding: 10px 15px;
    cursor: pointer;
    background: white;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}
#contextMenu ul li:last-child {
    border-bottom: none;
}

#contextMenu ul li:hover {
    background: #f5f5f5;
}

/* ===== 매물 불러오기 진행 표시 ===== */
#importStatus {
    display: none;
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    background: rgba(33, 37, 41, 0.92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ===== 국공유지조회 범례 ===== */
#ownerLegend {
    display: none;
    position: absolute;
    top: 64px;
    left: 12px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.7;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}
#ownerLegend .lg-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
#ownerLegend .lg-sw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
#ownerLegend .lg-sub { color: #6b7280; font-size: 11px; }

/* ===== 자동저장 상태 표시 ===== */
#autosaveNote {
    position: absolute;
    bottom: 12px;
    left: 15px;
    z-index: 1000;
    font-size: 11px;
    color: #666;
    background: rgba(255, 255, 255, 0.75);
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* ===== 모바일 대응 ===== */
@media (max-width: 600px) {
    #topbar {
        gap: 8px;
        padding: 0 8px;
    }
    .map-btn {
        padding: 8px 11px;
        font-size: 12px;
    }
    #popup, #addressPopup {
        width: calc(100vw - 30px);
        max-width: 340px;
    }
}

/* ===== 상단 카테고리 메뉴(드롭다운) ===== */
.menubar { gap: 4px; margin-right: auto; } /* 로고 바로 옆 왼쪽 정렬, 지도/스카이뷰는 오른쪽 끝 */
.menu { position: relative; }
.menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.menu-trigger:hover { background: #f3f4f6; }
.menu.open .menu-trigger { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.menu-trigger .caret { font-size: 10px; opacity: 0.6; }

/* 상단바가 가로 스크롤이라 패널은 fixed 로 띄움(위치는 ui.js 가 계산) */
.menu-panel {
    display: none;
    position: fixed;
    z-index: 1500;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.16);
}
.menu.open .menu-panel { display: flex; flex-direction: column; gap: 2px; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}
.menu-item:hover { background: #f3f4f6; }
.menu-item .ic { width: 18px; text-align: center; font-size: 14px; }
.menu-item.primary { color: #1d4ed8; }
.menu-item.primary:hover { background: #eff6ff; }
.menu-item.danger { color: #b91c1c; }
.menu-item.danger:hover { background: #fef2f2; }
.menu-sub { margin-left: auto; padding-left: 10px; font-size: 11px; font-weight: 500; color: #9ca3af; }
.menu-sep { height: 1px; margin: 4px 2px; background: #f0f1f3; }

.menu-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.menu-check:hover { background: #f3f4f6; }
.menu-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; }

/* ===== 사용법 팝업 ===== */
.info-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2600;
    background: rgba(17, 24, 39, 0.45);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.info-modal.open { display: flex; }
.info-modal-box {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.info-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f0f1f3;
}
.info-modal-head h2 { margin: 0; font-size: 17px; color: #111827; }
.info-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.info-modal-close:hover { background: #fee2e2; color: #dc2626; }
.info-modal-body {
    padding: 6px 20px 20px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.65;
    color: #374151;
}
.info-modal-body h3 { margin: 18px 0 6px; font-size: 14.5px; color: #111827; }
.info-modal-body ul { margin: 0; padding-left: 18px; }
.info-modal-body li { margin-bottom: 4px; }
.guide-lead { margin: 12px 0 0; padding: 10px 12px; background: #eff6ff; border-radius: 8px; color: #1e40af; font-weight: 600; }
.guide-foot { margin: 18px 0 0; font-size: 12px; color: #6b7280; }

/* ===== 피드백 / 개발상담 입력 창 ===== */
.contact-form { display: flex; flex-direction: column; gap: 6px; }
.contact-form .guide-lead { margin-bottom: 6px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-label { margin-top: 6px; font-size: 13px; font-weight: 700; color: #111827; }
.cf-req { color: #dc2626; }
.cf-opt { font-weight: 500; color: #9ca3af; }
.contact-form textarea,
.contact-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
}
.contact-form textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.contact-form textarea:focus,
.contact-form input[type="text"]:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.cf-row { display: flex; gap: 10px; }
.cf-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-note { margin: 4px 0 0; font-size: 12px; color: #6b7280; }
.cf-agree { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; }
.cf-agree input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.cf-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: #6b7280; }
.cf-sub a { color: #1d4ed8; }
.cf-status { min-height: 18px; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: #374151; }
.cf-status.ok { color: #15803d; }
.cf-status.error { color: #b91c1c; }
.cf-status a { color: #1d4ed8; }
.cf-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.cf-actions .rp-btn { flex: 0 0 auto; padding: 9px 18px; }
.cf-actions .rp-btn:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 520px) { .cf-row { flex-direction: column; } }

/* 팝업 제목줄 = 드래그 손잡이 */
.info-modal-head { cursor: move; user-select: none; -webkit-user-select: none; touch-action: none; }
.info-modal-head .info-modal-close { cursor: pointer; }
.guide-more {
    display: block;
    margin: 10px 0 0;
    padding: 11px 14px;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.guide-more:hover { background: #1d4ed8; }

/* ===== 실거래(국토교통부) ===== */
.menu-trigger.deal-trigger { color: #9d174d; }
.deal-panel {
    display: none;
    position: absolute;
    top: 64px;
    left: 14px;
    z-index: 1100;
    width: 258px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
    padding: 12px 14px 12px;
    font-size: 13px;
    color: #374151;
    box-sizing: border-box;
}
.deal-panel.open { display: block; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14.5px; }
.dp-x { width: 26px; height: 26px; border: none; border-radius: 50%; background: #f3f4f6; color: #6b7280; font-weight: 700; cursor: pointer; }
.dp-x:hover { background: #fee2e2; color: #dc2626; }
.dp-region { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dp-region-name { font-weight: 800; color: #111827; }
.dp-lab { font-size: 12px; font-weight: 700; color: #6b7280; min-width: 28px; }
.dp-lab-block { display: block; margin: 10px 0 4px; }
.dp-load { width: 100%; margin-bottom: 10px; }
.dp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.dp-row select { flex: 1; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 13px; background: #fff; }
.dp-kind { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; cursor: pointer; }
.dp-types { display: flex; flex-direction: column; gap: 1px; }
.dp-type { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 7px; font-weight: 600; cursor: pointer; }
.dp-type:hover { background: #f3f4f6; }
.dp-type input { width: 15px; height: 15px; margin: 0; }
.dp-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dp-note { font-size: 10.5px; font-weight: 600; color: #9ca3af; border: 1px solid #e5e7eb; border-radius: 5px; padding: 0 4px; }
.dp-cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #6b7280; }
.dp-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dp-status { margin-top: 10px; min-height: 18px; font-size: 12.5px; font-weight: 600; line-height: 1.5; color: #374151; }
.dp-status.ok { color: #15803d; }
.dp-status.error { color: #b91c1c; }
.dp-hint { font-weight: 500; color: #6b7280; }
.dp-src { margin-top: 8px; font-size: 10.5px; color: #9ca3af; }

/* 지도 위 실거래 가격 표시 */
.deal-pin {
    --dc: #2563eb;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 2px;
    background: #fff;
    border: 1.5px solid var(--dc);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    font-size: 11.5px;
    color: #111827;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.5;
}
.deal-pin::after { /* 아래 꼬리 */
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dc);
    border-bottom: 0;
}
.deal-pin:hover { z-index: 10; transform: scale(1.06); }
.deal-pin .dp-t { padding: 0 6px; border-radius: 999px; background: var(--dc); color: #fff; font-size: 10.5px; font-weight: 700; }
.deal-pin b { font-weight: 800; }
.deal-pin .dp-d { color: #6b7280; font-size: 10.5px; }
.deal-pin .dp-n { position: absolute; top: -8px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #111827; color: #fff; font-size: 10px; font-weight: 700; text-align: center; line-height: 17px; }
.deal-pin.rent { background: #fdf4ff; }
.deal-pin.approx { border-style: dashed; opacity: 0.88; }
/* 거래를 눌러 지번 테두리를 볼 때: 나머지 핀은 흐리게 */
.deal-selecting .deal-pin:not(.sel) { opacity: 0.3; }
.deal-selecting .deal-pin:not(.sel):hover { opacity: 1; }
.deal-pin.sel { box-shadow: 0 0 0 2px #e11d48, 0 2px 6px rgba(0,0,0,.25); }

/* 실거래 상세 */
.deal-detail {
    display: none;
    position: absolute;
    top: 64px;
    right: 14px;
    z-index: 1150;
    width: 340px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 80px);
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.18);
    box-sizing: border-box;
    overflow: hidden;
}
.deal-detail.open { display: flex; }
.dd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid #f0f1f3; }
.dd-title { font-size: 14px; font-weight: 800; color: #111827; }
.dd-chip { display: inline-block; padding: 0 7px; border-radius: 999px; color: #fff; font-size: 12px; }
.dd-addr { margin-top: 3px; font-size: 12px; color: #6b7280; }
.dd-list { overflow-y: auto; padding: 4px 8px 8px; }
.dd-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px; border-bottom: 1px solid #f3f4f6; font-size: 12.5px; }
.dd-row:last-child { border-bottom: none; }
.dd-date { flex: 0 0 74px; color: #6b7280; font-weight: 600; }
.dd-main { flex: 1; min-width: 0; color: #111827; }
.dd-info { margin-top: 2px; font-size: 11.5px; color: #6b7280; }
.dd-add { flex: 0 0 auto; padding: 4px 8px; border: 1px solid #c7d2fe; border-radius: 6px; background: #eef2ff; color: #3730a3; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.dd-add:disabled { opacity: 0.55; cursor: default; }
.dd-more { padding: 8px; text-align: center; font-size: 11.5px; color: #9ca3af; }
@media (max-width: 600px) {
    .deal-panel { width: calc(100vw - 28px); max-height: 55vh; }
    .deal-detail { top: auto; bottom: 14px; right: 14px; max-height: 45vh; }
}
.dp-sub { font-size: 11px; font-weight: 700; color: #9d174d; background: #fce7f3; border-radius: 6px; padding: 1px 6px; margin-left: 2px; }
/* 넓게 볼 때 동(洞)별 묶음 */
.deal-cluster {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    min-width: 64px; padding: 5px 9px 6px;
    background: rgba(17, 24, 39, 0.88); color: #fff;
    border: 2px solid #fff; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    font-size: 11.5px; line-height: 1.25; cursor: pointer; white-space: nowrap;
}
.deal-cluster:hover { background: rgba(17, 24, 39, 0.97); transform: scale(1.06); }
.deal-cluster b { font-size: 12px; }
.deal-cluster span { font-weight: 800; color: #fde68a; }
.dc-bar { display: flex; width: 100%; height: 4px; margin-top: 3px; border-radius: 2px; overflow: hidden; }
.dc-bar i { display: block; height: 100%; }
.dp-err { margin-top: 6px; color: #b45309; font-weight: 600; }
/* 버전 표시 */
.brand-ver { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #f3f4f6; color: #6b7280; font-size: 10.5px; font-weight: 700; letter-spacing: 0; }
.menu-ver { padding: 6px 10px 4px; font-size: 11.5px; line-height: 1.5; color: #9ca3af; white-space: nowrap; }

/* ===== 메뉴: 이모지 없이 글자만으로 깔끔하게 (2026-10-29) ===== */
.menubar { gap: 2px; padding-left: 6px; }
.menu-trigger {
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.01em;
    border-radius: 8px;
}
.menu-trigger:hover { background: #f3f4f6; color: #111827; }
.menu.open .menu-trigger { background: #eef2ff; border-color: transparent; color: #3730a3; }
.menu-trigger .caret { margin-left: 2px; font-size: 9px; opacity: 0.45; }
.menu-trigger.deal-trigger { color: #374151; }
.menu-trigger.deal-trigger:hover { color: #111827; }
.menu-panel { min-width: 200px; padding: 6px; border-radius: 12px; }
.menu-item {
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #1f2937;
    border-radius: 8px;
}
.menu-item:hover { background: #f3f4f6; }
.menu-item.primary { color: #1d4ed8; font-weight: 600; }
.menu-item.danger { color: #b91c1c; }
.menu-sub { font-size: 11.5px; font-weight: 400; color: #9ca3af; }
.menu-check { padding: 9px 14px; font-size: 13.5px; font-weight: 500; color: #1f2937; border-radius: 8px; }
.menu-sep { margin: 5px 8px; }
.menu-ver { padding: 6px 14px 4px; }

/* ===== 풀다운 메뉴 항목 간격 촘촘하게 ===== */
.menu.open .menu-panel { gap: 0; }
.menu-panel { padding: 4px; }
.menu-item { padding: 6px 11px; font-size: 13px; }
.menu-check { padding: 6px 11px; font-size: 13px; }
.menu-sep { margin: 3px 6px; }
.menu-ver { padding: 4px 11px 3px; }

/* ===== 메뉴 앞 단색 아이콘(인라인 SVG, 글자색을 따라감) ===== */
.mi {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.menu-trigger .mi { width: 15px; height: 15px; opacity: 0.8; }
.menu-item .mi { opacity: 0.75; }
.menu-item.primary .mi, .menu-item.danger .mi { opacity: 1; }
.brand-ic { display: inline-flex; align-items: center; }
.brand-ic .mi { width: 18px; height: 18px; }
.rp-title { display: flex; align-items: center; gap: 6px; }
h2 > .mi, .guide-more .mi { display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* ===== 지도 왼쪽 세로 도구바: 로드뷰 / 그리기 도구 / 텍스트 ===== */
.left-tools {
    position: absolute;
    left: 10px;
    top: 64px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 46px;
    max-height: calc(100% - 140px);
    overflow-y: auto;
    scrollbar-width: none;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.left-tools::-webkit-scrollbar { display: none; }
.lt-slot { display: flex; flex-direction: column; align-items: stretch; }
.lt-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    padding: 7px 0 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    color: #374151;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}
.lt-btn:hover { background: #f3f4f6; }
.lt-btn .mi { width: 18px; height: 18px; opacity: 0.85; }
.lt-btn .lt-tx { display: block; white-space: nowrap; }
.lt-btn .tt-ic { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 17px; line-height: 1; }
.lt-btn.active, .lt-btn.active-loc { color: #fff; background: #374151; }
.lt-btn:last-child { border-bottom: none; }
/* 카카오 그리기 툴박스를 세로로: 원래 가로(float:left, 고정 폭)라 inline 스타일을 !important 로 덮어씀 */
.kk-toolbox {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
}
.kk-toolbox > a {
    float: none !important;
    display: flex !important;
    justify-content: center;
    border-right: none !important;
    border-bottom: 1px solid #e5e7eb !important;
}
.kk-toolbox > a > span { margin-left: 0 !important; margin-right: 0 !important; } /* 아이콘 가운데 정렬(위아래 여백은 카카오 기본값 유지) */
.kk-toolbox > a:first-child { border-top: 1px solid #e5e7eb !important; }
/* 왼쪽 도구바 오른쪽으로 비켜 서야 하는 다른 패널들 */
.deal-panel { left: 66px; }
#ownerLegend { left: 66px; }
@media (max-width: 600px) {
    .deal-panel { left: 62px; width: calc(100vw - 76px); }
}

/* ===== 로드뷰 ===== */
.menu-item.active-loc { background: #e0e7ff; color: #3730a3; }
.text-tool-btn.active-loc { color: #fff; background: #374151; border-color: #374151; } /* 로드뷰 버튼이 켜진 상태 */
.rv-panel {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: clamp(320px, 46vw, 720px);
    height: clamp(240px, 46vh, 520px);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.rv-panel.rv-big { top: 64px; width: calc(100% - 24px); height: auto; }
.rv-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    background: #1f2937;
    color: #f9fafb;
    font-size: 12px;
}
.rv-title { flex-shrink: 0; font-weight: 700; }
.rv-addr { flex: 1; min-width: 0; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    cursor: pointer;
}
.rv-btn:hover { background: #4b5563; }
.rv-body { flex: 1; min-height: 0; }
/* 지도 위 로드뷰 위치 점 + 시야 방향 부채꼴 */
.rv-pin { position: relative; width: 56px; height: 56px; pointer-events: none; }
.rv-pin .rv-dir {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from -32deg at 50% 50%, rgba(37, 99, 235, 0.6) 0deg, rgba(37, 99, 235, 0.08) 64deg, transparent 64deg);
}
.rv-pin .rv-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -9px 0 0 -9px;
    background: #2563eb;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    box-sizing: content-box;
}
@media (max-width: 700px) {
    .rv-panel { width: calc(100% - 16px); right: 8px; bottom: 8px; height: clamp(220px, 42vh, 420px); }
}

/* ===== 상단바 자동 맞춤: 화면이 좁아지면 ui.js 가 #topbar 에 tb-1 … tb-5 를 차례로 붙여 한 줄에 들어오게 함 ===== */
/* 주소 입력창은 남는 폭에 맞춰 늘고 줄어듦(먼저 줄어드는 부분) */
/* 그룹이 버튼 폭보다 작아지면 버튼이 옆 그룹(지도/스카이뷰) 위로 겹치므로, 최소 폭은 내용(입력창 최소폭+버튼들) 이하로 못 줄이게 함 */
.addr-search { flex: 0 1 auto; min-width: min-content; }
/* 주소 입력창 기본 폭 500px(기존 250px의 2배). 상단바가 좁으면 이 입력창이 먼저 줄어듦(최소 84px) */
.addr-search .addr-input { flex: 1 1 500px; width: 500px; min-width: 84px; }
.addr-search .map-btn { flex-shrink: 0; }
#topbar { scrollbar-width: none; }
#topbar::-webkit-scrollbar { display: none; }

/* 1단계: 버전·▾ 숨기고 메뉴 간격 줄임 */
#topbar.tb-1 { gap: 8px; }
#topbar.tb-1 .brand-ver, #topbar.tb-1 .menu-trigger .caret { display: none; }
#topbar.tb-1 .menubar { gap: 0; padding-left: 0; }
#topbar.tb-1 .menu-trigger { padding: 8px 7px; gap: 3px; }
/* 2단계: 로고 글자 · 내 위치 · 텍스트 버튼 글자 숨김(아이콘만) */
#topbar.tb-2 .brand-name,
#topbar.tb-2 #myLocBtn .tx,
#topbar.tb-2 #naverLandBtn .tx,
#topbar.tb-2 .text-tool-btn .tx { display: none; }
#topbar.tb-2 .brand { padding-right: 0; border-right: none; }
/* 3단계: 메뉴 글자 숨김(아이콘만, 마우스를 올리면 이름 표시) */
#topbar.tb-3 .menu-trigger .tx { display: none; }
#topbar.tb-3 .menu-trigger { padding: 8px 8px; }
/* 4단계: 그리기 도구·지도 종류 버튼 축소 */
#topbar.tb-4 .toolbox-slot > :not(.text-tool-btn) { zoom: 0.8; }
#topbar.tb-4 .map-btn.seg { padding: 7px 9px; font-size: 12px; }
/* 5단계: 여백 최소화 */
#topbar.tb-5 { gap: 4px; padding: 0 6px; }
#topbar.tb-5 .addr-search { gap: 3px; }
#topbar.tb-5 .addr-search .addr-input { min-width: 60px; }
#topbar.tb-5 .addr-search .map-btn { padding-left: 8px; padding-right: 8px; }
#topbar.tb-5 .menu-trigger { padding: 8px 6px; }
