﻿/* Android WebView textZoom(시스템 글꼴 크기 설정)이 시각적 렌더링만 키워 DOM 측정과 불일치하는
   문제를 차단. 탭 텍스트 2줄 표시 방지. */
html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

/* 전체 텍스트 선택·복사 방지(무단 복제 방지). 입력 필드는 정상 입력 위해 허용 */
body {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Base Variables */
:root {
    --fscale: 1;
    /* Colors */
    --primary: #4F46E5;
    /* Indigo */
    --primary-light: #818CF8;
    --bg-color: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;

    /* Status Colors */
    --status-green: #10B981;
    --status-green-bg: #D1FAE5;
    --status-yellow: #F59E0B;
    --status-yellow-bg: #FEF3C7;
    --status-red: #EF4444;
    --status-red-bg: #FEE2E2;

    /* Metrics */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    /* Prevent body scroll, handle inside views */
    -webkit-font-smoothing: antialiased;
}

/* ⚠ **당겨서 새로고침·고무줄 튕김을 뿌리에서 끈다**(2026-08-16 실측).
   위의 `overflow: hidden` 으로는 못 막는다 — 안드로이드 크롬·삼성 인터넷의
   당겨서 새로고침은 문서가 스크롤되든 말든 "맨 위에서 아래로 끌기"만으로 뜬다.
   지도에서 손가락을 아래로 끌 때 지도가 아니라 화면 전체가 한 몸으로
   들썩이던 증상이 이것이다. 지도·바텀시트 어디서든 제스처를 뺏기지 않게 한다. */
html,
body {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

/* App Container */
#app {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* ⚠ **삼성 인터넷은 주소창이 떠 있는데도 100dvh 를 '주소창 숨긴 큰 화면'으로 줄 때가 있다.**
       그러면 상자가 실제보다 길어져 바텀메뉴가 화면 밖으로 밀리고 지도 중심도 아래로 내려간다.
       매번은 아니라 "가끔 그런다"로 나타난다(2026-08-18 사용자 실측).
       그래서 지도 화면에서는 JS 가 window.innerHeight 로 실측해 --app-h 에 넣고, 있으면 그게
       이긴다. 다른 페이지는 이 값이 없어 예전(100dvh) 그대로 돈다. */
    height: var(--app-h, 100dvh);
    position: relative;
    overflow: hidden;
}

/* Views Management */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 10;
    background-color: var(--bg-color);
    overflow-y: auto;
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

/* ------------------ 
   1. Intro View 
------------------ */
#intro-view {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    position: relative;
    overscroll-behavior-y: contain;
}

.intro-header {
    margin-top: 20px;
    margin-bottom: 16px;
}

.intro-header h1 {
    font-size: calc(var(--fscale) * 32px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    cursor: pointer;
    user-select: none;
}

#ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: calc(var(--fscale) * 18px);
    transition: height 0.2s ease;
    margin: -24px -24px 0;
}

#ptr-indicator i {
    transition: transform 0.2s ease, color 0.2s ease;
}

#ptr-indicator.ptr-ready i {
    transform: rotate(180deg);
    color: var(--primary);
}

.intro-header h1 span {
    color: var(--primary);
}

.intro-header p {
    color: var(--text-muted);
    font-size: calc(var(--fscale) * 16px);
}

.region-cards h2 {
    font-size: calc(var(--fscale) * 18px);
    font-weight: 700;
    margin-bottom: 12px;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* city-step: step-hidden일 때는 숨김 유지, 보일 때만 flex */
#city-step:not(.step-hidden) {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 120px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card:active {
    transform: translateY(0);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.card:hover .card-bg {
    transform: scale(1.05);
}

/* 권역카드·지역카드·장면전환 배경은 Supabase Storage에서 관리 (index.js STORAGE_BASE 참조) */

/* Level 1: 권역 그룹 카드 */
.group-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: repeat(6, 1fr);
    gap: 3px;
    height: calc(100dvh - 170px);
    overflow: hidden;
    border-radius: 12px;
}

.group-card {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    cursor: default;
    background: var(--surface);
    border: none;
    display: flex;
    align-items: center;
}

.group-card.available {
    cursor: pointer;
    border: none;
    box-shadow: none;
    transition: var(--transition);
}

.group-card.available:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.group-card.available:active {
    transform: translateY(0);
}

.group-card-content {
    position: relative;
    z-index: 1;
    padding: 8px 10px;
    width: 100%;
}

/* 활성 권역 카드: 콘텐츠를 카드 하단에 고정 높이로 절대 위치 (block 레이아웃)
   → h3(권역명)가 p(지역명) 줄 수에 상관없이 모든 카드에서 동일한 높이에 표시됨 */
.group-card .group-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 90px; /* 권역명 위치(준비중 카드 포함 동일). 살짝 내림: 94→90 */
    padding: 8px 10px;
    overflow: hidden;
}

.group-card.available .group-card-content h3 {
    color: #fff;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-card.available .group-card-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: calc(var(--fscale) * 10px);
    word-break: keep-all;
    overflow: hidden;
}

.group-card:not(.available) .group-card-content h3 {
    color: #fff;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coming-badge {
    display: inline-block;
    font-size: calc(var(--fscale) * 10px);
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Level 2: 도시 선택 헤더 */
.city-step-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.city-step-header h2 {
    font-size: calc(var(--fscale) * 18px);
    font-weight: 700;
}

#btn-back-group {
    background: none;
    border: none;
    font-size: calc(var(--fscale) * 18px);
    color: var(--text-main);
    cursor: pointer;
    padding: 4px 10px 4px 0;
}

/* 도시 카드 (disabled) */
.region-card.disabled-card {
    cursor: default;
    box-shadow: none;
    border: 1px solid var(--border);
}

.region-card.disabled-card:hover {
    transform: none;
    box-shadow: none;
}

.disabled-card .card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.disabled-card .card-content h3 {
    color: var(--text-muted);
    font-weight: 600;
}

.disabled-card:has(.card-bg) .card-content h3 {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.step-hidden {
    display: none;
}

.card-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: calc(var(--fscale) * 11px);
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.card-content h3 i {
    margin-right: 6px;
    font-size: calc(var(--fscale) * 18px);
    vertical-align: middle;
    opacity: 0.9;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 16px;
    width: 100%;
    color: white;
}

.card-content h3 {
    font-size: calc(var(--fscale) * 20px);
    font-weight: 700;
    margin-bottom: 4px;
}

.card-content p {
    font-size: calc(var(--fscale) * 13px);
    opacity: 0.9;
}

/* ------------------ 
   2. Transition View 
------------------ */
#transition-view {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-main);
    color: white;
    text-align: center;
}

