/*
 * 멜번 시티맵 — 화면 스타일 (토큰 → 기본 → 레이아웃 → 컴포넌트 → 반응형 → 안내 페이지)
 * 규칙은 DESIGN.md 참고. 새 값은 토큰으로만 추가한다. 간격은 4/8 배수. 링크 밑줄 금지(본문 링크는 hover 때만).
 * 참고: shadcn/ui(중립색·테두리·포커스 링), Radix Colors(단계형 색), Apple/Google 지도 웹(떠 있는 패널), Lucide(아이콘, ISC).
 */
:root {
  /* 브랜드: 시그니처 주황(#ff6b35)은 로고·핀·선택 표시, 흰 글자 버튼은 대비를 맞춘 진한 주황 */
  --brand: #ff6b35;
  --brand-50: #fff5f0;
  --brand-100: #ffe8dc;
  --brand-200: #fed0b8;
  --brand-ring: rgba(255, 107, 53, .32);
  --primary: #c2410c;
  --primary-hover: #a8380a;
  --primary-text: #b93c0b;
  --on-primary: #ffffff;
  --kakao: #fee500;
  --kakao-text: #191600;

  --bg: #f2f1ef;
  --surface: #ffffff;
  --surface-2: #f7f6f5;
  --surface-3: #efedeb;
  --border: #e9e6e3;
  --border-strong: #d6d2ce;
  --text: #1c1917;
  --text-2: #44403c;
  --text-muted: #6b6460;

  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  --cat-korean: #ff6b35;
  --cat-food: #e11d48;
  --cat-spots: #7c3aed;
  --cat-living: #0284c7;
  --cat-school: #059669;

  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px; --fs-16: 16px; --fs-18: 18px; --fs-20: 20px; --fs-24: 24px;
  --lh: 1.5;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow-md: 0 6px 20px rgba(28, 25, 23, .08), 0 1px 3px rgba(28, 25, 23, .06);
  --shadow-lg: 0 18px 50px rgba(28, 25, 23, .16), 0 2px 6px rgba(28, 25, 23, .06);
  --focus: 0 0 0 3px var(--brand-ring);
  --dur: 180ms; --ease: cubic-bezier(.2, .7, .2, 1);

  --panel-w: 408px;
  --gap: 12px;
  --tap: 44px;
  /* 브레이크포인트: 375/390/430 휴대폰, 768 태블릿, 900 이상 떠 있는 패널, 1280 데스크톱 */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--fs-15); line-height: var(--lh);
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  word-break: keep-all; overflow-wrap: anywhere; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.02em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; left: var(--s-2); top: -60px; z-index: 100; background: var(--text); color: #fff; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }
.skip-link:focus { top: var(--s-2); }

