/* 재경 목포중·고 동문회 동문 업체 지도 — DESIGN-GUIDE.md 기준 (2026 리디자인) */

@font-face {
  font-family: 'Cafe24ProSlim';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2511-1@1.0/Cafe24PROSlim-Light.woff2') format('woff2');
  font-weight: 300; font-display: swap;
}
@font-face {
  font-family: 'Cafe24ProSlim';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2511-1@1.0/Cafe24PROSlim-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Cafe24ProSlim';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2511-1@1.0/Cafe24PROSlim-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}

:root {
  /* Primary — 교색 녹색 (공식 코드 확인 시 이 줄만 교체) */
  --primary:        #3D8121;
  --primary-dark:   #2E6317;
  --primary-deep:   #1F4610;
  --primary-bg:     #EEF6E9;
  --primary-soft:   #F3F8F0;

  /* Accent — 쿠폰/혜택 전용 */
  --accent:         #E8590C;
  --accent-bg:      #FFF1E7;

  /* Neutral — 살짝 그린이 도는 웜 그레이 */
  --text:           #1B2420;
  --text-sub:       #66736B;
  --line:           #E6EAE6;
  --bg:             #FFFFFF;
  --bg-sub:         #F5F7F4;

  --danger:         #DC2626;

  /* 회차 상징색 (1회 빨강 → 2회 노랑 → 3회 초록, 3년 주기) */
  --class-red:      #C0392B;
  --class-yellow:   #E8A800;
  --class-green:    #3D8121;

  /* 그림자 스케일 */
  --shadow-sm:  0 1px 2px rgba(27, 36, 32, .06), 0 2px 8px rgba(27, 36, 32, .05);
  --shadow-md:  0 2px 6px rgba(27, 36, 32, .07), 0 10px 24px rgba(27, 36, 32, .09);
  --shadow-lg:  0 8px 16px rgba(27, 36, 32, .10), 0 24px 48px rgba(27, 36, 32, .16);

  --radius:     16px;
  --radius-lg:  20px;

  /* 타이포 위계 — Wanted Sans 가변폰트에서 4단계만 사용 */
  --w-display: 700;  /* 1단계: 로고·페이지 큰 제목 */
  --w-title:   700;  /* 2단계: 업체명·섹션 제목 */
  --w-strong:  700;  /* 3단계: 버튼·칩·배지·운영 문구 */
  --w-body:    400;  /* 4단계: 본문·보조 텍스트 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* display:grid/flex 클래스가 hidden 속성을 덮어쓰지 못하게 (로그인/관리 화면 동시 노출 버그 수정) */
[hidden] { display: none !important; }

html, body {
  font-family: "Cafe24ProSlim", "Wanted Sans Variable", -apple-system,
               "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg-sub);
  font-size: 16px;
  font-weight: var(--w-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

:focus-visible { outline: 3px solid rgba(61, 129, 33, .45); outline-offset: 2px; border-radius: 6px; }

/* ── 상단 헤더 — 반투명 화이트 스티키 ─────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; height: 60px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header h1 { font-size: 16.5px; font-weight: var(--w-display); letter-spacing: -.01em; }
.site-header h1 a {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); text-decoration: none;
}
.site-header h1 a::before {
  content: ''; flex: none; width: 26px; height: 26px; border-radius: 9px;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 4px, transparent 4.5px),
    linear-gradient(145deg, #4C9A2C, var(--primary-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(61, 129, 33, .35);
}
.site-header h1 small { font-weight: var(--w-strong); color: var(--text-sub); margin-left: 2px; }
.site-header nav { display: flex; gap: 6px; align-items: center; }
.site-header nav a, .site-header nav button {
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: var(--w-strong);
  padding: 9px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; font-family: inherit;
  transition: background .15s ease;
}
.site-header nav a:hover, .site-header nav button:hover { background: var(--primary-bg); color: var(--primary-dark); }

/* ── 필터 칩 ──────────────────────────────── */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 17px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 14.5px; font-weight: var(--w-strong); color: var(--text); cursor: pointer;
  font-family: inherit; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { transform: translateY(-1px); border-color: var(--chip-color, var(--primary)); }
.chip.active {
  background: var(--chip-color, var(--primary)); border-color: var(--chip-color, var(--primary));
  color: #fff; box-shadow: var(--shadow-md);
}

/* ── 지도 페이지 (body.map-page) ───────────── */
body.map-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.map-page .map-wrap { flex: 1; }

.map-wrap { position: relative; }
#map { width: 100%; height: 100%; min-height: 420px; background: #E4EAE2; }
#map .leaflet-tile-pane { filter: grayscale(.45) saturate(.7) brightness(1.04) contrast(.93); }

/* ── 네이버 지도 스타일: 지도 위 플로팅 검색바 + 칩 ── */
.map-overlay-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1010; /* Leaflet 판(≤1000) 위 */
  padding: 12px 12px 0; pointer-events: none;
}
.map-overlay-top .search-bar, .map-overlay-top .chip { pointer-events: auto; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  height: 52px; padding: 0 16px;
  background: var(--bg); border-radius: 14px;
  box-shadow: var(--shadow-md); border: 1px solid rgba(27, 36, 32, .04);
  color: var(--text-sub);
}
.search-bar:focus-within { box-shadow: var(--shadow-md), 0 0 0 3px rgba(61, 129, 33, .16); color: var(--primary); }
.search-bar input {
  flex: 1; min-height: 0; height: 100%; border: 0; padding: 0;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text);
  background: transparent;
}
.search-bar input:focus { outline: none; box-shadow: none; border: 0; }
.search-bar input::placeholder { color: #9AA79E; font-weight: 500; }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar button {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--bg-sub); color: var(--text-sub); cursor: pointer; font-size: 12px;
}
.search-divider { flex: none; width: 1px; height: 24px; background: var(--line); }
.search-bar .menu-btn { width: 36px; height: 36px; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.search-bar .menu-btn:hover { background: var(--bg-sub); }

/* 메뉴 팝오버 (검색 필의 ☰) */
.menu-pop {
  position: absolute; top: 58px; right: 0; z-index: 1012;
  min-width: 230px; padding: 8px; display: grid; gap: 2px;
  background: var(--bg); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.menu-brand {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--bg-sub);
  font-size: 13px; line-height: 1.35; color: var(--text-sub);
}
.menu-brand b { font-size: 15px; font-weight: var(--w-title); color: var(--text); }
.menu-logo {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 5px, transparent 5.5px),
    linear-gradient(145deg, #4C9A2C, var(--primary-dark));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 6px rgba(61,129,33,.35);
}
.menu-pop > a, .menu-pop > button {
  display: flex; align-items: center; min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 11px; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: var(--w-strong);
  color: var(--text); text-decoration: none; text-align: left;
}
.menu-pop > a:hover, .menu-pop > button:hover { background: var(--primary-soft); }

.map-overlay-top .chips { max-width: 560px; margin: 0 auto; padding: 10px 0; }
.map-overlay-top .chip:first-child { margin-left: auto; }
.map-overlay-top .chip:last-child { margin-right: auto; }

/* 지도 위 플로팅 목록 버튼 (네이버 지도의 '목록보기') */
.map-fab {
  position: absolute; z-index: 1010; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 19px; border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: 14.5px; font-weight: var(--w-strong);
  text-decoration: none; box-shadow: var(--shadow-md); border: 1px solid rgba(27, 36, 32, .05);
}
.map-fab:hover { box-shadow: var(--shadow-lg); }
body.sheet-open .map-fab, body.sheet-open .loc-fab { opacity: 0; pointer-events: none; transition: opacity .2s ease; }

.map-notice {
  position: absolute; inset: 0; z-index: 55;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 24px; background: var(--bg-sub);
}
.map-notice strong { font-size: 19px; letter-spacing: -.01em; }
.map-notice p { color: var(--text-sub); max-width: 34em; }
.map-notice code { background: var(--primary-bg); padding: 2px 7px; border-radius: 6px; font-size: 14px; }

/* 커스텀 마커 — 핀 + 업체명 라벨 */
.marker-wrap { position: relative; width: 28px; cursor: pointer; }
.marker-pin {
  position: relative; width: 28px; height: 28px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgba(27, 36, 32, .35);
  transition: transform .15s ease;
}
.marker-pin::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .92;
}
.marker-wrap:hover .marker-pin,
.marker-wrap.selected .marker-pin { transform: rotate(-45deg) scale(1.25); }
.marker-wrap.selected { z-index: 10; }
.marker-label {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
  max-width: 120px; padding: 1px 4px; border-radius: 5px;
  font-size: 11.5px; font-weight: var(--w-strong); color: #2A3630; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 0 #fff;
}
/* 넓은 줌에서는 라벨 숨김 (선택된 핀은 예외) */
.labels-off .marker-label { display: none; }
.labels-off .marker-wrap.selected .marker-label { display: block; }

/* ── 하단 시트 카드 ─────────────────────────── */
.bottom-card {
  position: fixed; left: 50%; bottom: 0; z-index: 1030;
  width: min(560px, 100%);
  background: var(--bg); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 24px 18px calc(18px + env(safe-area-inset-bottom));
  text-decoration: none; color: var(--text);
  transform: translate(-50%, 110%);
  transition: transform .3s cubic-bezier(.32, .72, .27, 1);
}
.bottom-card::before { /* 드래그 핸들 느낌 */
  content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px; background: var(--line);
}
.bottom-card.show { transform: translate(-50%, 0); }

/* 바텀시트 내부 (네이버 지도 장소 카드 구성) */
.sheet-main { display: block; text-decoration: none; color: var(--text); }
.sheet-title { display: flex; align-items: baseline; gap: 8px; }
.sheet-category { font-size: 13.5px; font-weight: var(--w-strong); }
.sheet-actions { display: flex; gap: 8px; margin-top: 15px; }
.sheet-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 44px; border-radius: 11px; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 14.5px; font-weight: var(--w-strong); color: var(--text);
  transition: background .15s ease;
}
.sheet-btn:hover { background: var(--bg-sub); }
.sheet-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.sheet-btn.primary:hover { background: var(--primary-dark); }

/* ── 업체 카드 텍스트 (목록/하단시트 공용) ────── */
.place-name { font-size: 19px; font-weight: var(--w-title); letter-spacing: -.015em; }
.owner-line { margin-top: 5px; font-size: 15px; font-weight: var(--w-strong); color: var(--primary-dark); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.place-sub { margin-top: 4px; font-size: 14px; color: var(--text-sub); }

.class-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 12.5px; font-weight: var(--w-strong); color: var(--text);
}
.class-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--class-green); }