.transition-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    filter: blur(4px);
}

.transition-content {
    position: relative;
    z-index: 2;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.transition-content h2 {
    font-size: calc(var(--fscale) * 24px);
    font-weight: 600;
    line-height: 1.4;
}

/* ------------------ 
   3. Map View 
------------------ */
#map-view {
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
    /* ⚠ **브라우저에게 이 안의 손가락 제스처를 넘기지 않는다.**
       안 적으면 브라우저가 touchmove 를 '페이지 스크롤'로 가져가고 카카오에는
       touchcancel 만 남아 **지도가 손가락으로 안 움직인다.** 탭·더블탭은 이동이 없어
       그대로 되기 때문에, "눌리는 건 다 되는데 지도만 안 움직인다"로 나타난다
       (2026-08-18 삼성 태블릿 브라우저 실측. 앱은 주소창이 없어 스크롤이 안 생겨 정상이었다).
       Leaflet·Mapbox 등 지도 라이브러리가 컨테이너에 공통으로 두는 처방이다.
       확대·축소는 카카오가 JS 로 하므로 그대로 된다. */
    touch-action: none;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.top-bar h2 {
    font-size: calc(var(--fscale) * 16px);
    font-weight: 600;
}

.top-bar-btns {
    display: flex;
    gap: 8px;
}

.top-bar button {
    background: none;
    border: none;
    font-size: calc(var(--fscale) * 20px);
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.top-bar button:active {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ------------------ 
   Side Menu 
------------------ */
.side-menu {
    position: absolute;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--surface);
    z-index: 2100;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-menu.show {
    right: 0;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 2050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.menu-header {
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

.menu-header h3 {
    font-size: calc(var(--fscale) * 18px);
    font-weight: 700;
}

#close-menu-btn {
    background: none;
    border: none;
    font-size: calc(var(--fscale) * 20px);
    color: var(--text-muted);
    cursor: pointer;
}

.menu-list {
    list-style: none;
    padding: 12px 0;
}

.menu-list li {
    padding: 16px 20px;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-list li i {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
}

.menu-list li:hover {
    background-color: var(--bg-color);
}

.menu-list li:active {
    background-color: var(--border);
}

.menu-divider {
    height: 1px;
    background-color: #ccc;
    margin: 4px 16px;
    padding: 0 !important;
    pointer-events: none;
    cursor: default;
}
.menu-divider:hover, .menu-divider:active {
    background-color: #ccc !important;
}

/* ── 검색창 ── */
/* ── 시장흐름 현황판 (전광판 티커) ── */
/* top-bar 와 검색창 사이. position:absolute + left/right (transform 미사용 → 삼성 hit-test
   무관, 게다가 비인터랙티브). 세로 위치는 positionOverlays 가 top-bar 실측 기반으로 설정.
   트랙만 transform 애니메이션(비터치라 안전). 데이터 로드되면 JS 가 display:flex. */
#status-board {
    position: absolute;
    top: 60px;               /* fallback — JS 가 헤더 바로 아래로 덮어씀 */
    left: 0;
    right: 0;                 /* 화면 좌우 꽉 채움(페이드 없음) */
    height: calc(var(--fscale) * 30px);   /* 폰트와 같은 --fscale로 스케일 → 어떤 기종서도 비율고정·안 잘림 */
    z-index: 1999;           /* 검색창(2001) 아래, top-bar(1000) 위 */
    display: none;           /* 데이터 로드되면 JS 가 flex */
    align-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid #000;      /* 상단·하단만 검정 선 */
    border-bottom: 1px solid #000;
    cursor: pointer;                 /* 클릭 → 거시경제 페이지 */
}
#status-board-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
    animation: status-scroll linear infinite;
    font-size: calc(var(--fscale) * 12px);
    font-weight: 500;
    color: #2a2a3a;
    line-height: calc(var(--fscale) * 30px);   /* 보드 높이와 동일 스케일 → 세로 중앙·클리핑 없음 */
    padding-left: 100%;      /* 오른쪽 화면 밖에서 시작 → 첫 문구(날짜)부터 진입 */
    pointer-events: none;    /* 클릭은 보드로 전달(움직이는 트랙 hit-test 회피) */
}
@keyframes status-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }   /* 화면폭+문구폭 전체를 가로질러 나감 */
}

#search-wrap {
    position: absolute;
    top: 64px; /* fallback — JS가 top-bar 실측값으로 덮어씀 */
    left: 12px;
    right: 12px;
    z-index: 2001; /* 상세패널(2000)보다 위 — 드롭다운이 패널에 가리지 않게 */
}

#search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 14px;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.search-icon {
    color: var(--text-muted);
    font-size: calc(var(--fscale) * 14px);
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: calc(var(--fscale) * 14px);
    font-family: inherit;
    background: transparent;
    color: var(--text-main);
    min-width: 0;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-clear {
    display: none;
    background: none;
    border: none;
    color: #c2c6cc;   /* 단지 필요예산 검색창 X와 동일(원형 xmark) */
    cursor: pointer;
    padding: 0 2px;
    font-size: calc(var(--fscale) * 17px);
    line-height: 1;
    flex-shrink: 0;
}
#search-clear:active { color: #8a9099; }

#search-dropdown {
    list-style: none;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-top: 5px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    -webkit-overflow-scrolling: touch;
}

#search-dropdown.open {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:active {
    background: var(--bg-color);
}

.search-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-dot.green  { background: var(--status-green); }
.search-dot.yellow { background: var(--status-yellow); }
.search-dot.blue   { background: #6366F1; }
.search-dot.orange { background: #F97316; }
.search-dot.gray   { background: #9ca3af; }

.search-item-info { flex: 1; min-width: 0; }

.search-item-name {
    font-size: calc(var(--fscale) * 14px);
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-sub {
    font-size: calc(var(--fscale) * 11px);
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-result {
    padding: 16px;
    text-align: center;
    font-size: calc(var(--fscale) * 13px);
    color: var(--text-muted);
}

.search-divider {
    padding: 6px 14px 4px;
    font-size: calc(var(--fscale) * 11px);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-color);
    letter-spacing: 0.04em;
    border-top: 1px solid var(--border);
}

.search-item-cross {
    background: #fafafa;
}

.search-region-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: calc(var(--fscale) * 12px);
    font-weight: 600;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.search-region-btn:active {
    background: var(--primary);
    color: #fff;
}

/* 지역 이동 모달 */
/* ── 위치 권한 안내 모달 ───────────────────────────────────────── */
#loc-perm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9100;
    display: none;
    align-items: center;
    justify-content: center;
}
#loc-perm-modal.open { display: flex; }
#loc-perm-modal .lpm-box {
    background: #1f2937;
    border-radius: 18px;
    padding: 28px 24px 20px;
    margin: 20px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}
#loc-perm-modal .lpm-title {
    color: #f3f4f6;
    font-size: calc(var(--fscale) * 16px);
    font-weight: 700;
    margin-bottom: 10px;
}
#loc-perm-modal .lpm-desc {
    color: #9ca3af;
    font-size: calc(var(--fscale) * 14px);
    line-height: 1.65;
    margin-bottom: 22px;
    white-space: pre-line;
}
#loc-perm-modal .lpm-btns {
    display: flex;
    gap: 12px;
}
#loc-perm-modal .lpm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 600;
    cursor: pointer;
}
#loc-perm-modal .lpm-btn-close { background: #374151; color: #d1d5db; width: 100%; }