/* ── 레이아웃: 지도 전체 + 떠 있는 패널 ─────── */
.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; background: #e9e7e3; }
#map { position: absolute; inset: 0; }
.panel {
  position: absolute; z-index: 5; top: var(--gap); left: var(--gap); bottom: var(--gap); width: var(--panel-w);
  display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.panel-top { padding: var(--s-4) var(--s-4) 0; display: grid; gap: var(--s-3); background: var(--surface); position: relative; z-index: 3; }
.sheet { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet-handle { display: none; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* 브랜드 줄 */
.brandbar { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); }
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; flex: none; display: block; }
/* 글자 워드마크(아이콘 대신) — 진한 글자 + 주황 점 하나 */
.wordmark { display: grid; line-height: 1.1; min-width: 0; }
.wordmark strong { font-size: 21px; font-weight: 850; letter-spacing: -.04em; color: var(--text); white-space: nowrap; display: inline-flex; align-items: flex-end; gap: 1px; }
.wordmark strong i, .wordmark-sm i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin: 0 0 4px 2px; flex: none; }
.wordmark > span { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; margin-top: 3px; white-space: nowrap; }
.wordmark-sm { display: none; align-items: flex-end; gap: 1px; font-size: 17px; font-weight: 850; letter-spacing: -.04em; color: var(--text); white-space: nowrap; padding: 0 10px 0 4px; margin-right: 2px; border-right: 1px solid var(--border-strong); line-height: 1.2; }
.wordmark-sm i { width: 5px; height: 5px; margin-bottom: 4px; }
.logo-mark img, .logo-mark svg { width: 100%; height: 100%; border-radius: inherit; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-text strong { font-size: var(--fs-18); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.logo-text strong em { font-style: normal; color: var(--brand); }
.logo-text span { font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-md); border: 1px solid transparent; font-weight: 650; font-size: var(--fs-14); white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-kakao { background: var(--kakao); color: var(--kakao-text); }
.btn-kakao:hover { background: #f5dc00; }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); }
.btn-soft-danger:hover { background: #fee2e2; }
.btn-icon { width: var(--tap); padding: 0; }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-13); border-radius: 10px; }

/* 검색 */
.search { position: relative; }
.search-field { display: flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--s-2) 0 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur); }
.search-field:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: var(--focus); }
.search-field > .ico { color: var(--text-muted); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: var(--fs-16); }
.search-field input::placeholder { color: var(--text-muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); display: grid; place-items: center; }
.search-clear:hover { background: var(--surface-3); color: var(--text); }
.search-clear[hidden], .search-m[hidden] { display: none; }
.search-m { display: none; }
.search-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: var(--s-1); list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-height: min(60vh, 440px); overflow-y: auto; }
.search-results[hidden] { display: none; }
.search-opt { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-2) var(--s-3); border: 0; border-radius: 10px; background: transparent; text-align: left; }
.search-opt:hover, .search-opt[aria-selected="true"] { background: var(--brand-50); }
.search-note { padding: var(--s-4); color: var(--text-muted); font-size: var(--fs-14); text-align: center; }

/* 카테고리 탭 — 5개를 한 줄에 모두(Hick) */
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 0 0 var(--s-3); border-bottom: 1px solid var(--border); margin: 0 calc(var(--s-4) * -1); padding-inline: var(--s-2); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; padding: var(--s-2) 0; border-radius: var(--r-md); color: var(--text-muted); font-weight: 650; font-size: var(--fs-12); white-space: nowrap; transition: background var(--dur), color var(--dur); min-width: 0; }
.tab-ico { width: 34px; height: 30px; border-radius: 10px; display: grid; place-items: center; transition: background var(--dur), color var(--dur); }
.tab-ico .ico { width: 20px; height: 20px; }
.tab:hover { color: var(--text); }
.tab:hover .tab-ico { background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 750; }
.tab[aria-selected="true"] .tab-ico { background: var(--brand); color: #fff; }
.tab:focus-visible { outline: none; box-shadow: var(--focus); }

/* 목록 머리·칩 */
.list-head { position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); padding: var(--s-3) var(--s-4) var(--s-2); display: grid; gap: 10px; }
.list-title { display: flex; align-items: baseline; gap: var(--s-2); }
.list-title h2 { font-size: var(--fs-18); font-weight: 800; }
.list-title .count { font-size: var(--fs-13); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s-4) * -1); padding: 2px var(--s-4) 4px; scroll-padding-inline: var(--s-4); }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-13); font-weight: 650; white-space: nowrap; position: relative; transition: background var(--dur), border-color var(--dur), color var(--dur); }
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.chip .n { font-variant-numeric: tabular-nums; opacity: .6; font-weight: 600; }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }

/* 정착 서비스 배너(목록 위, 한 화면에 하나만) */
.promo { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-1) var(--s-4) var(--s-2); padding: var(--s-3) 14px; border-radius: var(--r-lg); background: linear-gradient(120deg, #fff1e8 0%, #ffe6d8 100%); transition: transform var(--dur), box-shadow var(--dur); }
.promo[hidden] { display: none; }
.promo:hover { box-shadow: var(--shadow-md); }
.promo-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.promo-text { flex: 1; min-width: 0; display: grid; }
.promo-text strong { font-size: var(--fs-14); font-weight: 750; }
.promo-text span { font-size: var(--fs-13); color: var(--text-2); }
.promo .tag { font-size: var(--fs-12); font-weight: 750; color: var(--primary-text); background: #fff; border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap; align-self: center; }

/* 장소 목록 */
.places { list-style: none; margin: 0; padding: 0 var(--s-2) var(--s-3); }
.place { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 68px; padding: 10px var(--s-3); border: 0; border-radius: var(--r-md); background: transparent; text-align: left; transition: background var(--dur); }
.place:hover { background: var(--surface-2); }
.place[aria-current="true"] { background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-200); }
.place:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
/* 로고 타일은 가로 4:3 — 가로로 긴 워드마크 로고도 작아지지 않게 */
.thumb { width: 60px; height: 45px; border-radius: 10px; flex: none; background: #fff; box-shadow: inset 0 0 0 1px var(--border); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.is-icon { background: var(--surface-2); box-shadow: none; }
.thumb.is-icon img { width: 28px; height: 28px; object-fit: contain; }
.place-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.place-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-15); min-width: 0; }
.place-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-en { font-size: var(--fs-12); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub { font-size: var(--fs-13); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub b { font-weight: 650; color: var(--text-2); }
.place .chev { color: var(--border-strong); flex: none; }
.badge { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 650; white-space: nowrap; }
.badge-warn { background: var(--warning-soft); color: var(--warning); box-shadow: inset 0 0 0 1px #fde68a; }

/* 상태 */
.state { padding: var(--s-8) var(--s-6); text-align: center; color: var(--text-muted); display: grid; gap: var(--s-3); justify-items: center; }
.state[hidden] { display: none; }
.state strong { color: var(--text); font-size: var(--fs-16); }
.skeleton { list-style: none; margin: 0; padding: 0 var(--s-2); }
.skeleton[hidden] { display: none; }
.skeleton li { display: flex; gap: var(--s-3); padding: 10px var(--s-3); align-items: center; }
.sk { background: linear-gradient(90deg, #f0eeec 0%, #f8f7f6 50%, #f0eeec 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: var(--r-sm); display: block; }
@keyframes sk { to { background-position: -200% 0; } }

/* 상세 카드(목록은 그대로 두고 옆/아래에 띄움 — 다른 곳을 눌러도 뒤로 갈 필요 없음) */
.dcard { position: absolute; z-index: 6; top: var(--gap); left: calc(var(--gap) * 2 + var(--panel-w)); width: 380px; max-height: calc(100% - var(--gap) * 2); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: card-in 220ms var(--ease); }
.dcard[hidden] { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
.dcard-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 8px 8px 0; }
.dcard-bar .btn-icon { width: 40px; min-height: 40px; border-radius: 12px; }
.dcard-pos { font-size: var(--fs-13); color: var(--text-muted); font-weight: 650; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; white-space: nowrap; }
.dcard-close { margin-left: auto; }
.dcard .detail { overflow-y: auto; overscroll-behavior: contain; }
.detail { padding: var(--s-2) var(--s-4) var(--s-5); display: grid; gap: var(--s-4); }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-head .thumb { width: 96px; height: 72px; border-radius: 14px; }
.detail-head .thumb.is-icon img { width: 40px; height: 40px; }
.detail-title { display: grid; gap: 2px; min-width: 0; }
.detail-title h2:focus { outline: none; }
.detail-title h2 { font-size: var(--fs-24); font-weight: 800; line-height: 1.25; }
.detail-title p { color: var(--text-muted); font-size: var(--fs-14); }
.detail-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 44px; padding: 0 10px; border-radius: var(--r-pill); border: 0; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-13); font-weight: 700; white-space: nowrap; transition: background var(--dur); }
.act:hover { background: var(--surface-3); color: var(--text); }
.act .ico { width: 17px; height: 17px; flex: none; }
.act.is-primary { background: var(--primary); color: #fff; }
.act.is-primary:hover { background: var(--primary-hover); }
.act.is-kakao { background: var(--kakao); color: var(--kakao-text); }
.act.is-kakao:hover { background: #f5dc00; }
.act:focus-visible { outline: none; box-shadow: var(--focus); }
.facts { display: grid; border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; }
.fact { display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px var(--s-4); }
.fact + .fact { border-top: 1px solid var(--border); }
.fact .ico { color: var(--text-muted); margin-top: 1px; width: 18px; height: 18px; }
.fact a { color: var(--primary-text); font-weight: 700; }
.detail-note { font-size: var(--fs-13); color: var(--text-muted); }
.detail-note a { color: var(--text-2); font-weight: 650; }
.detail-note a:hover, .about a:hover, .page-main a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }

/* 아이에듀넷 카드(패널 맨 아래 고정) — 주소는 구글맵, 전화·문자 바로 연결 */
.agency { flex: none; display: flex; align-items: center; gap: 10px; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); background: var(--surface); position: relative; z-index: 3; }
.agency-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--text); color: #fff; display: grid; place-items: center; flex: none; }
.agency-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.agency-text strong { font-size: var(--fs-14); font-weight: 750; white-space: nowrap; }
.agency-logo { height: 19px; width: auto; margin-bottom: 3px; }
.agency-text a { font-size: var(--fs-13); color: var(--text-muted); white-space: nowrap; justify-self: start; }
.agency-text a:hover { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.agency .btn { min-height: 40px; height: 40px; flex: none; }
.agency .btn-icon { width: 40px; }
.agency-kakao { padding: 0 var(--s-3); gap: 6px; }

/* 아래 바로가기(카테고리 목록 페이지 — 검색엔진도 따라감) */
.about { margin: var(--s-2) var(--s-4) var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.about[hidden] { display: none; }
.about-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-3); }
.about-links a { min-height: 32px; display: inline-flex; align-items: center; color: var(--text-muted); font-size: var(--fs-13); font-weight: 600; white-space: nowrap; }
.about-links a:hover { color: var(--text); }
.footer-social { display: flex; gap: 2px; }
.footer-social a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--text-muted); }
.footer-social a:hover { background: var(--surface-2); color: var(--text); }
.footer-social .ico { width: 18px; height: 18px; }