.benefit-badge {
  display: inline-block; margin-top: 9px; padding: 4px 11px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent); font-size: 13px; font-weight: var(--w-strong);
}

/* ── 목록 상단 검색/필터 (list.html) ─────────── */
.list-topbar { max-width: 760px; margin: 0 auto; padding: 14px 16px 0; }
.list-topbar .chips { padding: 10px 0 4px; }

/* ── 카드 목록 (list.html) ──────────────────── */
.card-list {
  max-width: 760px; margin: 0 auto; padding: 8px 16px 40px;
  display: grid; gap: 12px;
}
.place-card {
  display: flex; gap: 16px; align-items: center;
  padding: 16px; background: var(--bg);
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.place-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.place-thumb {
  flex: none; width: 76px; height: 76px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12.5px; font-weight: 800; text-align: center; line-height: 1.25;
  padding: 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .1));
  background-blend-mode: overlay;
}

/* ── 상세 페이지 ────────────────────────────── */
.detail-wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 14px; }
.panel {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px 22px; box-shadow: var(--shadow-sm);
}
.detail-rows { display: grid; gap: 9px; margin-top: 16px; font-size: 15px; }
.detail-rows .row { display: flex; gap: 12px; }
.detail-rows .row b { flex: none; width: 68px; color: var(--text-sub); font-weight: 700; }