#region-switch-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
}

#region-switch-modal.open {
    display: flex;
}

#region-switch-modal .rsm-box {
    background: #1f2937;
    border-radius: 18px;
    padding: 28px 24px 20px;
    margin: 20px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

#region-switch-modal .rsm-msg {
    color: #f3f4f6;
    font-size: calc(var(--fscale) * 15px);
    line-height: 1.6;
    margin-bottom: 22px;
}

#region-switch-modal .rsm-btns {
    display: flex;
    gap: 12px;
}

#region-switch-modal .rsm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 600;
    cursor: pointer;
}

#region-switch-modal .rsm-btn-yes   { background: var(--primary); color: #fff; }
#region-switch-modal .rsm-btn-close { background: #374151; color: #d1d5db; }

.legend {
    position: absolute;
    top: 128px; /* fallback — JS가 실측값으로 덮어씀 */
    right: 16px;
    /* ⚠ **PC 바텀메뉴(#budget-legend)보다 위여야 한다.**
       범례는 position+z-index 라 '쌓임 맥락'을 만든다 → 그 안의 전용면적 드롭다운
       (#mk-label-options)은 z-index 1100 이어도 **범례 상자 안에 갇힌다**.
       #budget-legend 가 같은 1000 인데 DOM 상 뒤라 이겨서, 드롭다운이 그 아래로
       깔려 안 보였다(2026-08-17 사용자 지적). 둘은 평소 겹치지 않으므로
       범례를 한 단계 올려도 다른 영향은 없다. */
    z-index: 1010;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: calc(var(--fscale) * 12px);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.15s;
}
/* 클릭으로 끈 항목: 글씨·동그라미 회색 + 해당 마커 숨김(필터) */
.legend-item.off { color: #9aa0a6; }
.legend-item.off .dot { background-color: #c4c4c4 !important; }

/* ── 마커 첫줄 항목 선택(범례 하단): 전용면적/세대수/준공년도 ── */
.legend-mk-divider { height: 1px; background: rgba(0, 0, 0, 0.08); margin: 2px 0; }
#mk-label-select { position: relative; }
#mk-label-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: calc(var(--fscale) * 12px);
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
#mk-label-current i { font-size:calc(var(--fscale) * 9px); color: #888; transition: transform 0.15s; }
#mk-label-current.open i { transform: rotate(180deg); }
#mk-label-options {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    padding: 4px;
    min-width: 88px;
    z-index: 1100;
}
#mk-label-options.hidden { display: none; }
.mk-label-opt {
    padding: 7px 10px;
    font-size: calc(var(--fscale) * 12px);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-main);
}
.mk-label-opt:hover { background: #f2f2f5; }
.mk-label-opt.active { background: #eef0ff; color: var(--primary); font-weight: 700; }

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 2px white;
}

/* ── 내 위치 버튼 ──────────────────────────────────────────── */
/* 즐겨찾기(#fav-open)는 내 위치 버튼과 «같은 모양»이다 — 규칙을 베끼지 않고
   여기에 같이 태운다. 한 곳만 고치면 둘 다 바뀐다(2026-08-23). */
#my-location-btn,
#fav-open {
    position: absolute;
    top: 128px; /* fallback — JS가 검색창 아래로 실측 배치 */
    left: 12px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    color: var(--text-main);
    font-size: calc(var(--fscale) * 16px);
    transition: background 0.15s, color 0.15s;
}
#my-location-btn:active { background: rgba(235, 235, 235, 0.97); }
#my-location-btn.active  { color: #16c60c; } /* 위치 추적 중 형광초록 */
#my-location-btn.loading i { animation: myloc-spin 0.8s linear infinite; }
@keyframes myloc-spin { to { transform: rotate(360deg); } }

/* ── 내 위치 마커 ──────────────────────────────────────────────── */
.my-loc-overlay {
    position: relative;
    width: 0;
    height: 0;
    pointer-events: none;
}
/* 위치 점 — 형광초록 */
.my-loc-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    background: #39ff14;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.8);
}

.dot-green {
    background-color: var(--status-green);
}

.dot-yellow {
    background-color: var(--status-yellow);
}

.dot-red {
    background-color: var(--status-red);
}

.dot-blue {
    background-color: #6366F1;
}

.dot-orange {
    background-color: #F97316;
}

.dot-gray {
    background-color: #9ca3af;
}