/* 가까운 순 */
.sort-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-13); font-weight: 650; white-space: nowrap; position: relative; }
.sort-btn::after { content: ""; position: absolute; inset: -6px -2px; }
.sort-btn .ico { width: 16px; height: 16px; }
.sort-btn[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand-200); color: var(--primary-text); }
.sort-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.dist { flex: none; font-size: var(--fs-12); font-weight: 700; color: var(--primary-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 지도 위 버튼(오른쪽 아래) */
.map-fabs { position: absolute; z-index: 4; right: var(--s-4); bottom: var(--s-6); display: grid; gap: 10px; justify-items: end; }
.fab { height: 48px; min-width: 48px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow-md); display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); color: var(--text); font-weight: 750; font-size: var(--fs-14); padding: 0 14px; white-space: nowrap; }
.fab.is-round { width: 48px; padding: 0; }
.fab:hover { color: var(--primary-text); }
.fab-kakao { background: var(--kakao); color: var(--kakao-text); }
.fab-kakao:hover { color: var(--kakao-text); background: #f5dc00; }
@media (min-width: 900px) { .fab-kakao { display: none; } } /* 데스크톱은 패널 하단 카드에만 */
.fab[aria-busy="true"] .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-error { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-6); text-align: center; color: var(--text-muted); }