.benefit-box {
  background: var(--accent-bg); border: 1px solid #FFDFC9;
  border-radius: var(--radius-lg); padding: 24px 20px; text-align: center;
}
.benefit-box h3 { color: var(--accent); font-size: 17px; letter-spacing: -.01em; }
.benefit-box p { margin-top: 7px; color: #9A5A31; font-size: 14px; }

/* ── 버튼 / 폼 ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 0 22px; border-radius: 13px; border: 0;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: var(--w-strong);
  font-family: inherit; cursor: pointer; text-decoration: none; letter-spacing: -.01em;
  box-shadow: 0 2px 8px rgba(61, 129, 33, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(61, 129, 33, .34); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--bg-sub); }
.btn.small { min-height: 42px; font-size: 14px; padding: 0 16px; border-radius: 11px; }
.btn.danger { background: var(--danger); box-shadow: 0 2px 8px rgba(220, 38, 38, .28); }
.btn.danger:hover { background: #B91C1C; }

label.field { display: grid; gap: 7px; font-size: 13.5px; font-weight: var(--w-strong); color: var(--text-sub); }
input[type="text"], input[type="number"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 16px; /* iOS 자동 확대 방지 */
  color: var(--text); background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(61, 129, 33, .14);
}
textarea { min-height: 96px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; color: var(--text); }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--primary); }