/* Custom Kakao Overlay Marker styles */
.custom-overlay-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;   /* .marker-viewers 배지 절대배치 기준 */
    /* 마커(말풍선+텍스트+꼬리) 확대 — 말꼬리 tip(하단중앙=좌표앵커) 기준.
       모바일 1.15배(기본), PC는 아래 @media에서 1.3배. */
    transform: scale(1.15);
    transform-origin: 50% 100%;
}
/* PC(지도 넓게 보임)는 마커 1.3배 */
@media (min-width: 1024px) {
    .custom-overlay-marker { transform: scale(1.3); }
}
/* 실시간 접속자수 배지 (지역별 1·2등 단지 마커 위, 검정 직사각형) */
.marker-viewers {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    white-space: nowrap;
    background: #111;
    color: #fff;
    font-size:calc(var(--fscale) * 10px);
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;            /* 직사각형 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 5;
}
/* 마커 클릭 시 핀이 scale(1.4)로 커지므로 배지도 그만큼 위로 올려 핀을 안 가리게 */
.custom-overlay-marker:has(.marker-active) .marker-viewers {
    margin-bottom: 13px;
}
/* 접속중 배지가 있는 단지는 마커가 겹칠 때 위로 떠서 다른 마커에 가리지 않게.
   (일반 마커 0 < 배지 단지 500 < 클릭된 마커 1000) — 배지 붙고 떼질 때 :has로 자동 적용/해제 */
.custom-overlay-marker:has(.marker-viewers) {
    z-index: 500;
}

/* 사각 말풍선 마커: 2줄 텍스트(가운데정렬) + 하단 정중앙 삼각 말꼬리(핀 tip) */
.marker-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 30px;
    padding: 2px 6px 3px;
    border-radius: 7px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1.5px solid white;
    color: #fff;
    background-color: var(--mk, #F97316);
    /* ⚠ 여기에 `transition: all` 을 두면 안 된다(2026-08-15).
       화면에 마커가 수천 개 붙는데(강남 중심 한 화면 5,389개 실측), `all` 은 스타일이
       다시 계산될 때마다 브라우저가 **모든 애니메이션 가능 속성**을 마커마다 훑게 만든다.
       실제로 바뀌는 건 선택 시 확대(transform: scale(1.25))뿐이라 그것만 지정한다. */
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 첫줄: 사용자가 고른 항목(전용면적/세대수/준공년도) — 회색 + 둘째줄보다 2px 작게 */
.mk-l1 {
    font-size:calc(var(--fscale) * 9px);
    font-weight: 600;
    color: #f0f0f0;
    line-height: 1.05;
    white-space: nowrap;
}
.mk-l1:empty { display: none; }
/* 둘째줄: 대표가격 */
.mk-l2 {
    font-size:calc(var(--fscale) * 11px);
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
}
.mk-l2:empty { display: none; }
/* 말꼬리: 하단 정중앙 삼각형 (말풍선 배경색과 동일) */
.marker-tail {
    width: 0;
    height: 0;
    margin-top: -1px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--mk, #F97316);
    filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.22));
}

/* 색상 범례(유지): 단지=주황 / 분양권=파랑 / 분양중=초록. 말풍선·말꼬리 공통 변수
   --mk = 말풍선/꼬리 색, --neon = 활성 시 테두리를 도는 네온색(분류색보다 진한 톤) */