/* 비상연락처 */
dialog.modal { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 880px); padding: 0; border: 0; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(28, 25, 23, .5); }
.modal-head { flex: none; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-3) var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); }
.modal-head .head-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; }
.modal-head h2 { font-size: var(--fs-18); font-weight: 800; margin-right: auto; }
.modal-body { padding: var(--s-4) var(--s-5) var(--s-6); display: grid; gap: var(--s-5); overflow-y: auto; }
.e-section { display: grid; gap: var(--s-2); }
.e-section h3 { font-size: var(--fs-13); font-weight: 750; color: var(--text-muted); }
.e-call { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.e-call:hover { background: var(--surface-3); }
.e-call > .ico { color: var(--text-muted); }
.e-call.is-urgent { background: var(--danger-soft); }
.e-call.is-urgent > .ico, .e-call.is-urgent .e-num { color: var(--danger); }
.e-call-text { flex: 1; min-width: 0; display: grid; }
.e-call-text strong { font-size: var(--fs-15); }
.e-call-text small { color: var(--text-muted); font-size: var(--fs-13); }
.e-num { font-weight: 800; font-size: var(--fs-16); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--primary-text); }
.e-place { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.e-place p { color: var(--text-muted); font-size: var(--fs-13); }
.e-place-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--text); color: #fff; font-size: var(--fs-14); box-shadow: var(--shadow-lg); }
.toast[hidden] { display: none; }
.pin-label { font-family: var(--font-sans); font-weight: 700; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }

/* ── 휴대폰·태블릿(900 미만): 상단 검색·탭 카드 + 아래 시트 ── */
@media (max-width: 899.98px) {
  .panel { display: contents; }
  .panel-top { position: fixed; z-index: 20; left: var(--s-2); right: var(--s-2); top: max(var(--s-2), env(safe-area-inset-top)); padding: 6px; gap: 6px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
  .brandbar { display: none; }
  .search-field { height: 46px; padding-left: 6px; }
  .search-m { display: grid; }
  .wordmark-sm.search-m { display: inline-flex; }
  .search-m.btn { width: 38px; min-height: 38px; }
  .tabs { display: flex; gap: 6px; margin: 0; padding: 0 0 2px; border: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; flex-direction: row; gap: 4px; min-height: 36px; padding: 0 12px 0 6px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-13); }
  .tab-ico { width: 24px; height: 24px; border-radius: 50%; }
  .tab-ico .ico { width: 16px; height: 16px; }
  .tab[aria-selected="true"] { background: var(--brand-50); color: var(--primary-text); }
  .sheet { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; height: 86dvh; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -10px 30px rgba(28,25,23,.14); transform: translateY(calc(86dvh - var(--peek, 176px))); transition: transform 280ms var(--ease); }
  .sheet[data-state="half"] { transform: translateY(44dvh); }
  .sheet[data-state="full"] { transform: translateY(0); }
  .sheet.is-dragging { transition: none; }
  .sheet-handle { display: grid; place-items: center; height: 28px; border: 0; background: transparent; flex: none; width: 100%; touch-action: none; }
  .sheet-handle::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); }
  .sheet[data-state="peek"] .sheet-scroll { overflow: hidden; }
  .list-head { padding-top: 2px; touch-action: none; }
  .agency { padding-bottom: max(var(--s-3), env(safe-area-inset-bottom)); }
  .map { position: fixed; inset: 0; }
  .map-fabs { bottom: calc(var(--peek, 176px) + 12px); right: var(--s-3); transition: opacity var(--dur); }
  .app.sheet-up .map-fabs { opacity: 0; pointer-events: none; }
  .fab-kakao .fab-label { display: none; }
  .fab-kakao { width: 48px; padding: 0; }
  .dcard { position: fixed; z-index: 18; top: auto; left: var(--s-2); right: var(--s-2); bottom: max(var(--s-2), env(safe-area-inset-bottom)); width: auto; max-height: 66dvh; touch-action: pan-y; }
  .app.card-open .sheet { transform: translateY(100%); }
  .app.card-open .map-fabs { opacity: 0; pointer-events: none; }
  .dcard .detail { padding-bottom: var(--s-4); }
  dialog.modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .toast { bottom: calc(var(--peek, 176px) + 16px); }
  .detail-head .thumb { width: 84px; height: 63px; }
  .detail-title h2 { font-size: var(--fs-20); }
}
@media (max-width: 359.98px) {
  .tab { font-size: 11px; }
  .act { font-size: 12px; padding: 0 6px; gap: 4px; }
}
@media (min-width: 1280px) { :root { --panel-w: 420px; --gap: 16px; } }
@media (min-width: 900px) and (max-width: 1099.98px) { .dcard { width: 340px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── 정적 안내 페이지(카테고리·AI 안내·404) ── */
body.page { overflow: auto; background: var(--surface); }
.page-wrap { width: min(960px, 100% - 32px); margin-inline: auto; }
.page-top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.page-top .page-wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 64px; }
.page-main { padding: var(--s-6) 0 var(--s-8); display: grid; gap: var(--s-4); }
.page-main h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.25; }
.page-main .lead { font-size: var(--fs-16); color: var(--text-muted); max-width: 68ch; text-wrap: pretty; }
.page-main a:not(.btn) { color: var(--primary-text); font-weight: 650; }
.crumbs { font-size: var(--fs-13); color: var(--text-muted); }
.crumbs a { color: inherit !important; font-weight: 500 !important; }
.toc { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.toc a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2) !important; font-size: var(--fs-13); font-weight: 650; white-space: nowrap; }
.toc a:hover { background: var(--brand-50); color: var(--primary-text) !important; text-decoration: none !important; }
.page-sec { display: grid; gap: var(--s-3); padding-top: var(--s-4); scroll-margin-top: 80px; }
.page-sec h2 { font-size: var(--fs-18); font-weight: 800; display: flex; align-items: baseline; gap: var(--s-2); }
.page-sec h2 .count { font-size: var(--fs-13); color: var(--text-muted); font-weight: 600; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ptable { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.ptable th, .ptable td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.ptable thead th { border-top: 0; background: var(--surface-2); font-size: var(--fs-13); color: var(--text-muted); font-weight: 650; white-space: nowrap; }
.ptable tbody th { font-weight: 700; width: 34%; }
.ptable tbody th small { display: block; font-weight: 500; color: var(--text-muted); font-size: var(--fs-13); }
.ptable tbody th .badge { margin-top: 4px; }
.ptable td:nth-child(2) { width: 16%; color: var(--text-muted); white-space: nowrap; }
.ptable.no-brand td:nth-child(2), .ptable.no-brand thead th:nth-child(2) { display: none; }
.ptable td:last-child { color: var(--text-muted); }
.cat-links, .plain { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-2); }
.page-foot { padding: var(--s-6) 0 var(--s-8); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-13); display: grid; gap: var(--s-1); }
.page-foot a { color: var(--text-2); font-weight: 600; }
@media (max-width: 640px) {
  .ptable thead { display: none; }
  .ptable, .ptable tbody, .ptable tr, .ptable th, .ptable td { display: block; width: auto !important; }
  .ptable tr { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); }
  .ptable tbody tr:first-child { border-top: 0; }
  .ptable th, .ptable td { padding: 0; border: 0; }
  .ptable td:nth-child(2):empty { display: none; }
  .ptable td { font-size: var(--fs-13); margin-top: 2px; white-space: normal !important; }
}

