[hidden] { display: none !important; } /* 숨긴 요소를 CSS display 가 다시 보이게 하는 사고 방지 */
:root {
  --mint: #4ebe9f;
  --mint-deep: #2f9a7d;
  --mint-soft: #e6f6f1;
  --amber: #f5a623;
  --amber-soft: #fff4e0;
  --red: #e5534b;
  --red-soft: #fdecea;
  --gray: #9aa3a0;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #25302c;
  --text-sub: #6b7672;
  --line: #ebeeed;
  --shadow: 0 6px 20px rgba(37, 48, 44, 0.12);
  --peek: 214px;
  --sheet-h: 76vh;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  word-break: keep-all;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

#map { position: fixed; inset: 0; z-index: 0; background: #eef1ef; }

/* ── 상단 검색/필터 ── */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: calc(10px + env(safe-area-inset-top)) 12px 0; max-width: 560px; margin: 0 auto; pointer-events: none; }
.top > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.search-icon { font-size: 1rem; }
.search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1rem; background: transparent; color: var(--text); min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 28px; height: 28px; border-radius: 50%; background: var(--line); font-size: 0.8rem; }
.suggest { list-style: none; margin-top: 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; max-height: 50vh; overflow-y: auto; }
.suggest li button { width: 100%; text-align: left; padding: 12px 14px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.suggest li:last-child button { border-bottom: 0; }
.suggest li button:hover, .suggest li button:focus { background: var(--mint-soft); outline: 0; }
.suggest small { color: var(--text-sub); font-size: 0.78rem; margin-left: auto; white-space: nowrap; }
.suggest .empty { padding: 14px; color: var(--text-sub); font-size: 0.9rem; }

.filters { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.filters::-webkit-scrollbar { display: none; }
.seg { display: flex; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 3px; flex-shrink: 0; }
.seg button { padding: 7px 11px; border-radius: 9px; font-size: 0.85rem; font-weight: 700; color: var(--text-sub); white-space: nowrap; }
.seg button.is-on { background: var(--mint); color: #fff; }
.toggle { flex-shrink: 0; padding: 0 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 0.85rem; font-weight: 700; color: var(--text-sub); white-space: nowrap; }
.toggle[aria-pressed='true'] { background: var(--mint-deep); color: #fff; }

.crosshair { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 5; pointer-events: none; opacity: 0.55; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: var(--mint-deep); border-radius: 2px; }
.crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
.crosshair::after { top: 10px; left: 0; height: 2px; width: 22px; }
.crosshair[hidden] { display: none; }

/* ── 지도 핀 ── */
.pin { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.pin { --pc: var(--mint-deep); }
.pin-body { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 5px; border-radius: 999px; background: var(--surface); border: 2px solid var(--pc); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pin-body i { width: 16px; height: 16px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; }
.pin-body b { color: var(--text); font-weight: 800; }
.pin::after { content: ''; width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--pc); border-bottom: 0; margin-top: -1px; }
.pin.open { --pc: var(--mint-deep); }
.pin.full { --pc: var(--red); }
.pin.unknown { --pc: var(--gray); }
.pin.is-selected .pin-body { background: var(--pc); }
.pin.is-selected .pin-body b { color: #fff; }
.pin.is-selected .pin-body i { background: #fff; color: var(--pc); }
.pin.is-selected { z-index: 3; }
.pin.bounce .pin-body { animation: bounce 0.6s cubic-bezier(0.28, 0.84, 0.42, 1); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px); } 60% { transform: translateY(0); } 78% { transform: translateY(-5px); } }

.pin.sponsor { --pc: var(--amber); }
.pin.sponsor .pin-body { background: linear-gradient(160deg, #ffd66b, var(--amber)); border-color: #fff; color: #5b3a00; box-shadow: 0 4px 12px rgba(245, 166, 35, 0.5); }
.pin.sponsor .pin-body b { color: #5b3a00; }
.pin.sponsor .pin-body i { background: #fff; color: var(--amber); }

.leaflet-pin { background: none; border: 0; }
.leaflet-pin > .pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); }
.cluster { display: grid; place-items: center; border-radius: 50%; background: rgba(78, 190, 159, 0.88); border: 3px solid #fff; color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }

.user-dot { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3); }

/* ── 우측 하단 버튼 ── */
.fabs { position: fixed; right: 14px; bottom: calc(var(--peek) + 14px); z-index: 15; display: flex; flex-direction: column; gap: 10px; transition: opacity 0.2s, transform 0.3s; }
.fab { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); color: var(--mint-deep); display: grid; place-items: center; }
.fab.is-busy { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.sheet-open .fabs, body.sheet-detail .fabs { opacity: 0; pointer-events: none; transform: translateY(20px); }

/* ── 바텀시트 ── */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--sheet-h); max-width: 560px; margin: 0 auto; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(37, 48, 44, 0.15); display: flex; flex-direction: column; transform: translateY(calc(var(--sheet-h) - var(--peek))); transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1); touch-action: pan-y; }
body.sheet-open .sheet, body.sheet-detail .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grip { padding: 10px 0 6px; display: flex; justify-content: center; cursor: grab; flex-shrink: 0; touch-action: none; }
.sheet-grip span { width: 44px; height: 5px; border-radius: 3px; background: #d6dcda; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 12px; overscroll-behavior: contain; }
.sheet-body[hidden] { display: none; }

.summary { padding: 2px 0 10px; cursor: pointer; }
.summary-title { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.02em; }
.summary-title em { font-style: normal; color: var(--mint-deep); }
.summary-sub { font-size: 0.83rem; color: var(--text-sub); margin-top: 2px; }
.legend { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-sub); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.legend span { display: flex; align-items: center; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-open { background: var(--mint); }
.dot-full { background: var(--red); }
.dot-gold { background: var(--amber); }

.center-list { list-style: none; }
.center-list li > button { width: 100%; text-align: left; display: flex; gap: 12px; align-items: flex-start; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.c-main { flex: 1; min-width: 0; }
.c-name { font-weight: 800; font-size: 0.98rem; display: flex; align-items: center; gap: 6px; }
.c-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-addr { font-size: 0.8rem; color: var(--text-sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-side { text-align: right; flex-shrink: 0; }
.c-dist { font-size: 0.85rem; font-weight: 800; }
.c-count { font-size: 0.75rem; color: var(--text-sub); }
.list-sponsor > button { background: var(--amber-soft); border-radius: 14px; padding: 12px !important; margin: 10px 0 2px; border-bottom: 0 !important; }
.ad-label { font-size: 0.66rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.07); color: var(--text-sub); flex-shrink: 0; }
.list-empty { padding: 28px 8px; text-align: center; color: var(--text-sub); font-size: 0.9rem; }
.list-empty button { margin-top: 12px; padding: 10px 16px; border-radius: 12px; background: var(--mint-soft); color: var(--mint-deep); font-weight: 700; }
.more-btn { width: 100%; padding: 14px; font-weight: 700; color: var(--mint-deep); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: 0.74rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.badge.open { background: var(--mint-soft); color: var(--mint-deep); }
.badge.full { background: var(--red-soft); color: var(--red); }
.badge.unknown { background: #f0f2f1; color: var(--text-sub); }

.sponsor-cta { display: block; margin: 16px 0 4px; padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 0.8rem; color: var(--text-sub); text-decoration: none; text-align: center; }
.sponsor-cta b { color: #b36b00; }

.notice-bar { display: block; flex-shrink: 0; padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); background: var(--amber-soft); color: #7a5200; font-size: 0.72rem; text-decoration: none; border-top: 1px solid #f7e2bb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 상세 ── */
.d-head { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 12px; }
.d-back { width: 36px; height: 36px; border-radius: 12px; background: var(--bg); flex-shrink: 0; font-size: 1.05rem; }
.d-title { flex: 1; min-width: 0; }
.d-title h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.d-title p { font-size: 0.83rem; color: var(--text-sub); margin-top: 4px; }
.d-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 16px; background: var(--bg); }
.d-status strong { font-size: 1.1rem; }
.d-status small { display: block; color: var(--text-sub); font-size: 0.78rem; }
.d-status.open { background: var(--mint-soft); }
.d-status.open strong { color: var(--mint-deep); }
.d-status.full { background: var(--red-soft); }
.d-status.full strong { color: var(--red); }
.capbar { height: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); overflow: hidden; margin-top: 10px; }
.capbar span { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.d-status.full .capbar span { background: var(--red); }
.capnum { font-size: 0.8rem; color: var(--text-sub); margin-top: 6px; display: flex; justify-content: space-between; }

.d-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.d-actions a, .d-actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 16px; font-weight: 800; font-size: 0.88rem; text-decoration: none; background: var(--bg); }
.d-actions .primary { background: var(--mint); color: #fff; }
.d-actions .is-disabled { opacity: 0.4; pointer-events: none; }
.d-actions span { font-size: 1.3rem; }

.info { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 0.88rem; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.info dt { color: var(--text-sub); white-space: nowrap; }
.info dd { font-weight: 600; word-break: break-all; }
.d-note { font-size: 0.75rem; color: var(--text-sub); margin-top: 10px; line-height: 1.5; }

/* 상담 요청 */
.consult { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--mint-soft); }
.consult h3 { font-size: 1rem; margin-bottom: 4px; }
.consult > p { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 12px; }
.consult label { display: block; font-size: 0.8rem; font-weight: 700; margin: 10px 0 6px; }
.consult select, .consult textarea { width: 100%; font: inherit; font-size: 0.9rem; padding: 10px 12px; border-radius: 12px; border: 1px solid #cfe9e0; background: #fff; color: var(--text); }
.consult textarea { resize: vertical; min-height: 64px; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchips button { padding: 7px 10px; border-radius: 10px; background: #fff; font-size: 0.8rem; font-weight: 600; border: 1.5px solid #cfe9e0; }
.qchips button[aria-pressed='true'] { border-color: var(--mint-deep); color: var(--mint-deep); background: #f3fbf8; }
.script { margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff; font-size: 0.85rem; white-space: pre-wrap; border: 1px dashed #b9dfd2; }
.consult-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.consult-actions a, .consult-actions button { padding: 12px; border-radius: 12px; font-weight: 800; font-size: 0.88rem; text-align: center; text-decoration: none; background: #fff; }
.consult-actions .primary { background: var(--mint-deep); color: #fff; }

/* 스폰서 상세 */
.sp-hero { padding: 16px; border-radius: 18px; background: linear-gradient(150deg, #fff3d6, #ffe0a3); }
.sp-hero .ad-label { background: rgba(255, 255, 255, 0.7); }
.sp-hero h2 { font-size: 1.2rem; margin: 8px 0 4px; }
.sp-hero p { font-size: 0.88rem; color: #6a4a10; }
.coupon { margin-top: 14px; border: 2px dashed var(--amber); border-radius: 16px; padding: 16px; text-align: center; background: #fffaf0; }
.coupon b { display: block; font-size: 1.05rem; }
.coupon code { display: inline-block; margin-top: 10px; padding: 8px 14px; border-radius: 10px; background: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.08em; filter: blur(5px); transition: filter 0.3s; user-select: none; }
.coupon.revealed code { filter: none; user-select: all; }
.coupon button { margin-top: 12px; width: 100%; padding: 12px; border-radius: 12px; background: var(--amber); color: #fff; font-weight: 800; }

.toast { position: fixed; left: 50%; top: calc(120px + env(safe-area-inset-top)); transform: translate(-50%, -10px); z-index: 60; background: var(--text); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 0.86rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading-map { position: fixed; inset: 0; display: grid; place-items: center; color: var(--text-sub); font-size: 0.9rem; z-index: 1; pointer-events: none; }

@media (min-width: 900px) {
  :root { --sheet-h: 82vh; }
  .sheet { left: 16px; right: auto; width: 400px; bottom: 16px; border-radius: 22px; margin: 0; transform: none !important; height: calc(100vh - 150px); }
  .top { margin: 0; left: 16px; right: auto; width: 400px; }
  .fabs { bottom: 24px; right: 24px; }
  body.sheet-open .fabs, body.sheet-detail .fabs { opacity: 1; pointer-events: auto; transform: none; }
  .sheet-grip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.list-empty small { font-size: 0.78rem; }
.list-subhead { font-size: 0.8rem; font-weight: 800; color: var(--text-sub); padding: 12px 2px 0; }

/* 모바일: 센터 상세 창이 열리면 지도가 더 보이도록 창 높이를 줄임 (데스크톱은 기존 그대로) */
@media (max-width: 899px) {
  body.sheet-detail .sheet { height: 52vh; }
}

/* 상단 제작자 표기와 소개 한 줄 (검색창 위) */
.maker { text-align: center; margin: 0 0 6px; font-size: 12px; line-height: 1.4; }
.maker-intro { margin: 0; color: var(--text-sub, #5d6b66); }
.maker-link { color: var(--primary, #1f7a5c); font-weight: 700; text-decoration: none; }
.maker-link:hover { text-decoration: underline; }

/* 목록 아래 제작자 표기 (여백 영역) */
.maker-foot { margin: 18px 0 8px; padding: 14px 12px; border-top: 1px solid rgba(0, 0, 0, 0.06); font-size: 13px; }
.maker-foot .maker-intro { margin-bottom: 6px; font-size: 13px; line-height: 1.6; }