.marker-green  { --mk: var(--status-green); --neon: #15803d; }
.marker-yellow { --mk: var(--status-yellow); --neon: #b45309; }
.marker-red    { --mk: var(--status-red);    --neon: #b91c1c; }
.marker-blue   { --mk: #6366F1; --neon: #3730a3; }
.marker-orange { --mk: #F97316; --neon: #c2410c; }
.marker-gray   { --mk: #9ca3af; --neon: #6b7280; }   /* 분양예정(청약카카오 미매칭) */

.marker-active {
    transform: scale(1.25);   /* 선택 시 확대(과하지 않게) */
    z-index: 1000 !important;
}

/* 활성 마커: 네온사인이 사각 테두리를 따라 빙글빙글 회전.
   conic-gradient의 시작각(--mk-angle)을 0→360 보간 → 밝은 호가 고정된 사각 테두리를 일주.
   gradient-border 마스크로 테두리 띠만 남기고 가운데는 비움(텍스트 안 가림). */
@property --mk-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.marker-pin::before {
    content: '';
    position: absolute;
    inset: -2.5px;
    border-radius: 9px;
    padding: 2.5px;
    background: conic-gradient(from var(--mk-angle),
        transparent 0deg,
        var(--neon, #c2410c) 38deg,
        var(--neon, #c2410c) 66deg,
        transparent 104deg,
        transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    filter: drop-shadow(0 0 3px var(--neon, #c2410c)) drop-shadow(0 0 5px var(--neon, #c2410c));
    opacity: 0;
    pointer-events: none;
}
.marker-pin.marker-active::before {
    opacity: 1;
    animation: mk-neon-run 1.25s linear infinite;
}
@keyframes mk-neon-run {
    to { --mk-angle: 360deg; }
}

/* 말풍선(위) + 말꼬리(아래) 세로 스택 컨테이너 */
.marker-pin-box {
    display: flex;
    flex-direction: column;        /* 말풍선 위 + 말꼬리 아래 */
    align-items: center;
    justify-content: center;
}

/* ------------------ 
   4. Bottom Sheet 
------------------ */
.bottom-sheet {
    /* ⚠ 2026-09-19 전면 교체 — «바텀시트가 올라오는 높이만큼 지도·바텀메뉴·알림판이
       안 눌리고, 시트가 올라와도 그 안 버튼(즐겨찾기·상세보기)이 안 눌린다»(일부 기종,
       화면 엔진 구글 크롬·모바일). 죽는 영역의 모양이 **바로 이 시트의 상자**다.
       이 시트는 position:fixed + transform(translateY) 로 늘 합성 레이어에 올라가 있었다.
       구 크로미움 WebView·일부 GPU 는 그런 층의 터치 판정 상자를 **transform 적용 전 자리**
       (=올라온 자리)로 잡는다 — 숨겨도(visibility) 그 자리가 터치를 먹고, 올라오면 판정이
       어긋나 버튼이 안 눌린다. 알림판·바텀메뉴가 같은 병이었고 fixed→absolute 로 고쳤다.
       그래서 여기도 같은 처방을 **전부** 한다:
         ① fixed → absolute (바텀메뉴와 같은 기준 — 지도 페이지는 문서가 화면을 안 넘는다)
         ② 쉬는 상태에서 transform 을 **아예 안 둔다** — 숨김은 display:none(층 자체가 없다)
         ③ 올라오는 움직임은 keyframes 로만(끝나면 transform 이 남지 않는다)
         ④ will-change·상시 transition 없음
       끌어내리기(스와이프) 동안만 JS 가 잠깐 transform 을 쓰고, 손을 떼면 지운다. */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: 0 24px 12px;
    z-index: 1001;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    touch-action: auto;
    box-sizing: border-box;
    display: none;
}

.bottom-sheet.show {
    display: block;
    animation: bsSlideUp 0.34s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
@keyframes bsSlideUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

/* 지도 하단 바텀메뉴 — 하단에서 살짝 떠 있는 반투명 블러 카드(iOS 스타일 미니멀) */
.budget-menu {
    left: 12px;
    right: 12px;
    /* 하단 여백을 좌우(12px)와 맞춰 화면 하단에 바짝. 안전영역(제스처바)은 20%만 반영해
       홈 인디케이터 기종에서도 아주 살짝만 띄우고 그 외엔 12px로 붙는다(전 기종 안 잘림). */
    bottom: calc(12px + env(safe-area-inset-bottom, 0px) * 0.2);
    display: flex;
    gap: 2px;
    padding: 7px 6px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 26px;
    border: 0.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 30px rgba(30, 30, 50, 0.12), 0 2px 8px rgba(30, 30, 50, 0.06);
    z-index: 990;
    /* ⚠ **fixed 가 아니라 absolute 다**(2026-08-18, 사용자 신고: 그 폰에서 바텀메뉴가 안 눌림).
       이 카드는 position:fixed + backdrop-filter 라 **합성 레이어**로 올라가는데, 삼성/구
       크로미움 WebView 는 그때 터치 hit-test 박스를 잘못 잡는다(Chromium 41395555·141840).
       알림판(#daily-txn-frame)이 정확히 같은 조합으로 화면 전체를 먹통으로 만들었고
       absolute 로 바꿔 고쳤다 — 여기도 같은 처방이다.
       ⚠ **기준 상자를 따로 두지 않는다.** 위치 지정 조상이 없으면 absolute 는 '초기 포함
         블록'(=뷰포트 사각형)을 기준으로 잡는데, 지도 페이지는 body{overflow:hidden} +
         #app{100dvh} 라 문서가 뷰포트를 넘지 않는다 → fixed 와 같은 자리에 그대로 선다.
         (body 에 height 를 주는 방식은 **HTML 에 의존**하게 돼서 버렸다. 앱 WebView 가
          map.html 을 캐시하면 '새 CSS + 옛 HTML' 이 되어 바텀메뉴가 엉뚱한 데로 간다.
          CSS 파일만 바뀌어도 혼자 성립해야 한다.)
       ⚠ 되돌리려면 `git checkout before-bottommenu-absolute -- style-*.css` (복구점 태그). */
    position: absolute;
}
.budget-menu-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 2px;
    border: none;
    background: none;
    box-shadow: none;
    border-radius: 16px;
    cursor: pointer;
    color: #3f444c;                       /* 기본: 진한 회색(검정 계열) — 아이콘·텍스트 통일 */
    font-family: inherit;
    line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease, transform .15s ease;
}
.budget-menu-btn svg {
    width: 23px;
    height: 23px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-width .18s ease, transform .18s ease;
}
.budget-menu-btn .bm-lbl {
    font-size: calc(var(--fscale) * 11px);
    font-weight: 500;
    letter-spacing: -0.2px;
    color: currentColor;
    white-space: nowrap;
}
/* 선택 상태(라운드바 열림): 포인트색 + 아이콘만 살짝 또렷·확대. 배경 변화 없음. */
.budget-menu-btn.active { color: var(--primary, #5e57c7); }
.budget-menu-btn.active svg { stroke-width: 2.1; transform: translateY(-1px) scale(1.05); }
.budget-menu-btn.active .bm-lbl { font-weight: 600; }
/* 탭 피드백: 조용한 축소만 */
.budget-menu-btn:active { transform: scale(0.93); }

/* ── 바텀메뉴 팝업(커뮤니티·지역별 비교분석) — 지도 안개 + 라운드 바가 아래서 둥둥 ── */
#bottom-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 989;                 /* 바텀메뉴(990)·팝업(991)보다 아래 → 지도만 안개 */
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
}
#bottom-popup-overlay.show { opacity: 1; visibility: visible; }
.bottom-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px) * 0.2);   /* 떠 있는 바텀메뉴 카드 위 */
    /* ⚠ **닫혔을 때는 display:none 이다 — 레이아웃에서 아예 뺀다.**
       예전엔 flex 로 두고 visibility:hidden + pointer-events:none 으로만 막았다. 그런데 이 상자는
       화면 **전폭 × 최대 70vh** 짜리 스크롤 상자(overflow-y:auto)라, 보이지 않아도 그 자리에
       그대로 깔려 있었다. 일부 삼성/구 WebView 는 **스크롤 상자를 pointer-events 와 무관하게
       터치 대상으로** 잡아, 지도 아래쪽 절반과 바텀메뉴가 통째로 안 먹었다.
       (사용자 관찰 2026-08-18: "라운드바 올라오는 높이만큼 옆에 스크롤바가 잠깐 생긴다" —
        그 스크롤 상자가 실재한다는 증거였다. 알림판을 켜면 그 부분만 살아나던 것도
        알림판(z-index 1050)이 이 상자보다 위라서였다.)
       display:none 이면 상자 자체가 없어 스크롤바도, 터치 가로채기도 없다.
       여는 애니메이션은 자식(.bp-btn)의 opacity·transform 이라 부모를 없애도 그대로다.
       메모리: project_samsung_transform_hittest · project_fixed_bottom_hittest */
    display: none;
    flex-direction: column;       /* 위→아래: 첫 버튼이 맨 위 */
    align-items: center;
    gap: 8px;                     /* 바 사이 간격(너무 크지 않게) */
    padding: 0 12px;
    z-index: 991;
    pointer-events: none;
    visibility: hidden;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;  /* 끝까지 스크롤해도 뒤(지도·문서)로 안 샌다 */
    scrollbar-width: none;         /* 스크롤바는 안 보이게 — 웹에서 잠깐 뜨던 그것 */
}
.bottom-popup::-webkit-scrollbar { width: 0; height: 0; }
.bottom-popup.show { display: flex; visibility: visible; }
.bp-btn {
    /* ⚠ **숨김일 때는 터치를 받지 않는다**(2026-08-16 삼성폰 실측).
       부모(.bottom-popup)는 visibility:hidden + pointer-events:none 으로 막아 뒀는데
       자식이 pointer-events:auto 로 **되살리고** 있었다. 게다가 backdrop-filter 로
       합성 레이어라, 일부 삼성/구 WebView 는 그 경로에서 부모의 pointer-events 를 무시하고
       **보이지도 않는 버튼이 터치를 먹는다**(메모리 project_samsung_transform_hittest).
       증상: 버튼이 가운데 정렬·세로로 쌓여 있어 **화면 가운데 아래 넓은 띠가 죽고**
             좌우 끝만 살아 있었다. 그 아래 바텀메뉴(z-index 990)도 팝업(991)에 가려 안 눌렸다.
             알림판(1050)이 켜지면 그 부분만 정상으로 돌아왔다.
       → 열렸을 때(.bottom-popup.show)만 auto 로 켠다. */
    pointer-events: none;
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;       /* 아이콘 위 + 텍스트 아래 (버튼 폭에 맞춤) */
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    border: none;
    border-radius: 18px;
    padding: 11px 6px;            /* 폭은 JS가 버튼 폭으로 설정 */
    box-shadow: 0 8px 22px rgba(30, 30, 50, 0.14);
    font-size: calc(var(--fscale) * 12px);
    font-weight: 700;
    color: #333;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .3s ease, transform .3s ease;
}
.bottom-popup.show .bp-btn { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* ── 지역비교 팝업만 3×4 그리드 ─────────────────────────────────────────────
   1열 거래량·미분양·공급량 / 2열 세대수·전세가율·소득대비집값
   3열 (빈)·종합비교·(빈)   / 4열 (빈)·가격변동률·(빈)
   바 크기는 그대로(JS가 버튼 폭을 지정) · 가로 간격은 세로 간격과 동일(8px). */
#analysis-popup {
    /* ⚠ display 는 **.show 에서만** 준다. 여기서 grid 로 두면 ID 우선순위가
       `.bottom-popup.show { display:flex }` 보다 높아 **닫혔을 때도 grid 로 깔린다**
       — 위에서 display:none 으로 뺀 의미가 이 팝업만 사라진다. */
    grid-template-columns: repeat(3, auto);
    gap: 8px;
    justify-content: center;
    align-items: stretch;
}
#analysis-popup.show { display: grid; }
#analysis-popup .bp-nation { grid-column: 2; }    /* 종합비교·가격변동률은 가운데 칸 */
.bp-btn i { font-size: calc(var(--fscale) * 18px); color: var(--primary, #4f6ef7); }
/* 첫 줄(○○ 아파트)은 한 줄 유지 — 폭 초과 시 JS가 폰트를 줄여 줄넘김 방지 */
.bp-l1 { display: inline-block; white-space: nowrap; }
/* 커뮤니티·투자지표·단지찾기 바: 텍스트 2줄이라 폰트·여백·아이콘 축소 */
#community-popup .bp-btn, #invest-popup .bp-btn, #budget-popup .bp-btn { padding: 7px 6px; gap: 2px; font-size: calc(var(--fscale) * 11px); }
#community-popup .bp-btn i, #invest-popup .bp-btn i, #budget-popup .bp-btn i { font-size: calc(var(--fscale) * 15px); }
/* 단지찾기·경제정책: 라운드바 높이 동일하게(필요예산 2줄도 수용) — 중앙정렬 */
#budget-popup .bp-btn, #econ-popup .bp-btn { min-height: calc(var(--fscale) * 60px); }
.bp-btn:active { background: #f0f0f0; }
/* 아래(맨 끝 바)부터 위로 순차 등장 */
.bottom-popup.show .bp-btn:nth-child(6) { transition-delay: 0s; }
.bottom-popup.show .bp-btn:nth-child(5) { transition-delay: .04s; }
.bottom-popup.show .bp-btn:nth-child(4) { transition-delay: .08s; }
.bottom-popup.show .bp-btn:nth-child(3) { transition-delay: .12s; }
.bottom-popup.show .bp-btn:nth-child(2) { transition-delay: .16s; }
.bottom-popup.show .bp-btn:nth-child(1) { transition-delay: .20s; }

/* 모바일(<1024): 토론·Q&A는 커뮤니티 팝업으로 이동 → 사이드 메뉴에선 숨김 */
.menu-list li.menu-community-only { display: none; }

.sheet-handle-wrap {
    width: 100%;
    padding: 12px 0;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background-color: #CBD5E1;
    border-radius: 10px;
}

.sheet-header {
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: calc(var(--fscale) * 12px);
    font-weight: 700;
    margin-bottom: 8px;
}

.badge-green {
    background-color: var(--status-green-bg);
    color: #065F46;
}

.badge-yellow {
    background-color: var(--status-yellow-bg);
    color: #92400E;
}

.badge-red {
    background-color: var(--status-red-bg);
    color: #991B1B;
}

.badge-blue {
    background-color: #EEF2FF;
    color: #4338CA;
}

.txn-sil-badge {
    display: inline-block;
    font-size: calc(var(--fscale) * 10px);
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background-color: #EEF2FF;
    color: #4338CA;
    margin-left: 4px;
    vertical-align: middle;
}

.txn-new-badge {
    display: inline-block;
    font-size: calc(var(--fscale) * 10px);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(34,197,94,0.14);
    color: #15803d;
    margin-left: 4px;
    vertical-align: middle;
}
.txn-direct-badge {
    display: inline-block;
    font-size: calc(var(--fscale) * 10px);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(148,163,184,0.18);
    color: #64748b;
    vertical-align: middle;
}

.txn-cancel-badge {
    display: inline-block;
    font-size: calc(var(--fscale) * 10px);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(239,68,68,0.14);
    color: #ef4444;
    vertical-align: middle;
    margin-left: 3px;
}

.sheet-header h3 {
    font-size: calc(var(--fscale) * 22px);
    font-weight: 700;
    margin-bottom: 4px;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: calc(var(--fscale) * 16px);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #4338CA;
}

.btn-sm {
    padding: 8px 12px;
    font-size: calc(var(--fscale) * 14px);
    border-radius: 8px;
    width: auto;
}

/* ------------------ 
   5. Detail Panel 
------------------ */
.detail-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 2000;
    transition: top 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

.detail-panel.show {
    top: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* 헤더 제목 — 모든 페이지가 이 한 규칙을 쓴다(2026-08-23 사장님: 상세패널 기준으로 통일).
   ⚠ 가운데 정렬은 «남는 자리를 다 차지하고 그 안에서» 한다. 헤더가 space-between 이라
     양옆 버튼 개수가 다르면 제목이 밀린다(즐겨찾기 별이 늘면서 드러났다).
   h4 도 같이 받는다 — 예산·평가순위 쪽이 h4 를 쓴다. */
.panel-header h3,
.panel-header h4 {
    margin: 0;
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: calc(var(--fscale) * 16px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    background: none;
    border: none;
    font-size: calc(var(--fscale) * 20px);
    color: var(--text-main);
    cursor: pointer;
    padding: 4px;
}

.panel-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

.detail-section {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.detail-section h4 {
    font-size: calc(var(--fscale) * 16px);
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: var(--primary);
}

/* Chart Mockup */
.chart-container {
    padding: 10px 0;
}

.chart-mockup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.bar {
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-weight: 600;
    font-size: calc(var(--fscale) * 14px);
}

.bar-price {
    background-color: var(--border);
    width: 70%;
    color: var(--text-main);
}

.bar-value {
    background-color: var(--status-green-bg);
    width: 90%;
    color: #065F46;
}

.chart-desc {
    font-size: calc(var(--fscale) * 14px);
    color: var(--text-muted);
    line-height: 1.5;
    background-color: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
}

/* AI Summary Grid */
.ai-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-color);
    border-radius: 12px;
}

.summary-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-text h5 {
    font-size: calc(var(--fscale) * 13px);
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.summary-text p {
    font-size: calc(var(--fscale) * 14px);
    font-weight: 500;
    line-height: 1.4;
}

/* News List */
.news-list {
    list-style: none;
}

.news-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
}

.news-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-tag {
    font-size: calc(var(--fscale) * 11px);
    font-weight: 600;
    color: var(--primary);
    background-color: rgba(79, 70, 229, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.news-title {
    font-size: calc(var(--fscale) * 14px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Comments */
.detail-section h4 .count {
    background-color: var(--primary);
    color: white;
    font-size: calc(var(--fscale) * 12px);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

.comment-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.comment-input-wrap input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: calc(var(--fscale) * 14px);
    outline: none;
    transition: var(--transition);
}

.comment-input-wrap input:focus {
    border-color: var(--primary);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background-color: #E2E8F0;
    color: #94A3B8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-info {
    font-size: calc(var(--fscale) * 13px);
    margin-bottom: 4px;
}

.comment-info .date {
    color: var(--text-muted);
    font-size: calc(var(--fscale) * 11px);
    margin-left: 6px;
}

.comment-text {
    font-size: calc(var(--fscale) * 14px);
    line-height: 1.5;
    background-color: var(--bg-color);
    padding: 10px 12px;
    border-radius: 0 12px 12px 12px;
    display: inline-block;
}

.menu-ad {
    margin-top: auto;
    padding: 12px 8px;
    border-top: 1px solid var(--border);
    position: relative;
}
.menu-ad-swipe-guard {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#app-version {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: calc(var(--fscale) * 10px);
    color: rgba(0, 0, 0, 0.25);
    letter-spacing: 0.5px;
    pointer-events: none;
    user-select: none;
}

/* Detail page (detail.html, request.html) */
.detail-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: var(--bg-color);
}

/* Map loading overlay (map.html) */
.map-loading {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-bg {
    position: absolute;
    inset: 0;
    background: #1E293B center/cover no-repeat;
}

/* ------------------
   Filter Panel
------------------ */
.filter-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    /* ⚠ 1400 이던 시절엔 **전광판(1999)·검색창(2001)이 안 어두워지고 눌리기까지** 했다
       (2026-08-24 사장님). 덮개가 그 둘보다 아래였기 때문이다.
       지금 이 위(2200)까지 덮되, 다른 모달들(지역이동 3200·가격입력 3300·즐겨찾기 3400)
       보다는 아래로 둔다 — 그 모달들이 필터 위에 떠야 한다. */
    z-index: 2300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filter-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.filter-panel {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 0 20px 32px;
    z-index: 2320;                 /* 제 덮개(2300) 바로 위 */
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    max-height: 80vh;
    overflow-y: auto;
}

.filter-panel.show {
    bottom: 0;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.filter-panel-header h3 {
    font-size: calc(var(--fscale) * 16px);
    font-weight: 700;
}

.filter-panel-header button {
    background: none;
    border: none;
    font-size: calc(var(--fscale) * 18px);
    cursor: pointer;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.filter-panel-header button:active {
    background: rgba(0, 0, 0, 0.06);
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section-title {
    font-size: calc(var(--fscale) * 11px);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: none;
    font-size: calc(var(--fscale) * 13px);
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}

.filter-chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.filter-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: calc(var(--fscale) * 14px);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px 14px;
}

.price-range-sep {
    color: var(--text-muted);
    font-weight: 400;
}

.range-slider-wrap {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.range-slider-track {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}

.range-slider-fill {
    position: absolute;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    pointer-events: none;
}

.range-slider-wrap input[type=range] {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
}

.range-slider-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    pointer-events: auto;
    border: 2.5px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.range-slider-wrap input[type=range]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    pointer-events: auto;
    border: 2.5px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.filter-active-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: none;
}

.filter-actions {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

.filter-actions .btn {
    flex: 1;
}

.btn-outline {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-main);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: calc(var(--fscale) * 15px);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:active {
    background: rgba(0, 0, 0, 0.04);
}

/* ── PC 우측 상세 패널 (기본: 숨김) ── */
.right-panel { display: none; }


/* ── 태블릿(768–1023px) — **폰 프레임을 없앴다**(2026-08-18 사용자 결정) ──────────
   예전엔 여기서 #app 을 max-width:480px · height:850px 로 묶고 검은 테두리를 둘러
   '휴대폰 모양'을 그렸다. 보기 좋으라고 넣은 목업이지 기능이 아니었는데, **좌표계를
   둘로 갈라** 실제 문제를 만들었다(사용자 실측, 삼성 태블릿):
     · 지도가 그 상자 안에만 그려지고 **밖은 터치가 죽는다**.
       #app 높이가 850px 로 고정이라 화면이 바뀌어도 #map 의 clientWidth/Height 가
       안 변하고, _syncMapSize 는 '변할 때만' relayout 을 불러 카카오가 **옛 크기를
       기억한 채** 남는다(메모리 project_map_relayout_deadzone 의 그 근본).
     · 가로모드에선 1024 를 넘어 PC 규칙으로 튀는데 지도는 옛 크기 그대로다.
     · 바텀메뉴는 #app 밖(body 직속)이라 프레임과 무관하게 **브라우저 창 바닥**에 서서,
       화면 속 폰 모양과 따로 논다.
   → 태블릿도 그냥 전체 화면을 쓴다. 좌표계가 하나가 되면 위 증상이 함께 사라진다.
   (embed 모드용 예외도 같이 없앴다 — 무효화할 프레임이 더는 없다. 다만 PC 좌측
    패널에서 기본정보 지도를 숨기는 규칙은 프레임과 무관하므로 남긴다.) */
html.embed-mode #bi-apt-map { display: none !important; }

/* PC 분할 레이아웃 기본값: 모바일에서 오른쪽 패널 숨김 */
.pc-body-right { display: none; }

/* ══════════════════════════════════════════════════════════════
   PC 레이아웃 (1024px+)
   - 홈(body.page-home): 일반 스크롤 랜딩 페이지
   - 지도·상세 페이지: 풀스크린 (폰 프레임 없음)
══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

    /* ── 공통: 폰 프레임 제거 ── */
    #app {
        max-width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        margin: 0;
    }

    /* ── 홈 페이지: 풀스크린 고정 레이아웃 ── */
    body.page-home {
        overflow: hidden;
        display: block;
        background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 100%);
        height: 100vh;
    }

    body.page-home #app {
        position: static;
        overflow: hidden;
        height: 100vh;
        width: 100%;
    }

    body.page-home #intro-view {
        position: static;
        opacity: 1;
        pointer-events: auto;
        height: auto;
        overflow: visible;
        padding: 0;
        background: none;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    /* 모바일 전용 요소 숨김 */
    #ptr-indicator                   { display: none !important; }
    body.page-home .intro-header     { display: none !important; }
    body.page-home #app-version      { display: none !important; }

    /* ── PC 상단 네비게이션 ── */
    .pc-nav {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 60px;
        height: 64px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 500;
        flex-shrink: 0;
    }

    .pc-nav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        user-select: none;
        font-size: calc(var(--fscale) * 18px);
        font-weight: 800;
        color: var(--text-main);
        letter-spacing: -0.3px;
    }

    .pc-nav-brand i  { color: var(--primary); font-size: calc(var(--fscale) * 20px); }
    .pc-nav-brand em { color: var(--primary); font-style: normal; }

    .pc-nav-right {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .pc-nav-version {
        font-size: calc(var(--fscale) * 11px);
        color: var(--text-muted);
        letter-spacing: 0.5px;
        background: var(--bg-color);
        padding: 3px 10px;
        border-radius: 20px;
    }

    /* ── PC 히어로 섹션 (오른쪽 패널 내부) ── */
    .pc-hero {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        padding: 60px;
        background: linear-gradient(135deg, #eef2ff 0%, #e8edff 55%, #f0f4ff 100%);
        border-bottom: none;
        position: relative;
        overflow: hidden;
    }

    .pc-hero::before {
        content: '';
        position: absolute;
        top: -80px; right: -80px;
        width: 380px; height: 380px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
        pointer-events: none;
    }

    .pc-hero-inner {
        max-width: none;
        margin: 0;
        position: relative;
        z-index: 1;
    }

    .pc-hero h1 {
        font-size: calc(var(--fscale) * 46px);
        font-weight: 800;
        line-height: 1.15;
        margin-bottom: 14px;
        letter-spacing: -1.5px;
        color: var(--text-main);
    }

    .pc-hero h1 em { color: var(--primary); font-style: normal; }

    .pc-hero p {
        font-size: calc(var(--fscale) * 18px);
        color: var(--text-muted);
        line-height: 1.6;
        max-width: 560px;
    }

    /* ── 좌우 분할 레이아웃 ── */
    body.page-home .pc-body-split {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        height: calc(100vh - 64px);
        overflow: hidden;
    }

    body.page-home .pc-body-left {
        flex: 0 0 50%;
        max-width: 50%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        min-height: 0;
        overflow: hidden;
    }

    body.page-home .pc-body-right {
        display: flex;
        flex: 0 0 50%;
        max-width: 50%;
        min-width: 0;
    }

    /* ── 콘텐츠 래퍼 ── */
    .pc-main-content {
        width: 546px;
        flex-shrink: 0;
        margin: 0;
        padding: 24px 0;
        position: relative; /* city-step 절대 위치 기준점 */
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .region-cards h2 {
        font-size: calc(var(--fscale) * 16px);
        font-weight: 700;
        margin-bottom: 10px;
        color: var(--text-main);
        flex-shrink: 0;
    }

    body.page-home #group-step {
        display: flex;
        flex-direction: column;
    }

    /* 권역 카드: 3열 (모바일 동일) */
    .group-cards-container {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
        height: auto;
        max-height: none;
        gap: 3px;
        padding-bottom: 0;
    }

    .group-card,
    .group-card.available { height: 137px; border-radius: 0; }

    .group-card .group-card-content {
        height: 106px; /* 권역명 위치(준비중 카드 포함 동일). 살짝 내림: 112→106 */
    }
    .group-card.available .group-card-content h3 { font-size: calc(var(--fscale) * 20px); white-space: nowrap; }
    .group-card:not(.available) .group-card-content h3 { font-size: calc(var(--fscale) * 20px); white-space: normal; }
    .group-card.available .group-card-content p { font-size: calc(var(--fscale) * 13px); word-break: keep-all; }

    /* 도시 카드: PC에서도 모바일과 동일하게 세로 스크롤 단일 컬럼 */
    .city-step-header { margin-bottom: 24px; }
    .city-step-header h2 { font-size: calc(var(--fscale) * 22px); }


    /* ── PC 푸터 ── */
    .pc-footer {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 18px 60px;
        background: rgba(255, 255, 255, 0.85);
        border-top: 1px solid var(--border);
        font-size: calc(var(--fscale) * 12px);
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .pc-footer-ver {
        font-weight: 700;
        color: var(--primary);
        letter-spacing: 0.5px;
    }

    .pc-footer-sep { color: var(--border); }

    /* ── 상세 페이지: 중앙 정렬 ── */
    .detail-page {
        max-width: 860px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
        min-height: 100vh;
    }

    /* ── 범례: 패널이 좌측이므로 기본 우측 배치 유지 ── */
    .legend {
        right: 16px;
        left: auto;
    }

    /* ── 바텀시트·예산 바텀메뉴: PC에서 비활성 ── */
    .bottom-sheet { display: none !important; }
    .budget-menu { display: none !important; }
    .bottom-popup { display: none !important; }   /* 바텀메뉴 팝업도 PC에선 비활성(바텀메뉴 없음) */
    #bottom-popup-overlay { display: none !important; }
    /* PC에선 토론·Q&A를 사이드 메뉴에 그대로 표시(모바일에서만 커뮤니티 팝업으로 이동) */
    .menu-list li.menu-community-only { display: flex !important; }

    /* ── 좌측 상세 패널 (top·height는 JS positionOverlays에서 설정) ── */
    .right-panel {
        display: block;
        position: absolute;
        top: 120px; /* JS 설정 전 fallback */
        left: 0;
        width: clamp(400px, 32vw, 580px);
        height: calc(100% - 120px);
        background: var(--surface);
        z-index: 2000;
        box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.14);
        border-right: 1px solid var(--border);
        border-radius: 0 0 12px 0;
        transform: translateX(-100%);
        transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }

    .right-panel.show { transform: translateX(0); }

    .right-panel-iframe {
        width: 100%;
        height: 100%;
        border: none;
        display: block;
    }
}

/* ── 모바일 인트로: 스크롤 차단 (PTR 복구) ── */
@media (max-width: 1023px) {
    #intro-view { overflow-y: hidden; }
}