/* ── 첫 방문 연출: 비행기 → 탑승권 → 멜번 지도 (세션당 1회, 동작 줄이기면 생략) ── */
.intro { display: none; }
html.cm-intro .intro { display: grid; }
html.cm-intro body { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 200; place-items: center; overflow: hidden; color: #fff; transition: opacity 600ms var(--ease), visibility 600ms; }
.intro[hidden] { display: none; }
.intro.is-out { opacity: 0; visibility: hidden; }
.intro-sky { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(15,23,42,.72) 0%, rgba(30,27,46,.45) 45%, rgba(234,88,12,.35) 100%),
  url("/assets/intro/tram-960.webp") center / cover no-repeat; transform: scale(1.06); animation: sky 3.4s var(--ease) forwards; }
@media (min-width: 900px) { .intro-sky { background-image: linear-gradient(180deg, rgba(15,23,42,.72) 0%, rgba(30,27,46,.45) 45%, rgba(234,88,12,.35) 100%), url("/assets/intro/tram-1920.webp"); } }
@keyframes sky { to { transform: scale(1); } }
.intro-route { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-route path { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 2; stroke-dasharray: 6 10; vector-effect: non-scaling-stroke; stroke-dashoffset: 1600; animation: route 1.6s var(--ease) forwards; }
@keyframes route { to { stroke-dashoffset: 0; } }
.intro-plane { position: absolute; left: 0; top: 0; width: 64px; height: 64px; offset-path: path("M -40 520 C 260 420, 520 120, 1040 90"); offset-rotate: auto; animation: fly 2.2s cubic-bezier(.45,.05,.3,1) forwards; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); }
@keyframes fly { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.pass { position: relative; display: flex; width: min(560px, calc(100vw - 32px)); color: var(--text); filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); opacity: 0; transform: translateY(40px) scale(.96); animation: pass-in 700ms 450ms var(--ease) forwards; }
@keyframes pass-in { to { opacity: 1; transform: none; } }
.pass-main { flex: 1; min-width: 0; background: #fffaf6; border-radius: 18px 0 0 18px; padding: 18px 20px; display: grid; gap: 14px; -webkit-mask: radial-gradient(circle 10px at 100% 0, #0000 98%, #000) top right / 100% 51% no-repeat, radial-gradient(circle 10px at 100% 100%, #0000 98%, #000) bottom right / 100% 51% no-repeat; }
.pass-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--text-muted); }
.pass-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-text); }
.pass-brand img { border-radius: 6px; }
.pass-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.pass-route > div:last-child { text-align: right; }
.pass-route small, .pass-meta small, .pass-stub small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--text-muted); }
.pass-route b { display: block; font-size: clamp(34px, 9vw, 46px); line-height: 1; font-weight: 850; letter-spacing: -.02em; }
.pass-route span { font-size: 13px; color: var(--text-2); font-weight: 650; }
.pass-plane { color: var(--brand); padding-bottom: 18px; }
.pass-plane .ico { width: 26px; height: 26px; }
.pass-board { background: #1c1917; border-radius: 10px; padding: 8px 10px; font: 800 clamp(15px, 4.2vw, 19px)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; color: #fbbf24; white-space: nowrap; overflow: hidden; text-align: center; }
.flap-row span, .flap span { display: inline-block; min-width: .62em; animation: flip 90ms steps(2) infinite; }
.flap-row span.done, .flap span.done { animation: none; }
@keyframes flip { 50% { transform: scaleY(.15); } }
.pass-meta { display: grid; grid-template-columns: 1fr 1.6fr .6fr; gap: 10px; border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.pass-meta b { font-size: 14px; font-weight: 800; white-space: nowrap; }
.pass-stub { width: 112px; flex: none; background: var(--brand); color: #fff; border-radius: 0 18px 18px 0; padding: 18px 14px; display: grid; align-content: space-between; border-left: 2px dashed rgba(255,255,255,.7); transform-origin: left center; }
.pass-stub small { color: rgba(255,255,255,.85); }
.pass-stub b { font-size: 34px; font-weight: 850; line-height: 1; }
.pass-bars { height: 46px; border-radius: 4px; background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 8px); opacity: .9; }
.intro.is-tear .pass-stub { animation: tear 600ms var(--ease) forwards; }
@keyframes tear { to { transform: translate(40px, 30px) rotate(18deg); opacity: 0; } }
.intro.is-tear .pass-main { animation: zoomout 650ms 150ms var(--ease) forwards; }
@keyframes zoomout { to { transform: scale(.9); opacity: 0; } }
.intro-skip { position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.25); color: #fff; font-weight: 700; font-size: 14px; backdrop-filter: blur(6px); }
.intro-skip:hover { background: rgba(0,0,0,.4); }
@media (max-width: 480px) {
  .pass { flex-direction: column; width: min(340px, calc(100vw - 32px)); }
  .pass-main { border-radius: 18px 18px 0 0; -webkit-mask: none; }
  .pass-stub { width: auto; border-radius: 0 0 18px 18px; border-left: 0; border-top: 2px dashed rgba(255,255,255,.7); grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; transform-origin: top center; }
  .pass-bars { height: 28px; }
  .pass-meta { grid-template-columns: 1fr 1.5fr .7fr; }
}
@media (prefers-reduced-motion: reduce) { .intro { display: none !important; } }

/* ── 장소 상세: 구글 지도 장소 패널식(머리 · 칩 버튼 줄 · 흰 목록 행) ── */
.gm-head { display: flex; gap: 12px; align-items: flex-start; padding-top: 2px; }
.gm-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px #e8eaed; background: #fff; margin-top: 4px; }
.gm-avatar img { width: 100%; height: 100%; object-fit: contain; }
.gm-title { display: grid; gap: 2px; min-width: 0; }
.gm-title h2 { font-size: 22px; font-weight: 750; line-height: 1.3; letter-spacing: -.02em; }
.gm-title h2:focus { outline: none; }
.gm-title p { font-size: 14px; color: #5f6368; }
.gm-title .gm-en { font-size: 13px; }
.gm-status { font-size: 14px !important; color: #3c4043 !important; }
.gm-open { color: #188038; font-weight: 650; }
.gm-closed { color: #d93025; font-weight: 650; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s-4) * -1); padding: 2px var(--s-4); }
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 12px; border-radius: var(--r-pill); border: 1px solid #dadce0; background: #fff; color: #3c4043; font-size: 14px; font-weight: 600; white-space: nowrap; position: relative; transition: background var(--dur); }
.chip-btn::after { content: ""; position: absolute; inset: -3px 0; }
.chip-btn:hover { background: #f1f3f4; }
.chip-btn .ico { width: 18px; height: 18px; }
.chip-btn.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-btn.is-primary:hover { background: var(--primary-hover); }
.chip-btn.is-kakao { background: var(--kakao); border-color: var(--kakao); color: var(--kakao-text); }
.chip-btn.is-kakao:hover { background: #f5dc00; }
.chip-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.gm-list { display: grid; margin: 0 calc(var(--s-4) * -1); }
.gm-row { display: flex; align-items: center; gap: 0; min-height: 52px; padding: 0 var(--s-4); color: #202124; font-size: 15px; text-decoration: none; position: relative; }
.gm-row > .ico { width: 24px; height: 24px; color: #5f6368; flex: none; margin-right: 20px; stroke-width: 1.8; }
.gm-row + .gm-row::before { content: ""; position: absolute; top: 0; left: calc(var(--s-4) + 44px); right: 0; border-top: 1px solid #e8eaed; }
a.gm-row:hover { background: #f8f9fa; }
a.gm-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.gm-row-body { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 10px 0; }
.gm-row-body, .gm-row-title { overflow-wrap: anywhere; }
.gm-muted { color: #80868b; font-size: 13px; margin-left: 4px; }
.gm-row-title { font-weight: 650; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.gm-row-title em { font-style: normal; font-size: 13px; font-weight: 700; color: #188038; }
.gm-row-sub { font-size: 13px; color: #5f6368; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-chev, .gm-chev-wrap .ico { width: 18px; height: 18px; color: #9aa0a6; flex: none; margin-left: 8px; }
.gm-chev-wrap { display: inline-flex; }
.gm-row-panel { margin: 0; border-bottom: 1px solid #e8eaed; }
.gm-row-panel[hidden] { display: none; }
.dcard .detail { gap: 14px; }

/* 명소는 아이콘 칸 없이 글자만(사용자 요청) */
.place:not(:has(.thumb)) { padding-left: var(--s-4); }

.fab-3d { font-weight: 850; font-size: 14px; letter-spacing: -.02em; }
.fab-3d[aria-pressed="true"] { background: var(--text); color: #fff; }
.fab[hidden] { display: none; }

/* 로고가 없는 곳: 그림 대신 이름 첫 글자(카테고리 색 연한 바탕) */
.thumb.is-mono { background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: none; color: color-mix(in srgb, var(--c) 82%, #000); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.map-layer { position: absolute; inset: 0; }
.map-layer[hidden] { display: none; }