.form-msg { font-size: 14px; min-height: 20px; font-weight: 600; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--primary-dark); }

/* ── 관리자 ────────────────────────────────── */
.admin-wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 16px; }
/* 로그인 화면: 화면 정중앙 배치 */
#loginView { min-height: calc(100dvh - 60px); align-content: center; }
#loginView .panel { width: min(420px, 100%); margin: 0 auto; }
@media (min-width: 900px) {
  .admin-grid { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
  /* 폼이 닫혀 있으면 목록이 전체 폭 사용 (오른쪽 빈 공간 제거) */
  .admin-grid:has(#formPanel[hidden]) { grid-template-columns: 1fr; }
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { color: var(--text-sub); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table tbody tr { cursor: pointer; transition: background .12s ease; }
.admin-table tbody tr:hover { background: var(--primary-soft); }
.status-tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-approved { background: var(--primary-bg); color: var(--primary-dark); }
.status-pending  { background: #FEF3C7; color: #92400E; }
.status-hidden   { background: var(--line); color: var(--text-sub); }

.empty-note { text-align: center; color: var(--text-sub); padding: 48px 16px; }

/* ── 검색 드롭다운 (구글 지도 방식) ───────────── */
.search-box { position: relative; max-width: 560px; margin: 0 auto; pointer-events: auto; }
.search-box .search-bar { max-width: none; border-radius: 999px; }
.search-suggest {
  position: absolute; top: 58px; left: 0; right: 0; z-index: 1011;
  background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.suggest-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; text-align: left;
}
.suggest-item:hover { background: var(--primary-soft); }
.suggest-item + .suggest-item { border-top: 1px solid var(--bg-sub); }
.suggest-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.suggest-main { min-width: 0; display: grid; }
.suggest-main b { font-size: 15px; font-weight: var(--w-strong); color: var(--text); }
.suggest-main small { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-dist { margin-left: auto; flex: none; font-size: 13px; font-weight: var(--w-strong); color: var(--primary-dark); }
.suggest-empty { padding: 16px; font-size: 14px; color: var(--text-sub); text-align: center; }

/* ── 현재 위치 버튼 (구글 지도 ⌖) ─────────────── */
.loc-fab {
  position: absolute; z-index: 1010; right: 14px; bottom: 96px;
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: var(--bg); color: var(--primary-dark);
  font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-md);
}
.loc-fab:hover { box-shadow: var(--shadow-lg); }
.loc-fab.busy { opacity: .5; pointer-events: none; }

/* 현재 위치 파란 점 */
.user-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #1A73E8; border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(26, 115, 232, .18), 0 1px 4px rgba(0, 0, 0, .3);
}

/* 바텀시트 대표 사진 (우측 정사각형) */
.sheet-main { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.sheet-thumb { flex: none; width: 84px; height: 84px; border-radius: 12px; object-fit: cover; }

/* ── 길찾기 선택 시트 ─────────────────────────── */
.dir-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(20, 28, 24, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.dir-sheet {
  width: min(560px, 100%); background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
  animation: dir-up .25s cubic-bezier(.32, .72, .27, 1);
}
@keyframes dir-up { from { transform: translateY(40px); opacity: 0; } }
.dir-sheet-head { display: grid; gap: 2px; padding: 0 4px 10px; }
.dir-sheet-head b { font-size: 17px; font-weight: var(--w-title); }
.dir-sheet-head span { font-size: 13.5px; color: var(--text-sub); }
.dir-link {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 54px; padding: 0 18px; border-radius: 13px;
  background: var(--bg-sub); text-decoration: none;
  font-size: 15.5px; font-weight: var(--w-strong); color: var(--text);
}
.dir-link:hover { background: var(--primary-bg); }
.dir-link span { color: var(--text-sub); }
.dir-cancel {
  min-height: 50px; border: 0; border-radius: 13px; margin-top: 4px;
  background: transparent; font-family: inherit;
  font-size: 15px; font-weight: var(--w-strong); color: var(--text-sub); cursor: pointer;
}

/* ── 사진: 상세 갤러리 + 관리자 그리드 ─────────── */
.photo-strip { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.photo-strip img {
  flex: none; width: min(46vw, 200px); height: min(46vw, 200px); /* 1:1 */
  border-radius: 12px; object-fit: cover; background: var(--bg-sub);
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo-grid .photo-item { position: relative; aspect-ratio: 1; }
.photo-grid img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.photo-grid .photo-del {
  position: absolute; top: -6px; right: -6px;
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 1; cursor: pointer;
}
.photo-hint { font-size: 12.5px; color: var(--text-sub); }

/* 글자수 카운터 */
.char-count { font-size: 12.5px; color: var(--text-sub); text-align: right; }
.char-count.over { color: var(--danger); }

/* 목록 카드 대표 사진 */
img.place-thumb { object-fit: cover; padding: 0; background: var(--bg-sub); }

/* ── 목록 오버레이 시트 (지도 위, 별도 페이지 대신) ── */
.list-sheet {
  position: absolute; z-index: 1020; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); height: min(64dvh, 560px);
  background: var(--bg); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.list-sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px;
}
.list-sheet-head b { font-size: 16px; font-weight: var(--w-title); }
.list-sheet-head button {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--bg-sub); color: var(--text-sub); font-size: 13px; cursor: pointer;
}
.list-sheet-body { flex: 1; overflow-y: auto; padding: 0 10px; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 8px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; text-align: left; border-radius: 12px;
}
.list-row:hover { background: var(--primary-soft); }
.list-row + .list-row { border-top: 1px solid var(--bg-sub); }
.list-row-thumb {
  flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: var(--w-strong); text-align: center; line-height: 1.2; padding: 2px;
}
.list-row-main { min-width: 0; display: grid; gap: 1px; }
.list-row-main b { font-size: 15.5px; font-weight: var(--w-strong); color: var(--text); }
.list-row-main .owner-line { font-size: 13px; }
.list-row-main small { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row > .suggest-dist { margin-left: auto; }
/* 시트 하단 고정 검색 */
.list-sheet-search { flex: none; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.list-sheet-search .search-bar { height: 46px; box-shadow: none; border: 1.5px solid var(--line); }

/* ── 사진 크롭 모달 (관리자) ─────────────────── */
.crop-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(27, 36, 32, .55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.crop-modal { width: 340px; max-width: 100%; background: var(--bg); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); }
.crop-title { font-size: 17px; font-weight: var(--w-title); }
.crop-sub { font-size: 12.5px; color: var(--text-sub); margin: 4px 0 14px; }
.crop-stage { width: 300px; max-width: 100%; aspect-ratio: 1; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; }
.crop-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-zoom { width: 100%; margin: 16px 0 6px; accent-color: var(--primary); cursor: pointer; }
.crop-actions { display: flex; gap: 8px; margin-top: 8px; }
.crop-actions .btn { flex: 1; }

/* 모션 최소화 선호 사용자 배려 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* ── Leaflet 컨트롤 다듬기 ─────────────────── */
.leaflet-control-zoom { border: 0 !important; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-md) !important; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--text) !important; border-color: var(--bg-sub) !important; }
@media (max-width: 768px) { .leaflet-control-zoom { display: none; } } /* 모바일은 핀치줌 */
.leaflet-control-attribution { font-size: 10px; opacity: .75; }


/* =========================================================================
 * Tour Assistant 레이아웃 (jimmyport/tour에서 이식 → Mokgo 녹색 리테마)
 * 왼쪽 결과 패널 + 우상단 범례 + 하단 검색바. 컴포넌트 골격은 index.html의
 * 인라인 스타일에 있고, 여기엔 리셋/스크롤바/모션/모바일 스택만 둔다.
 * ========================================================================= */
body.tour-page { height: 100dvh; margin: 0; overflow: hidden; background: var(--bg-sub); }
.tour-root { position: fixed; inset: 0; overflow: hidden; color: var(--text); }
.tour-page .leaflet-container { background: #e9ece5; font-family: inherit; }
.tour-page .leaflet-control-zoom { margin-bottom: 78px !important; }

/* 스크롤바 */
.sf-scroll::-webkit-scrollbar { width: 9px; }
.sf-scroll::-webkit-scrollbar-thumb { background: #cfd8cd; border-radius: 9px; border: 3px solid transparent; background-clip: content-box; }

/* 범례 행 (JS가 채움) */
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-sub); padding: 3px 0; }
.legend-row .legend-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; }

/* 패널 카테고리 칩 + 정렬 칩 + 빠른 칩 (공통 pill) */
.sf-chip {
  border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px;
  font: var(--w-strong) 12px 'Wanted Sans Variable'; cursor: pointer;
  background: #fff; color: var(--text-sub); transition: all .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.sf-chip:hover { border-color: var(--primary); color: var(--primary); }
.sf-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sf-chip .sf-chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sf-chip.active .sf-chip-dot { display: none; }

/* near-btn 활성 상태 */
#near-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 결과 패널 카드 */
.sf-card {
  width: 100%; text-align: left; display: flex; gap: 11px; align-items: flex-start;
  padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff;
  cursor: pointer; margin-bottom: 8px; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.sf-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.sf-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(61,129,33,.18); }
.sf-card-thumb {
  width: 46px; height: 46px; border-radius: 10px; flex: none; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font: var(--w-strong) 10.5px 'Wanted Sans Variable'; text-align: center; line-height: 1.1;
}
.sf-card-main { flex: 1; min-width: 0; }
.sf-card-top { display: flex; align-items: baseline; gap: 7px; }
.sf-card-name { font: var(--w-title) 13.5px 'Wanted Sans Variable'; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-card-cat { font: var(--w-strong) 11.5px 'Wanted Sans Variable'; flex: none; }
.sf-card-owner { font-size: 11px; color: var(--text-sub); margin-top: 3px; line-height: 1.4; }
.sf-card-owner .class-badge { font-size: 10.5px; }
.sf-card-addr { font-size: 11.5px; color: #97a29a; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-card-dist { font: var(--w-strong) 11.5px 'Wanted Sans Variable'; color: var(--primary); flex: none; align-self: center; white-space: nowrap; }
.sf-empty { text-align: center; color: var(--text-sub); font-size: 13px; padding: 34px 12px; }

/* Leaflet 팝업 = 장소 상세 */
.tour-page .leaflet-popup-content-wrapper { border-radius: 15px; box-shadow: var(--shadow-lg); padding: 3px; border: 1px solid var(--line); }
.tour-page .leaflet-popup-content { margin: 13px 15px; line-height: 1.45; }
.pop-name { font: var(--w-title) 15px 'Wanted Sans Variable'; letter-spacing: -.01em; }
.pop-cat { font: var(--w-strong) 12px 'Wanted Sans Variable'; }
.pop-owner { font-size: 12px; color: var(--text-sub); margin-top: 5px; }
.pop-desc { font-size: 12.5px; color: var(--text); margin-top: 6px; line-height: 1.45; }
.pop-addr { font-size: 12px; color: #97a29a; margin-top: 4px; }
.pop-benefit { font: var(--w-strong) 11.5px 'Wanted Sans Variable'; color: var(--accent); background: var(--accent-bg); border-radius: 8px; padding: 5px 9px; margin-top: 8px; display: inline-block; }
.pop-actions { display: flex; gap: 6px; margin-top: 11px; }
.pop-btn {
  flex: 1; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 9px;
  font: var(--w-strong) 12px 'Wanted Sans Variable'; cursor: pointer; border: 1px solid var(--line);
  background: #fff; color: var(--text); white-space: nowrap;
}
.pop-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 모바일: 플로팅 패널을 지도 위로 스택 */
@media (max-width: 760px) {
  .sf-panel { left: 8px !important; right: 8px !important; width: auto !important; top: 8px !important; bottom: 150px !important; }
  .sf-search { left: 8px !important; right: 8px !important; bottom: 8px !important; }
  .sf-legend { display: none !important; }
  .tour-page .leaflet-control-zoom { margin-bottom: 150px !important; }
}
