:root {
  --bg: #f7f1e9;
  --surface: #ffffff;
  --surface-2: #f5eee4;
  --text: #2a1e15;
  --muted: #7c6a5b;
  --border: #eadfd1;
  --primary: #7a4a2a;
  --primary-ink: #ffffff;
  --primary-soft: #f4e8dc;
  --owner: #c98a12;
  --owner-soft: #fdf2d6;
  --good: #2f7d4f;
  --good-soft: #e3f2e8;
  --bad: #b4432f;
  --bad-soft: #f8e4df;
  --tier-1: #a0622d; /* 도장 단계 색: 동 · 은 · 금 · 루비 · 다이아 (stamps.js) */
  --tier-2: #6f7f8f;
  --tier-3: #c08a10;
  --tier-4: #b3264f;
  --tier-5: #1f8bb0;
  --shadow: 0 6px 24px rgba(43, 33, 24, 0.12);
  --radius: 12px;
  --topbar-h: 56px;
  --panel-w: 400px;
  --detail-w: 400px;
  color-scheme: light;
}

/* 나이트 모드. data-theme 은 js/theme-init.js 가 화면을 그리기 전에 정한다 (고른 적 없으면 기기 설정을 따른다) */
:root[data-theme="dark"] {
  --bg: #1c1814;
  --surface: #26211c;
  --surface-2: #2f2923;
  --text: #f1eae0;
  --muted: #a99a8a;
  --border: #3a322b;
  --primary: #d9a26b;
  --primary-ink: #1c1814;
  --primary-soft: #3a2d22;
  --owner: #e8b54a;
  --owner-soft: #3a3020;
  --good: #6cc38f;
  --good-soft: #1f3327;
  --bad: #e58a78;
  --bad-soft: #3a2420;
  --tier-1: #d39a64;
  --tier-2: #b4c0cc;
  --tier-3: #e8b54a;
  --tier-4: #ef7a9b;
  --tier-5: #6cc7e8;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS Safari 는 글자가 16px 보다 작은 입력칸을 누르면 화면을 확대한다 (본문 15px 을 물려받아 검색창을 누를 때마다 확대됐다).
   터치 기기에서는 입력칸만 16px 로 둔다. 확대 자체를 막는 maximum-scale=1 은 손가락으로 키워 보기도 막아 쓰지 않는다 */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--primary); }

/* ---------- 상단 바 ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex-shrink: 0; }
/* 앱 아이콘 (web/img/icon). 그림에 둥근 모서리가 들어 있다 */
.brand-mark { width: 32px; height: 32px; display: block; object-fit: contain; flex: none; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input {
  width: 100%; height: 38px; padding: 0 44px 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); outline: none;
}
.search input:focus { border-color: var(--primary); background: var(--surface); }
.search-btn {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink); display: grid; place-items: center;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 380px); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 60; padding: 4px 0; overscroll-behavior: contain;
}
.sr-group h4 { margin: 0; padding: 10px 14px 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.sr-item {
  display: grid; gap: 2px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; color: var(--text);
}
.sr-item:hover, .sr-item:focus-visible { background: var(--surface-2); outline: none; }
.sr-name { font-weight: 700; font-size: 14.5px; }
.sr-branch { font-weight: 500; color: var(--muted); }
.sr-sub { font-size: 12.5px; color: var(--muted); }
.sr-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--owner-soft); color: var(--owner); vertical-align: 1px;
}
.sr-empty { padding: 14px; font-size: 13.5px; color: var(--muted); }
.sr-notice { margin: 6px 14px; font-size: 12px; color: var(--owner); font-weight: 600; }
.sr-foot { margin: 6px 14px 4px; font-size: 11px; color: var(--muted); }
.account { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.account .who {
  font-weight: 600; font-size: 14px; border: 0; background: none; padding: 4px 6px; border-radius: 8px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account .who:hover { background: var(--surface-2); color: var(--primary); }
.badge-owner {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px;
  background: var(--owner-soft); color: var(--owner); font-size: 12px; font-weight: 700;
}
/* 👑 왕관은 글자보다 낮아 보여서 2px 올린다 (dom.js 의 crown()) */
.crown { position: relative; top: -2px; }

/* ---------- 버튼 ---------- */
.btn {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--bad); }
.btn-solid-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-solid-danger:hover { background: var(--bad); filter: brightness(1.08); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; height: calc(100% - var(--topbar-h)); position: relative; }
.panel {
  width: var(--panel-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; position: relative; z-index: 10;
}
.panel-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panel-grip { display: none; }
.map-wrap { flex: 1; position: relative; min-width: 0; isolation: isolate; } /* 마커가 목록 패널 위로 올라오지 않게 */
/* MapLibre 의 .maplibregl-map { position: relative } 보다 우선하도록 선택자를 구체적으로 둔다 */
.map-wrap > .map { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); } /* 지도 버튼·안내가 마커 위에 오도록 */
.map-inner { width: 100%; height: 100%; } /* 지도 엔진이 그리는 요소. 엔진이 넣는 position 스타일과 상관없이 크기를 채운다 */

/* ---------- 탭 ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 8px; flex-shrink: 0; }
.tab {
  flex: 1; height: 46px; border: 0; background: none; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
/* 카공 유형 테스트(/test)로 가는 메뉴: 탭 줄 맨 오른쪽의 링크 */
.tab-link { display: grid; place-items: center; text-decoration: none; white-space: nowrap; color: var(--primary); }
.tab-link:hover { background: var(--surface-2); }
.tab-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tab-panel { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

/* ---------- 필터 ---------- */
/* 검색필터: 목록과 구분되게 테두리 있는 흰 상자로 띄우고, 맨 위에 옅은 갈색 제목 띠를 둔다 */
.filters {
  margin: 10px 10px 4px; padding: 0 12px 8px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 14px;
  background: var(--surface); display: grid; gap: 8px; overflow: hidden;
}
.filters-head {
  display: flex; align-items: center; gap: 8px; margin: 0 -12px 2px; padding: 8px 12px;
  background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
}
.filters-title { margin: 0; font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.filters-title svg { flex: none; color: var(--primary); }
.filters-count { font-size: 12px; font-weight: 700; color: var(--primary); }
.filters-head .spacer { flex: 1; }
/* 휴대폰: 제목을 눌러 접고 편다. 접으면 제목 띠만 남는다 */
.filters-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; font: inherit; color: inherit; }
.filters-toggle svg { flex: none; color: var(--primary); }
.filters-caret { font-size: 12px; color: var(--muted); }
.filters.is-collapsed { padding-bottom: 0; }
.filters.is-collapsed .filters-head { margin-bottom: 0; border-bottom: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* 보기 방식 전환: 주변 카페 모두 / 리뷰된 카페만 (상단 검색창 오른쪽) */
.view-scope { display: flex; flex-shrink: 0; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.view-scope button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.view-scope button:hover { color: var(--text); background: var(--surface-2); }
/* 고른 쪽을 확실히: 갈색 바탕 + 흰 글씨 */
.view-scope button[aria-checked="true"] { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.view-scope .scope-short { display: none; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--muted); width: 54px; flex-shrink: 0; }
/* 주차 중분류 줄: 대분류 줄 아래에 들여서 딸린 줄로 보이게 */
.filter-sub { padding-left: 14px; }
.filter-sub .filter-label { width: 54px; font-weight: 600; }
/* 카공·커피 별점 고르기: 칩 모양 안에 별 다섯 개. 누른 별까지 노랗게 ("★N 이상") */
.star-filter {
  height: 30px; padding: 0 10px 0 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text);
}
.star-filter.is-on { border-color: #e8a400; background: color-mix(in srgb, #e8a400 10%, var(--surface)); }
.star-filter-stars { display: inline-flex; }
.star-btn { border: 0; background: none; padding: 0 1px; font-size: 15px; line-height: 1; color: var(--border); cursor: pointer; }
.star-btn.on { color: #e8a400; }
/* 마우스를 올린 별까지 미리 노랗게 */
.star-filter-stars:hover .star-btn { color: #e8a400; }
.star-filter-stars .star-btn:hover ~ .star-btn { color: var(--border); }
.star-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 4px; }
.star-filter-hint { font-size: 12px; color: var(--muted); }
.chip {
  height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip.chip-owner[aria-pressed="true"] { background: var(--owner); border-color: var(--owner); color: #fff; }
.filters-more { justify-self: start; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 2px 0; }
.filters-reset { border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 600; padding: 2px 0; }
.filter-foot { display: flex; justify-content: space-between; align-items: center; }

/* ---------- 목록 ---------- */
.list-status { padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); }
.list-status:empty { display: none; } /* 카페 수는 지도 왼쪽 아래(.map-count)에 보인다 */
.list-status strong { color: var(--text); }
.list-status.warn { background: var(--owner-soft); color: var(--text); }
.cafe-list, .reviewed-list, .review-list { list-style: none; margin: 0; padding: 0; }
/* 지도 속 카페·운영자 리뷰 목록: 카페마다 테두리 있는 카드로 띄워 서로 구분되게 한다 */
.cafe-list, .reviewed-list { padding: 8px 10px 10px; display: grid; gap: 8px; }
.cafe-item {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.06); cursor: pointer; display: grid; gap: 4px;
}
.cafe-item:hover { background: var(--surface-2); border-color: var(--muted); }
.cafe-item.is-active { background: var(--surface-2); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
/* 목록 카드의 사진: 최근 3장을 작게 */
/* 3칸이 카드 너비를 채운다. 칸은 정사각형(1:1)이고, 사진은 늘리지 않고 가운데를 맞춰 넘치는 부분만 가린다 */
.cafe-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.cafe-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.cafe-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cafe-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-weight: 700; }
.cafe-title .branch { font-weight: 500; color: var(--muted); font-size: 13px; }
/* 목록: 카페 이름 오른쪽의 운영자 정보 (👑 운영자 추천, 추천을 켜지 않았으면 👑 만) */
.owner-info { align-self: center; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.owner-info .study-pick { padding: 1px 8px; font-weight: 700; white-space: nowrap; }
/* 목록 둘째 줄: 평균 카공·커피 별점(노란색)과 리뷰 수 */
.cafe-avgs { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.cafe-avgs b { color: #e8a400; }
.cafe-sub { font-size: 12.5px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 600;
}
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.owner { background: var(--owner-soft); color: var(--owner); }
/* 목록 카드의 태그는 색을 빼서 차분하게 보여 준다 */
.cafe-item .tags .tag { background: var(--surface-2); color: var(--muted); }
/* 마우스를 올리거나 고른 줄은 배경이 --surface-2 라 태그가 묻히므로 태그를 밝게 뒤집는다 */
.cafe-item:hover .tags .tag, .cafe-item.is-active .tags .tag { background: var(--surface); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-hint { margin: 10px 0 0; font-size: 12.5px; }

/* ---------- 상세 ---------- */
.detail { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
/* 카페 상세 머리말(이름·주소·버튼): 운영자 리뷰와 카공 정보가 빨리 보이도록 얇게 */
.detail-head { padding: 10px 16px 10px; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.back { justify-self: start; border: 0; background: none; color: var(--muted); font-weight: 600; padding: 4px 0; font-size: 14px; }
.detail-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; line-height: 1.3; }
.detail-head h2 .branch { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 4px; }
/* 카페 이름 오른쪽 끝: 공유 · 네이버지도보기 · 잘못된 정보 알리기(⋯). 아이콘만 둔다 */
.detail-title { display: flex; align-items: center; gap: 6px; }
.detail-title h2 { min-width: 0; flex: 1; }
.head-icon { flex: none; width: 36px; padding: 0; justify-content: center; font-size: 16px; color: var(--muted); }
.head-icon:hover { color: var(--primary); border-color: var(--primary); }
.head-icon .naver-map-icon { margin-left: 0; }
.more-menu { position: relative; flex: none; }
.more-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; min-width: 200px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(43, 33, 24, 0.18);
}
.more-pop[hidden] { display: none; }
.more-pop-title { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.more-pop button { border: 0; background: none; padding: 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--text); text-align: left; white-space: nowrap; cursor: pointer; }
.more-pop button:hover { background: var(--surface-2); }
/* 리뷰 쓰기 · 카공 시작을 절반씩 한 줄에 */
.detail-actions { display: flex; gap: 6px; margin-top: 4px; }
.detail-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; height: 36px; padding: 0 12px; font-size: 13.5px; }
.section { padding: 16px; border-bottom: 1px solid var(--border); }
.section h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.section h3 .count { color: var(--muted); font-weight: 600; font-size: 13px; }
.section h3 .spacer { flex: 1; }
/* 카공 정보: 3칸씩 촘촘하게 */
/* 카공 정보: 별점 한 줄 + '이름 값' 한 줄짜리 작은 칸들 (높이를 줄이려고 값이 없는 항목은 빼고 줄바꿈으로 채운다).
   관리 화면도 .stat 을 쓰므로(admin.css) 여기 규칙은 .stats 안으로 좁힌다 */
.stats-section h3 { margin-bottom: 6px; }
.stat-scores { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.stat-score { white-space: nowrap; }
.stats { display: flex; flex-wrap: wrap; gap: 5px; }
.stats .stat {
  position: relative; display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border: 0; border-radius: 8px;
  background: var(--surface-2); font-size: 12.5px; line-height: 1.5; text-align: left; max-width: 100%;
}
.stats .stat-label { color: var(--muted); font-weight: 600; white-space: nowrap; }
.stats .stat-value { font-weight: 700; word-break: keep-all; overflow-wrap: break-word; }
.stats .stat-value.good { color: var(--good); }
.stats .stat-value.bad { color: var(--bad); }
/* 추가 정보가 있는 칸: ⓘ 표시. 마우스를 올리거나(:hover), 키보드로 가거나(:focus-visible), 누르면(.is-open) 말풍선이 뜬다 */
.stat.has-more { cursor: pointer; }
.stat-more { color: var(--muted); font-size: 12px; }
.stat-pop {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; width: max-content; max-width: min(280px, 78vw);
  padding: 9px 12px; border-radius: 10px; background: var(--text); color: var(--surface); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 500; line-height: 1.5; white-space: normal; word-break: keep-all;
}
.stat.pop-right .stat-pop { left: auto; right: 0; }
/* 말풍선을 연 칸은 옆 칸들보다 위에 그린다. 칸마다 마우스를 올리면 움직이는 효과(theme.css)가 있어
   각자 그리는 층이 생기므로, 그대로 두면 뒤에 오는 칸이 말풍선을 덮는다 */
.stats .stat.has-more:hover, .stats .stat.has-more:focus-visible, .stats .stat.has-more.is-open { z-index: 10; }
/* 칸 아래 보이는 자리가 모자라면 말풍선을 칸 위로 띄운다 (detail.js 가 pop-up 을 붙인다) */
.stat.pop-up .stat-pop { top: auto; bottom: calc(100% + 6px); }
/* 크기를 재는 동안만 보이지 않게 펼친다 */
.stat.is-measuring .stat-pop { display: grid; visibility: hidden; animation: none; }
.stat.has-more:hover .stat-pop, .stat.has-more:focus-visible .stat-pop, .stat.has-more.is-open .stat-pop { display: grid; gap: 2px; }
.stat-pop strong { font-weight: 700; }
.stat-pop strong:not(:first-child) { margin-top: 6px; }
.stats-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.detail-close { display: none; }

/* 넓은 화면(1100px 이상): 네이버 지도처럼 목록은 그대로 두고 그 오른쪽에 상세 패널을 펼쳐 지도 위에 띄운다.
   목록 + 상세를 펼쳐도 지도가 300px 이상 남는 폭이다. 이보다 좁으면 상세가 목록 자리를 대신한다. */
@media (max-width: 1099px) {
  .panel.has-detail > #view-home { display: none; }
}
@media (min-width: 1100px) {
  /* 목록과 붙지 않게 띄운 둥근 카드로 보여 준다 (목록과 한눈에 구분되게) */
  .layout { --detail-gap: 10px; --detail-edge: calc(var(--detail-w) + var(--detail-gap) * 2); }
  .panel > #view-detail {
    position: absolute; top: var(--detail-gap); bottom: var(--detail-gap); left: calc(100% + var(--detail-gap)); width: var(--detail-w);
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 32px rgba(43, 33, 24, 0.2), 0 2px 6px rgba(43, 33, 24, 0.08);
    animation: detail-in 0.18s ease-out;
  }
  .panel > #view-detail .back { display: none; }
  .detail-close {
    display: grid; place-items: center; position: absolute; top: 8px; right: 8px; z-index: 1;
    width: 36px; height: 36px; border: 0; border-radius: 50%; background: none;
    color: var(--muted); font-size: 26px; line-height: 1;
  }
  .detail-close:hover { background: var(--surface-2); color: var(--text); }
  .detail-close:focus-visible { outline: 2px solid var(--primary); }
  .panel > #view-detail .detail-head { padding-top: 12px; padding-right: 52px; } /* 닫기 버튼 자리 */
  /* 상세 패널이 지도 왼쪽을 덮는 동안 지도 출처 표시가 가려지지 않게 보이는 폭 안에서 줄바꿈한다 */
  .layout:has(.panel.has-detail) .maplibregl-ctrl-bottom-right { max-width: calc(100% - var(--detail-edge) - 16px); }
  /* 상세 패널에 가려지지 않은 지도 영역의 가운데에 둔다 */
  .layout:has(.panel.has-detail) .map-search-btn { left: calc(var(--detail-edge) + (100% - var(--detail-edge)) / 2); }
  /* 데이터 출처 안내와 축척도 상세 패널 뒤로 숨지 않게 옮긴다 */
  .layout:has(.panel.has-detail) .map-notice, .layout:has(.panel.has-detail) .map-scale, .layout:has(.panel.has-detail) .map-count { left: calc(var(--detail-edge) + 8px); }
}
@keyframes detail-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .panel > #view-detail, .map-search-btn { animation: none; }
}

.study-pick { background: var(--good-soft); color: var(--good); border-radius: 999px; padding: 2px 10px; }
.study-pick-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; flex-wrap: wrap; }
.study-pick-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.study-pick-check .field-hint { font-weight: 500; }
.owner-fields-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.meta-line { font-size: 12px; color: var(--muted); }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 0; padding: 0; background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 사진 순서 바꾸기: 끄는 동안 화면이 밀리지 않게 하고, 끄는 사진을 흐리게 */
.photos.reordering .photo { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: 2px dashed var(--border); outline-offset: -2px; }
.photos.reordering .photo:focus-visible { outline: 2px solid var(--primary); }
.photos.reordering .photo.dragging { cursor: grabbing; opacity: 0.5; outline: 2px solid var(--primary); }
.photos.reordering .photo.fixed { cursor: default; opacity: 0.35; outline: none; } /* 회원에게 다른 사람 사진: 옮길 수 없다 */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.review { padding: 12px 0; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.review-head .nick { font-weight: 700; }
.nick-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.nick-link:hover { color: var(--primary); text-decoration: underline; }
.review-head .study-pick { padding: 1px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.review-head .date { color: var(--muted); margin-left: auto; }
.review .text { margin: 0; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; } /* 리뷰 글: 쓴 사람이 나눈 줄 그대로 */
.stars { color: var(--owner); letter-spacing: 1px; white-space: nowrap; }
.stars .star-off { color: var(--border); } /* 빈 별: 채운 별과 확실히 구분되게 흐린 색 */
/* 커피맛 별점 칩: 고르면 바탕(갈색)과 별(금색)이 겹쳐 안 보이므로 별을 바탕과 대비되는 색으로 */
.chip-stars[aria-pressed="true"] .stars { color: var(--primary-ink); }
/* 리뷰 창 커피맛: 별점 다섯 개 뒤의 '모름'까지 한 줄에 들어가게 칩을 좁힌다 (넓은 화면의 두 칸 배치) */
.review-form .field-inline .options:has(.chip-stars) { gap: 4px; }
.review-form .field-inline .chip-stars { padding: 0 7px; }
.review-form .field-inline .chip-stars .stars { letter-spacing: -1px; }
/* 종합 카공 별점: 리뷰 창 오른쪽 아래에 조금 크게, 다른 항목과 다른 금색 상자로 */
.review-form .rating-field {
  margin-top: 4px; padding: 10px 12px; border-radius: 12px;
  background: var(--owner-soft); border: 1px solid color-mix(in srgb, var(--owner) 45%, transparent);
}
.review-form .rating-field .chip { background: var(--surface); border-color: color-mix(in srgb, var(--owner) 35%, var(--border)); }
.review-form .rating-field .chip[aria-pressed="true"] { background: var(--owner); border-color: var(--owner); }
@media (min-width: 1100px) {
  body.is-picking-location .panel > #view-detail { visibility: hidden; } /* 위치를 고르는 동안 상세 카드가 지도 가운데를 가리지 않게 */
}
.review-form .parking-sub .field-label { white-space: nowrap; } /* 주차장 아래 줄 제목 (요금·대신 주차·무료 시간·주차 메모) */
.review-form .parking-amount { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.review-form .parking-amount input { margin: 0; accent-color: var(--primary); }
.review-form .chip:disabled { opacity: 0.45; cursor: default; }
.review-form .rating-field .field-label { font-size: 13.5px; color: var(--owner); }
.review-form .rating-field .chip { height: 32px; font-size: 14px; }
/* 모든 항목을 고르기 전에는 종합 카공 별점을 잠가 둔다 */
.review-form .rating-field.is-locked .chip { opacity: 0.4; cursor: not-allowed; }
.rating-hint { margin: 0; font-size: 12px; color: var(--muted); }
.rating-hint:empty { display: none; }
.rating-hint.is-ready { color: var(--owner); font-weight: 700; }
.rating-hint.is-warn { color: var(--bad); font-weight: 700; }

/* ---------- 최근 리뷰 카페 탭 ---------- */
.reviewed-intro {
  margin: 0; padding: 12px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
}
.reviewed-back { font-size: 13px; }
.reviewed-who { color: var(--text); font-weight: 700; }
.reviewed-intro .grow { flex: 1 1 200px; }
/* ---------- 나이대 추천 탭 ---------- */
.picks-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.picks-intro { margin: 0; font-size: 13px; color: var(--muted); }
.picks-intro b { color: var(--text); white-space: nowrap; }
.picks-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.picks-chips .chip { height: 28px; font-size: 12.5px; padding: 0 10px; }
.pick-rank { font-size: 12.5px; font-weight: 700; color: var(--primary); margin-top: 2px; }
/* 작성자 북마크: 누르면 금색 별 */
.bookmark-btn[aria-pressed="true"] { border-color: var(--owner); color: var(--owner); background: var(--owner-soft); }
.bookmark-list-btn { white-space: nowrap; }
.modal-bookmarks { max-width: 440px; }
.bookmark-list { list-style: none; margin: 0; padding: 0; display: grid; }
.bookmark-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.bookmark-item:last-child { border-bottom: 0; }
.bookmark-who { font-weight: 700; font-size: 14.5px; color: var(--text); }
.bookmark-meta { font-size: 12.5px; color: var(--muted); }
.bookmark-item .x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 6px; cursor: pointer; }
.bookmark-item .x:hover { color: var(--bad); }
.bookmark-list .empty { padding: 14px 2px; color: var(--muted); font-size: 13.5px; }
/* 카드는 지도 속 카페 목록과 같다 (.cafe-item). 쓴 사람 줄과 리뷰 글(두 줄까지)를 이름 아래에 둔다 */
.reviewer-line { font-size: 12.5px; color: var(--muted); }
.reviewer-link { font-size: 12.5px; }
.excerpt {
  margin: 0; font-size: 13.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 지도 위 요소 ---------- */
.map-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}
.map-banner.info { background: var(--surface); color: var(--text); }
/* 지도를 움직이면 아래쪽 가운데에 뜨는 "현 지도에서 검색" 버튼 */
.map-search-btn {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 22px 0 18px;
  border: 0; border-radius: 999px; background: #1565d8; color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(21, 101, 216, 0.35), 0 2px 6px rgba(0, 0, 0, 0.18);
  animation: search-btn-in 0.18s ease-out;
}
.map-search-btn:hover { background: #0f57c2; }
.map-search-btn:active { transform: translateX(-50%) scale(0.97); }
.map-search-btn:focus-visible { outline: 3px solid #9cc2ff; outline-offset: 2px; }
.map-search-btn svg { flex-shrink: 0; }
.map-search-btn:disabled {
  background: #4a4d52; font-size: 14px; font-weight: 700; cursor: default;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.map-search-btn:disabled svg { display: none; }
@keyframes search-btn-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.map-fab {
  position: absolute; right: 10px; bottom: 44px; z-index: 5; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
/* 미등록 카페 등록: 내 위치 버튼 왼쪽 */
.map-fab-add { right: 62px; width: auto; padding: 0 14px 0 11px; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.map-fab-add:hover { border-color: var(--primary); color: var(--primary); }
/* 화이트/나이트 모드: 내 위치 버튼 위 (지도 화면만. 관리 화면은 상단 바의 것) */
.map-fab.map-fab-theme { bottom: 96px; width: 44px; padding: 0; color: var(--text); } /* 내 위치 버튼(bottom 44px, 높이 44px) 위. 폭은 상단 바용 .theme-btn 을 덮는다 */
/* 확대·축소: 화이트/나이트 버튼 위에 내 위치 버튼과 같은 모양으로 (지도 엔진의 기본 확대 버튼은 끈다) */
.map-fab-zoom-out { bottom: 148px; }
.map-fab-zoom-in { bottom: 200px; }
.map-fab:hover { border-color: var(--primary); color: var(--primary); }
.map-wrap.is-picking .map-fab-add { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.map-wrap.is-picking .map-search-btn { display: none; }
/* 위치 고르기: 지도 가운데 고정 핀 + 아래쪽 안내 */
/* 카페 핀(갈색·금색)·검색 장소 핀(빨강)과 겹치지 않는 선명한 주황. 고르는 동안 다른 핀은 흐리게 한다 */
.pick-pin {
  --pick: #ff5a00;
  position: absolute; left: 50%; top: 50%; z-index: 6; pointer-events: none; transform: translate(-50%, -100%);
  display: grid; justify-items: center; animation: pick-drop 0.3s ease-out;
}
.pick-pin::after { content: ""; width: 4px; height: 22px; background: var(--pick); border-radius: 0 0 2px 2px; box-shadow: 0 0 0 1.5px #fff; }
.pick-pin-head {
  width: 46px; height: 46px; border-radius: 50%; background: var(--pick); border: 4px solid #fff; display: grid; place-items: center;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.pick-pin-head::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.pick-pin-spot {
  position: absolute; left: 50%; bottom: 0; width: 12px; height: 12px; transform: translate(-50%, 50%); border-radius: 50%;
  background: var(--pick); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.pick-pin-spot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 3px solid var(--pick);
  animation: pick-pulse 1.4s ease-out infinite;
}
@keyframes pick-drop { from { transform: translate(-50%, -150%); opacity: 0; } }
@keyframes pick-pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pick-pin, .pick-pin-spot::after { animation: none; } }
.map-wrap.is-picking .pin-wrap { opacity: 0.45; }
.pick-bar {
  position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 7; width: min(420px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px;
  display: grid; gap: 4px; font-size: 14px;
}
.pick-bar span { color: var(--muted); font-size: 13px; }
.pick-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.modal-add-cafe { max-width: 440px; }
.add-cafe-form { display: grid; gap: 12px; }
.add-cafe-form .field input:disabled { background: color-mix(in srgb, var(--border) 55%, var(--surface)); border-style: dashed; color: var(--muted); cursor: not-allowed; }
.naver-find { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-naver-find { border-color: #03c75a; color: #03a14a; font-weight: 700; flex: none; }
.btn-naver-find:not(:disabled):hover { background: #03c75a; color: #fff; }
.naver-find .field-hint { flex: 1; min-width: 180px; }
/* 링크 복사 방법 안내 (항상 펼침). 그림은 web/img 의 네이버 지도 캡처, 없으면 비슷한 모양을 그린다 */
.naver-guide { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 6px; }
.naver-guide-title { font-size: 13px; color: var(--muted); }
.naver-guide ol { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.guide-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
@media (max-width: 420px) { .guide-figs { grid-template-columns: 1fr; } }
.guide-fig { margin: 0; display: grid; grid-template-rows: 1fr auto; gap: 4px; }
.guide-fig figcaption { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.guide-pic { position: relative; }
.guide-pic img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; }
/* 캡처 속에서 누를 버튼 자리. copy: 공유하기 창 오른쪽 아래 "복사" */
.guide-mark { position: absolute; border: 3px solid #ff5a00; border-radius: 8px; box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.25); pointer-events: none; }
.guide-mark.copy { left: 80%; top: 82%; width: 18%; height: 16%; }
.guide-mock {
  min-height: 100%; display: grid; gap: 8px; align-content: center; justify-items: center; padding: 12px 10px;
  background: #fff; color: #222; border: 1px solid var(--border); border-radius: 10px; font-size: 12px;
}
.guide-mock .is-target { outline: 3px solid #ff5a00; outline-offset: 1px; border-radius: 6px; }
.place-mock-sub { color: #777; font-size: 11px; }
.place-mock-actions { display: flex; gap: 8px; }
.place-mock-actions span { display: grid; justify-items: center; gap: 2px; padding: 3px 4px; font-size: 11px; color: #444; }
.place-mock-actions i { font-style: normal; font-size: 15px; line-height: 1; }
.share-mock-row { width: 100%; display: flex; border: 1px solid #ddd; border-radius: 8px; font-size: 11.5px; }
.share-mock-url { flex: 1; min-width: 0; padding: 7px 8px; color: #1a5fd0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-mock-copy { padding: 7px 10px; background: #f3f3f3; border-left: 1px solid #ddd; font-weight: 700; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.user-cafe-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.removal-pending { color: var(--owner); font-weight: 700; }
.map-notice {
  position: absolute; left: 8px; bottom: 3px; margin: 0; z-index: 5; font-size: 11px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 8px; border-radius: 6px;
  white-space: nowrap; /* 한 줄로. 오른쪽 아래 네이버 로고·저작권 표시와 같은 줄에 둔다 */
}
/* 축척: 지도 아래 출처 안내 바로 위 */
.map-scale {
  position: absolute; left: 8px; bottom: 28px; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 6px 4px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.2;
}
.map-scale[hidden] { display: none; }
/* 검색한 지도 영역의 카페 수 'N개 검색됨': 지도 왼쪽 아래, 축척 위 */
.map-count {
  position: absolute; left: 8px; bottom: 66px; z-index: 5; pointer-events: none;
  background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--text); box-shadow: var(--shadow);
}
.map-count[hidden] { display: none; }
.map-scale-bar { height: 5px; border: 2px solid currentColor; border-top: 0; box-sizing: border-box; transition: width 0.15s; }
@media (max-width: 767px) { .map-scale { display: none; } }
.map-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; padding: 24px;
  color: var(--muted); font-size: 14px;
}
.map-fallback strong { color: var(--text); font-size: 16px; }
.map-fallback code { background: var(--surface); padding: 1px 6px; border-radius: 4px; }

/* 지도 마커 (네이버 지도 HTML 마커 안에 들어간다) */
.pin {
  --pin: #8a7b6d;
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pin); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: grid; place-items: center; cursor: pointer; transition: transform 0.1s;
}
.pin > span { transform: rotate(45deg); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.pin.place { --pin: #d93025; width: 30px; height: 30px; } /* 검색으로 찾은 장소 */
/* 카페 핀 (cupIcon.js): 받침 위 커피잔. 아래 가운데 끝이 카페 위치. 리뷰 없는 카페는 작게, 고른 카페는 크게 */
.pin-wrap.cup-wrap { width: 34px; height: 40px; }
.cup-pin { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; transition: transform 0.12s; }
.cup-pin.none { transform: scale(0.8); }
.pin-wrap:hover .cup-pin { transform: scale(1.12); }
.pin-wrap:hover .cup-pin.none { transform: scale(0.9); }
.cup-pin.selected, .pin-wrap:hover .cup-pin.selected { transform: scale(1.3); }
.cup-svg { display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.32)); }
/* 잔 오른쪽 위 칩: 리뷰 수, 내 리뷰는 ✓ */
.cup-badge {
  position: absolute; top: -2px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #fff; color: #6b4226; font-size: 10.5px; font-weight: 800; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.cup-badge.mine { background: #d9980f; color: #fff; border: 1.5px solid #fff; }
.pin-wrap.cup-wrap .pin-label { top: -38px; } /* 크게 그린 고른 핀과 김 위로 */
/* 겹친 카페 묶음 (map.js): 끝 없는 큰 커피잔 + 카페 수. 색과 김은 묶음 안에서 가장 높은 상태를 따른다: 내 리뷰(노랑) > 리뷰 있음(갈색) > 나머지(회색) */
.pin-wrap.cluster-wrap { width: 48px; height: 48px; display: grid; place-items: center; }
.cluster-wrap .cup-svg { transition: transform 0.12s; }
.cluster-wrap:hover .cup-svg { transform: scale(1.1); }
/* 겹친 자리의 카페 목록 (map.js showSpotList): 묶음 위에 띄우는 작은 창 */
.spot-list {
  position: absolute; z-index: 8; width: min(280px, calc(100% - 16px)); max-height: min(320px, calc(100% - 16px)); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.2));
}
.spot-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 8px 7px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 13px; }
.spot-head .x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }
.spot-list ul { list-style: none; margin: 0; padding: 4px 0; }
.spot-item { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 12px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.spot-item:hover, .spot-item:focus-visible { background: var(--surface-2); outline: none; }
.spot-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-name .branch { margin-left: 4px; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.spot-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.spot-dot { width: 10px; height: 10px; border-radius: 50%; background: #8a7b6d; }
.spot-dot.reviewed { background: #7a4a2a; }
.spot-dot.mine { background: #d9980f; }
.spot-dot.gold { background: #d9980f; } /* 로그인 전: 리뷰 있는 카페 */
/* 지도 버튼·출처 표시가 카페 핀(z-index 10~200)에 가리지 않게 */
.maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { z-index: 300; }
/* 마커 바깥 요소. MapLibre 는 이 요소를 position: absolute 로 배치하므로 CSS 로 position 을 주지 않는다.
   (네이버 엔진은 요소에 직접 relative 를 준다. 이름표는 이 요소를 기준으로 놓인다) */
.pin-wrap { width: 26px; height: 26px; cursor: pointer; }
.me-dot {
  width: 16px; height: 16px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.25), 0 1px 4px rgba(0, 0, 0, 0.35);
}
.pin-label {
  position: absolute; left: 50%; top: -30px; transform: translateX(-50%); white-space: nowrap;
  background: #2b2118; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  pointer-events: none;
}

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 14, 8, 0.5); z-index: 100;
  display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; padding: 16px 18px 8px; gap: 8px; }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; }
.modal-title-note { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.modal-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; display: grid; gap: 16px; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
.modal-foot { padding: 12px 18px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.modal-foot .grow { flex: 1; }
/* PC 카페 공유 창 (js/share.js): 카카오톡으로 보내기 · 주소와 링크 복사 · 다른 앱으로 */
.share-modal { max-width: 400px; }
.share-sheet { display: grid; gap: 12px; padding-bottom: 4px; }
.share-copy { display: flex; gap: 8px; }
.share-url { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface); color: var(--muted); outline: none; }
.share-url:focus { border-color: var(--primary); color: var(--text); }
.share-more { justify-self: center; font-size: 14px; color: var(--muted); }
/* 사진 크게 보기: 사진을 화면 안에 맞춰 스크롤 없이 보여 주고, 좌우 화살표로 넘긴다 */
.modal-photo { max-width: 960px; background: #000; color: #fff; }
.modal-photo .modal-head h3, .modal-photo .modal-close, .modal-photo .meta-line { color: #fff; }
.modal-photo .modal-body { padding: 0; overflow: hidden; display: block; }
.modal-photo .modal-foot { border-top-color: rgba(255, 255, 255, 0.15); align-items: center; }
.photo-view { position: relative; display: flex; align-items: center; justify-content: center; }
/* 머리말·바닥글·바깥 여백을 뺀 높이 안에 들어오게 한다 */
.photo-view img { display: block; max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); object-fit: contain; }
.photo-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 34px; line-height: 1; padding: 0 0 6px;
}
.photo-nav:hover { background: rgba(0, 0, 0, 0.7); }
/* 창을 열면 첫 화살표에 포커스가 가는데, 그때 생기는 테두리(포커스 표시)는 사진을 가려 보여 주지 않는다 */
.photo-nav:focus, .photo-nav:focus-visible { outline: none; }
.photo-nav.prev { left: 8px; }
.photo-nav.next { right: 8px; }

.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 700; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"],
.field textarea, .field select, .tier-row input, .tier-row select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface); outline: none;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .tier-row input:focus, .tier-row select:focus { border-color: var(--primary); }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.tier-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; font-size: 13px; }
.tier-row .x { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0 4px; }
.music-note { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface); outline: none; }
.music-note:focus { border-color: var(--primary); }
.naver-map-icon { flex-shrink: 0; margin-left: -3px; }
/* 네이버지도보기: 흰 버튼이면 묻히고 진한 초록이면 너무 튀어서, 연한 초록 바탕에 짙은 초록 글자로 둔다 */
.btn.btn-naver-map {
  background: color-mix(in srgb, #03c75a 12%, var(--surface)); border-color: color-mix(in srgb, #03c75a 35%, var(--surface));
  color: color-mix(in srgb, #03a14a 80%, var(--text));
}
.btn.btn-naver-map:hover { background: color-mix(in srgb, #03c75a 20%, var(--surface)); border-color: color-mix(in srgb, #03c75a 50%, var(--surface)); }
/* 리뷰 쓰기 창: 넓게 두 칸으로 나눠 스크롤 없이 한 화면에 */
.modal-review { max-width: 880px; }
.review-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 28px; align-items: start; }
.rf-col { display: grid; gap: 9px; min-width: 0; align-content: start; }
.rf-wide { grid-column: 1 / -1; }
/* 리뷰 쓰기 창 맨 위: 네이버지도에서 정보 찾기 */
.rf-naver { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.rf-naver .btn { text-decoration: none; }
/* 리뷰와 함께 올릴 사진: 고른 사진을 작게 보여 주고 × 로 뺀다 */
.rf-photos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rf-photo { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.rf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-photo .x { position: absolute; top: 0; right: 0; width: 20px; height: 20px; border: 0; border-radius: 0 0 0 8px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; line-height: 1; padding: 0; }
.review-form .field { gap: 5px; }
.review-form .field-label { font-size: 12.5px; }
.review-form .field-inline { grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 8px; }
.review-form .options > .music-note { flex: 1 1 110px; min-width: 0; height: 28px; padding: 0 10px; font-size: 13px; }
.review-form .label-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.review-form .label-row .counter { font-weight: 400; }
.modal-review .modal-head { padding: 12px 18px 4px; }
.modal-review .modal-body { padding-bottom: 12px; }
.modal-review .modal-foot { padding: 10px 18px 12px; align-items: center; }
.rf-foot-hint { margin: 0; }
.review-form .chip { height: 28px; padding: 0 10px; font-size: 12.5px; }
.review-form .options { gap: 5px; }
.review-form .tier-row { gap: 5px; }
.tier-row input.is-any::placeholder { color: var(--text); font-weight: 700; opacity: 1; }
.review-form .tier-row input, .review-form .tier-row select { padding: 6px 10px; }
.review-form .field input[type="text"] { padding: 7px 11px; }
.review-form .field textarea { min-height: 52px; }
.review-form .owner-fields { padding: 10px 12px; gap: 8px; }
/* 왼쪽 빠른 리뷰(필수)와 오른쪽 상세 리뷰(선택) 영역, 아래의 리뷰 글 */
.rf-section { margin: 0; font-size: 13.5px; font-weight: 700; }
.rf-quick, .rf-detail { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.rf-quick { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.review-form .rf-text-guide { margin: 0; }
.review-form .rf-text { width: 100%; min-height: 76px; padding: 7px 11px; font: inherit; font-size: 13.5px; resize: vertical; }
@media (max-width: 767px) {
  .review-form { grid-template-columns: minmax(0, 1fr); } /* 휴대폰은 한 칸 (화면이 짧아 스크롤은 남는다) */
  .rf-foot-hint { visibility: hidden; } /* 버튼 자리가 좁다 */
  /* 커피맛·종합 카공 별점: 별 다섯 개를 한 줄로 두고 누른 별까지 칠한다 (reviewForm.js starGroup) */
  .review-form .options.star-pick { flex-wrap: nowrap; align-items: center; gap: 0; }
  .review-form .star-pick .star-btn { font-size: 22px; padding: 0 1px; }
  /* 별이 바탕에 묻히지 않게 윤곽선: 안 고른 별은 속이 빈 별, 고른 별은 노란 별에 진한 테두리 */
  .review-form .star-pick .star-btn { color: var(--surface); -webkit-text-stroke: 1.2px var(--muted); }
  .review-form .star-pick .star-btn.on { color: #e8a400; -webkit-text-stroke-color: #a87400; }
  /* 360px 폭 휴대폰에서도 '종합 카공 별점 ★★★★★' 이 한 줄에 들어가게 상자 안쪽 여백을 줄인다 */
  .rf-quick, .rf-detail, .review-form .rating-field { padding: 8px 10px; }
  .review-form .star-pick .star-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .review-form .star-pick .chip { margin-left: 8px; } /* 커피맛 '모름' */
  .review-form .field-parking .chip { padding: 0 8px; } /* 주차 '있음·없음·발렛·모름'이 360px 폭에서도 한 줄에 */
  /* 종합 카공 별점도 제목 옆에 별을 둔다. 안내 문구는 그 아래 줄 */
  .review-form .rating-field { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; }
  .review-form .rating-field .field-label { white-space: nowrap; }
  .review-form .rating-field .rating-hint { grid-column: 1 / -1; }
}
.owner-fields { border: 1px dashed var(--owner); border-radius: 12px; padding: 12px; display: grid; gap: 12px; background: var(--owner-soft); }
.form-error { color: var(--bad); font-size: 13px; margin: 0; white-space: pre-line; }
.auth-switch { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.auth-switch button { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 0; }

/* 로그인 창: 네이버·카카오 로그인 버튼 중심 */
.modal-login { max-width: 400px; }
.login-box { display: grid; gap: 14px; padding-bottom: 4px; }
.login-reason { margin: 0; text-align: center; font-weight: 700; font-size: 15px; }
.btn-naver { /* 네이버 로그인 버튼 가이드: 네이버 초록 바탕 + 흰 N 로고 */
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 10px;
  background: #03c75a; color: #fff; font-size: 16px; font-weight: 800; text-decoration: none;
}
.btn-naver:hover { filter: brightness(0.96); }
.btn-naver:focus-visible { outline: 3px solid #9be3bd; outline-offset: 2px; }
.naver-n { display: grid; place-items: center; }
.btn-kakao { /* 카카오 로그인 버튼 가이드: 카카오 노랑 바탕 + 검은 말풍선, 글자는 85% 검정 */
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 10px;
  background: #fee500; color: rgba(0, 0, 0, 0.85); font-size: 16px; font-weight: 800; text-decoration: none;
}
.btn-kakao:hover { filter: brightness(0.96); }
.btn-kakao:focus-visible { outline: 3px solid #fff3a0; outline-offset: 2px; }
.kakao-symbol { display: grid; place-items: center; color: #000; }
.login-easy { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--good-soft); color: var(--good); text-align: center; font-size: 14px; }
.login-notice { margin: 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.login-notice a { color: inherit; font-weight: 700; }
/* 가입 마무리 창 (카카오가 출생 연도·성별을 주지 않은 첫 로그인) */
.signup-form { display: grid; gap: 14px; }
.signup-gender { grid-template-columns: 1fr 1fr; }

/* ---------- 신고·제보 창 ---------- */
.report-options { display: grid; gap: 6px; }
.report-option {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 14px;
}
.report-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.report-option input { accent-color: var(--primary); margin: 0; }

/* ---------- 내 정보 창 ---------- */
.modal-my { max-width: 600px; }
/* 다른 회원 프로필 (js/userProfile.js): 북마크·목록으로 보기 버튼 줄, 리뷰는 최근 리뷰 카페와 같은 카드 */
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-bio { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.modal-profile .profile-reviews { padding: 0; }
.my-page { display: grid; gap: 14px; }
.my-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.my-tab {
  border: 0; background: none; padding: 8px 12px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.my-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.my-pane { display: grid; gap: 12px; align-content: start; }
.my-pane .muted { color: var(--muted); }
.my-pane .small { font-size: 13px; margin: 0; }
.my-reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.my-review { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.my-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; }
.my-review-head .date { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.my-review-text { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-line; }
.my-badge { padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--bad-soft); color: var(--bad); }
.my-section { display: grid; gap: 8px; }
.my-section h4 { margin: 0; font-size: 14px; }
.my-section .field-hint, .my-section .form-error { margin: 0; }
.my-row { display: flex; gap: 8px; }
.my-row input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.my-row input:disabled { opacity: 0.6; }
#my-bio { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: inherit; font-family: inherit; line-height: 1.5; }
.my-bio-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.my-links { margin: 0; font-size: 14px; }
.my-links a { color: var(--primary); font-weight: 600; }
.my-danger { border: 1px solid var(--bad-soft); border-radius: 12px; padding: 10px 14px; }
.my-danger > summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--bad); }
.my-danger[open] { gap: 10px; }
.my-danger > .btn { justify-self: start; }
.my-warn { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.my-page .check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.my-page .check input { width: 16px; height: 16px; accent-color: var(--bad); }

/* ---------- 카페 상세: 숨긴 카페 안내, 정보 제보, 신고 ---------- */
.hidden-banner {
  padding: 8px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 600;
}
.cafe-sub .sub-report { font-size: inherit; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cafe-sub .sub-report:hover { color: var(--primary); }
.report-link { border: 0; background: none; padding: 0 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.report-link:hover { color: var(--bad); text-decoration: underline; }

/* 지도 아래 출처 안내 옆 약관 링크 */
.map-notice a { color: inherit; font-weight: 700; }
/* 네이버 지도 SDK 의 '© NAVER Corp.' 글자가 옆의 초록 NAVER 로고보다 2px 아래에 그려져 가운데를 맞춘다 (위치만 옮기고 가리지 않는다) */
.map .map_copyright { position: relative; top: -2px; }
.notice-sep { margin: 0 4px; }
.email-toggle { justify-self: center; border: 0; background: none; padding: 2px 4px; color: var(--muted); font-size: 13px; text-decoration: underline; }
.email-login { border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); max-width: calc(100% - 32px);
}

/* ---------- 모바일: 목록을 아래쪽 시트로 ---------- */
@media (max-width: 767px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .view-scope button { padding: 0 9px; }
  .view-scope .scope-long { display: none; }
  .view-scope .scope-short { display: inline; }
  .brand-name { display: none; }
  /* 검색창 자리를 넓히려고 로그아웃은 내 정보 창(닉네임을 누르면 열림)에서만 한다 */
  .account .logout-btn { display: none; }
  .account .who { max-width: 96px; }
  .layout { flex-direction: column-reverse; }
  .panel {
    width: 100%; height: 50%; border-right: 0; border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0; margin-top: -16px; box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    transition: height 0.2s ease;
  }
  .panel.expanded { height: 82%; }
  .panel-grip {
    display: block; border: 0; background: none; height: 20px; flex-shrink: 0; position: relative; width: 100%;
  }
  .panel-grip::after {
    content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 2px; background: var(--border);
  }
  .tabs { padding: 0; }
  .tab { font-size: 13.5px; white-space: nowrap; letter-spacing: -0.3px; } /* 탭 셋이 한 줄에 들어가게 */
  /* 오른쪽 아래 버튼 줄은 가운데의 '현 지도에서 검색' 버튼(bottom 38px, 높이 42px) 위에서 시작한다.
     카페 등록이 내 위치 버튼 왼쪽에 있어 같은 높이면 좁은 화면에서 서로 겹친다 */
  .map-fab { bottom: 88px; right: 10px; width: 40px; height: 40px; }
  .map-fab-add { right: 56px; width: auto; font-size: 13px; padding: 0 11px 0 9px; }
  .map-count { bottom: 42px; font-size: 11.5px; padding: 2px 8px; } /* 약관 줄(.map-notice) 바로 위 */
  /* 위치 고르기: 지도가 화면 위쪽 절반뿐이라 안내는 아래 끝에 한 덩어리로 낮게 붙인다 (가운데 핀을 가리지 않게).
     버튼은 오른쪽에 세워 높이를 줄이고, 겹치는 오른쪽 아래 버튼(카페 등록·내 위치·화이트/나이트)은 고르는 동안 숨긴다 (취소는 안내 안의 버튼으로).
     카페로 등록 안내(.offer-bar)는 그 버튼들을 쓰는 중에 뜨므로 내 위치·카페 등록 줄 위(136px)에 둔다 */
  .pick-bar { bottom: 136px; }
  .pick-bar:not(.offer-bar) { bottom: 44px; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; padding: 9px 10px 9px 12px; font-size: 13.5px; }
  .pick-bar:not(.offer-bar) > strong, .pick-bar:not(.offer-bar) > span { grid-column: 1; }
  .pick-bar:not(.offer-bar) span { font-size: 12.5px; }
  .pick-bar:not(.offer-bar) .pick-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 0; }
  body.is-picking-location #btn-locate, body.is-picking-location #btn-add-cafe, body.is-picking-location .map-fab-theme { display: none; }
  /* 지도 맨 아래 가운데. 아래 시트가 지도 영역을 16px 덮고 그 위에 약관 줄(.map-notice, bottom 19px)이 있어 그 바로 위에 둔다.
     오른쪽 아래 버튼 줄(bottom 88px)은 이 버튼 위에 있어 겹치지 않는다 */
  .map-search-btn { bottom: 38px; height: 42px; font-size: 15px; padding: 0 18px 0 15px; }
  /* 지도는 시트 위에서 끝낸다. 지도 아래쪽의 네이버 로고·저작권 표시가 시트에 가리면 안 된다 */
  .map-wrap > .map { bottom: 16px; }
  .search-results { position: fixed; top: calc(var(--topbar-h) - 4px); left: 8px; right: 8px; width: auto; max-height: 65vh; }
  /* 네이버 로고와 같은 높이. 도메인까지 한 줄에 넣고도 오른쪽 아래 © NAVER Corp. 와 겹치지 않게 줄였다 (폭 390px 휴대폰 기준) */
  .map-notice { bottom: 19px; font-size: 10px; line-height: 1.35; padding: 2px 5px; }
  .notice-sep { margin: 0 2px; }
  .map-banner { top: 10px; font-size: 13px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; max-height: 92dvh; }
  .photo-view img { max-height: calc(92vh - 130px); max-height: calc(92dvh - 130px); }
}
/* 휴대폰: '후원하기'가 더해져 줄이 길어졌으므로 사이트 주소는 빼고 네이버 저작권 표시를 덮지 않게 한다 */
@media (max-width: 480px) {
  .notice-site { display: none; }
}
@media (max-width: 389px) {
  /* 폭 360px 대 휴대폰: 글자를 조금 더 줄여 네이버 로고·저작권 표시와 같은 줄에 맞춘다 */
  .map-notice { left: 6px; font-size: 9.5px; letter-spacing: -0.2px; padding: 2px 4px; }
  .notice-sep { margin: 0 1px; }
}

/* ---------- 카페 광고 (검색필터 위 한 칸) ---------- */
.ad-slot { margin: 10px 10px 0; }
.ad-card {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer;
}
.ad-card:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--surface); }
.ad-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ad-thumb { width: 48px; height: 48px; flex: none; border-radius: 9px; object-fit: cover; background: var(--surface); }
.ad-thumb-empty { display: grid; place-items: center; font-size: 22px; }
.ad-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ad-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.ad-label { flex: none; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border); font-size: 10.5px; font-weight: 700; line-height: 16px; }
.ad-cafe { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ad-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-desc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-go { flex: none; font-size: 20px; color: var(--muted); }

/* ---------- 문의·건의 게시판 ---------- */
.board-link { display: inline-flex; align-items: center; gap: 4px; }
.board-link-icon { font-size: 14px; }
/* 좁은 화면: 상단 검색창 자리가 모자라 숨긴다 (후원하기도 같은 모양이라 함께). 지도 아래 안내 줄과 내 정보 창의 '문의·건의' 링크로 연다 */
@media (max-width: 767px) {
  .account .board-link { display: none; }
}
.modal-board { max-width: 600px; }
.board { display: grid; gap: 12px; }
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.board-toolbar .grow { flex: 1; }
.board-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.board-items { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--border); }
.board-item {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "kind title status" "kind meta status";
  align-items: center; gap: 2px 10px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer;
}
.board-item:hover { background: var(--surface-2); }
.board-item .board-kind { grid-area: kind; }
.board-item-title { grid-area: title; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-item .board-item-meta { grid-area: meta; }
.board-item .board-status { grid-area: status; }
.board-item-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.board-kind { padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.board-kind.kind-inquiry { background: color-mix(in srgb, #1565d8 12%, var(--surface)); color: color-mix(in srgb, #1565d8 80%, var(--text)); }
.board-kind.kind-suggestion { background: var(--good-soft); color: var(--good); }
.board-status { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.board-status.is-done { color: var(--good); }
.board-empty { margin: 0; padding: 24px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.board-pager { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.board-back { padding: 0; }
.board-post { display: grid; gap: 6px; }
.board-post-head { display: flex; align-items: center; gap: 8px; }
.board-post-title { margin: 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.board-post-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 0; }
.board-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.board-form-actions { justify-content: flex-end; }
.board-answer-area { display: grid; gap: 12px; }
.board-answer { border-radius: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); }
.board-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.board-answer .board-post-body { padding: 6px 0 2px; }
.board-waiting { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.board-answer-form { border-top: 1px dashed var(--border); padding-top: 12px; }
.board-answer-form textarea { min-height: 100px; }
.board-form .field textarea { min-height: 180px; }

/* ---------- 화이트/나이트 모드 ---------- */
/* 상단 바의 해·달 버튼 (js/theme.js) */
.theme-btn { width: 34px; padding: 0; justify-content: center; color: var(--muted); }
.theme-btn:hover { color: var(--primary); }
@media (max-width: 767px) { .theme-btn { width: 28px; } } /* 휴대폰은 검색창 자리를 조금이라도 더 남긴다 */

/* ---------- 리뷰어 메달 (format.js 의 REVIEWER_BADGES) ---------- */
.medal { margin-right: 3px; font-size: 0.95em; cursor: default; }

/* ---------- 내 정보 > 내 리뷰: 활동 요약 (js/myActivity.js) ---------- */
.my-activity { display: grid; gap: 14px; }
.my-activity:empty { display: none; }
.act-badge {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--owner-soft) 70%, var(--surface)); border: 1px solid color-mix(in srgb, var(--owner) 30%, var(--border));
}
.act-badge-icon { font-size: 34px; line-height: 1; flex: none; }
.act-badge-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.act-badge-text strong { font-size: 15px; }
.act-note { font-size: 12.5px; color: var(--muted); }
/* 다음 메달까지: 같은 금색 계열의 옅은 바탕 위에 채운 만큼 */
.act-meter { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--owner) 18%, var(--surface)); overflow: hidden; margin-top: 3px; }
.act-meter span { display: block; height: 100%; border-radius: 999px; background: var(--owner); }
.act-section { display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.act-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.act-head h4 { margin: 0; font-size: 14px; }
.act-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.act-chips .chip { height: 26px; font-size: 12px; padding: 0 9px; }
.act-map { height: 240px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.act-map .maplibregl-map { height: 100%; }
.act-summary { margin: 0; font-size: 13px; color: var(--muted); }
.act-summary strong { color: var(--text); }
/* 리뷰한 카페 점: 지도는 나이트 모드에서도 밝으므로 색을 고정한다. 흰 테두리로 겹쳐도 하나씩 보이게 */
.mini-dot { width: 12px; height: 12px; border-radius: 50%; background: #7a4a2a; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
/* 지역별 카페 수: 한 가지 값이라 한 색 막대 */
.act-bars { display: grid; gap: 4px; }
.act-bar {
  display: grid; grid-template-columns: minmax(64px, 30%) 1fr auto; align-items: center; gap: 8px;
  width: 100%; padding: 3px 4px; border: 0; border-radius: 6px; background: none; font-size: 12.5px; text-align: left; color: var(--text);
}
button.act-bar:hover, button.act-bar:focus-visible { background: var(--surface-2); outline: none; }
.act-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.act-bar-track { height: 10px; }
.act-bar-fill { display: block; height: 100%; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.act-bar-value { color: var(--muted); font-variant-numeric: tabular-nums; }
/* 방문 통계 세로 막대: 왼쪽 눈금 + 그림 + 아래 날짜 */
.vchart { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 130px auto; column-gap: 6px; row-gap: 4px; }
.vc-axis { position: relative; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vc-axis span { position: absolute; right: 0; transform: translateY(50%); line-height: 1; }
.vc-plot { position: relative; }
.vc-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--border); }
.vc-cols { position: absolute; inset: 0; display: flex; }
.vc-col { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.vc-col:hover, .vc-col:focus-visible { background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: 6px 6px 0 0; }
.vc-bar { width: min(24px, 62%); border-radius: 4px 4px 0 0; background: var(--primary); }
.vc-tip {
  display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 5px 9px; border-radius: 8px; background: var(--ink-grad, var(--text)); color: var(--ink-text, var(--surface));
  font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none;
}
.vc-col:hover .vc-tip, .vc-col:focus-visible .vc-tip { display: block; }
/* 끝 칸의 말풍선이 그림 밖으로 나가지 않게 안쪽으로 붙인다 */
.vc-col:first-child .vc-tip { left: 0; transform: none; }
.vc-col:last-child .vc-tip { left: auto; right: 0; transform: none; }
.vc-xlabels { display: flex; font-size: 11px; color: var(--muted); }
.vc-xlabels span { flex: 1; text-align: center; white-space: nowrap; }
.vc-xlabels .is-current { color: var(--text); font-weight: 700; }
.act-bar-rest { margin: 2px 4px 0; font-size: 12px; color: var(--muted); }
/* 내 리뷰 아래 내가 올린 사진: 카페 상세 사진 칸(.photo)을 작게 한 줄로 */
.my-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.my-photos .photo { width: 64px; height: 64px; aspect-ratio: auto; }
/* 내 리뷰: 카페 이름(누르면 리뷰 고치기) 오른쪽의 '카페로 가기' */
.my-go-cafe { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 7px; color: var(--muted); }
.my-go-cafe:hover { color: var(--primary); border-color: var(--primary); }
/* 계정 탭: 리뷰어 메달 안내 (10단계 표) */
.medal-now { margin: 0; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.medal-now strong { color: var(--text); }
.medal-now-icon { font-size: 20px; line-height: 1; }
.medal-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
@media (max-width: 480px) { .medal-ladder { grid-template-columns: minmax(0, 1fr); } }
.medal-ladder li {
  display: grid; grid-template-columns: 38px 24px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 8px; font-size: 12.5px; color: var(--muted);
}
.medal-ladder li.is-done { color: var(--text); }
.medal-ladder li.is-now { color: var(--text); background: var(--owner-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--owner) 45%, transparent); font-weight: 700; }
.medal-step { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.medal-icon { font-size: 17px; line-height: 1; text-align: center; }
/* 아직 받지 못한 단계는 흐리게 */
.medal-ladder li:not(.is-done):not(.is-now) .medal-icon { filter: grayscale(1); opacity: 0.55; }
.medal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medal-min { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.medal-rules { color: var(--muted); font-size: 12.5px; }
/* 개척자: 카페의 첫 이용자 리뷰 */
.pioneer-line { margin: -4px 0 6px; font-size: 12.5px; color: var(--muted); }
.pioneer-line strong { color: var(--text); }
.pioneer-tag { padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--bad-soft); color: var(--bad); white-space: nowrap; }
/* 도장깨기 (js/stamps.js). 고무도장 모양이고, 단계마다 잉크 색이 동 → 은 → 금 → 루비 → 다이아로 바뀐다 */
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .stamps { grid-template-columns: minmax(0, 1fr); } }
.stamp { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); }
.stamp.is-on { background: var(--surface); border-style: solid; }
.stamp.is-done { background: linear-gradient(135deg, var(--owner-soft), var(--surface) 75%); border-color: color-mix(in srgb, var(--owner) 45%, transparent); }
.stamp-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.stamp-text strong { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stamp-text .act-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.stamp-tier { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--ink) 14%, transparent); white-space: nowrap; }
.stamp-progress { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stamp-steps { display: inline-flex; gap: 3px; }
.stamp-steps i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--border); }
.stamp-steps i.on:nth-child(1) { background: var(--tier-1); border-color: var(--tier-1); }
.stamp-steps i.on:nth-child(2) { background: var(--tier-2); border-color: var(--tier-2); }
.stamp-steps i.on:nth-child(3) { background: var(--tier-3); border-color: var(--tier-3); }
.stamp-steps i.on:nth-child(4) { background: var(--tier-4); border-color: var(--tier-4); }
.stamp-steps i.on:nth-child(5) { background: var(--tier-5); border-color: var(--tier-5); }
.stamp-meter { margin-top: 1px; height: 4px; }

/* 도장 그림: 바깥 굵은 테 · 띠 위쪽 이름 · 띠 아래쪽 단계 별 · 안쪽 가는 테 · 가운데 아이콘. 못 받은 도장은 점선 빈 자리 */
.seal { --ink: var(--muted); position: relative; flex: none; width: 56px; height: 56px; display: grid; place-items: center; color: var(--ink); }
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal-outer { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 5 4; opacity: 0.45; }
.seal-inner { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.35; }
.seal-ring { font-size: 9.5px; font-weight: 800; fill: currentColor; opacity: 0.28; }
.seal-stars { font-size: 11px; fill: currentColor; letter-spacing: 1px; opacity: 0.28; }
/* 아이콘: 그림 영역만 잘라 낸 이미지(stamps.js sealIcon)를 안쪽 테 안 정가운데에. 가로세로 중 긴 쪽을 같은 크기로 맞춘다 */
.seal-icon { position: relative; display: block; width: 40%; height: 40%; object-fit: contain; filter: grayscale(1); opacity: 0.35; }
.seal-icon-text { width: auto; height: auto; font-size: 22px; line-height: 1; }
/* 잉크가 고르게 묻지 않은 느낌: 테두리 몇 군데를 살짝 옅게 */
.seal.is-on svg { -webkit-mask: conic-gradient(from 40deg, #000 0 18%, rgba(0, 0, 0, 0.6) 23%, #000 30% 64%, rgba(0, 0, 0, 0.7) 70%, #000 77%); mask: conic-gradient(from 40deg, #000 0 18%, rgba(0, 0, 0, 0.6) 23%, #000 30% 64%, rgba(0, 0, 0, 0.7) 70%, #000 77%); }
.seal.is-on .seal-outer { stroke-width: 5; stroke-dasharray: none; opacity: 0.9; fill: color-mix(in srgb, var(--ink) 10%, transparent); }
.seal.is-on .seal-inner { stroke-width: 1.6; stroke-dasharray: none; opacity: 0.85; }
.seal.is-on :is(.seal-ring, .seal-stars) { opacity: 0.9; }
.seal.is-on .seal-icon { filter: none; opacity: 1; }
/* 단계 색 (못 받은 도장의 기본 색보다 뒤에 둔다) */
.tier-1 { --ink: var(--tier-1); }
.tier-2 { --ink: var(--tier-2); }
.tier-3 { --ink: var(--tier-3); }
.tier-4 { --ink: var(--tier-4); }
.tier-5 { --ink: var(--tier-5); }
.seal-big { width: 78px; height: 78px; }
.seal-big .seal-icon-text { font-size: 32px; }

/* 새 도장 알림 (리뷰 저장 뒤). 공유 권유 창과 겹치지 않게 위쪽 알림 카드로, 도장이 쾅 찍히듯 나온다 */
.stamp-pop {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 210;
  display: flex; align-items: center; gap: 14px; width: min(420px, calc(100% - 24px)); padding: 12px 40px 12px 14px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--owner) 45%, var(--border)); border-radius: 16px; box-shadow: var(--shadow);
  animation: stamp-pop-in 0.25s ease-out; transition: opacity 0.25s, transform 0.25s;
}
.stamp-pop.is-out { opacity: 0; transform: translate(-50%, -8px); }
.stamp-pop .seal { animation: stamp-slam 0.55s cubic-bezier(0.2, 0.8, 0.3, 1.25) 0.12s both; }
.stamp-pop-text { display: grid; gap: 2px; min-width: 0; }
.stamp-pop-kicker { font-size: 12px; font-weight: 800; color: var(--owner); }
.stamp-pop-text strong { font-size: 15px; }
.stamp-pop-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.stamp-pop-close:hover { background: var(--surface-2); }
@keyframes stamp-pop-in { from { opacity: 0; transform: translate(-50%, -10px); } }
@keyframes stamp-slam {
  0% { opacity: 0; transform: scale(2.2) rotate(-25deg); }
  60% { opacity: 1; transform: scale(0.9) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .stamp-pop, .stamp-pop .seal { animation: none; } }
/* 리뷰 창 야외자리: 있음/없음(하나만)과 따로 켜는 '통창 열림' 사이 구분선 */
.chip-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; align-self: center; }
.chip-toggle[aria-pressed="false"] { border-style: dashed; }

/* ---------- 휴대폰: 상단 바 버튼을 지도 위로 ----------
   상단 바는 검색창에 자리를 내준다. 보기 방식(전체·리뷰)만 지도 위쪽 가운데에 둔다.
   카페 등록·화이트/나이트·확대·축소 버튼은 PC 처럼 오른쪽 아래 내 위치 버튼 옆과 위에 둔다.
   .map-quick 은 지도 폭 전체에 걸치므로 빈 곳은 눌러도 지도가 받도록 pointer-events 를 끈다 */
.map-quick { display: none; }
@media (max-width: 767px) {
  .topbar .view-scope, .account .theme-btn { display: none; }
  .map-quick {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 6px;
    position: absolute; top: 10px; left: 0; right: 0; z-index: 5;
    pointer-events: none;
  }
  .map-quick > * { pointer-events: auto; }
  .map-quick .view-scope { grid-column: 2; box-shadow: var(--shadow); }
  /* 내 위치 버튼(bottom 88px, 높이 40px) 위로 8px 간격: 화이트/나이트 → 축소 → 확대 */
  .map-fab.map-fab-theme { bottom: 136px; width: 40px; height: 40px; }
  .map-fab-zoom-out { bottom: 184px; }
  .map-fab-zoom-in { bottom: 232px; }
  /* 목록을 크게 펼쳐 지도가 낮아지면 위쪽 버튼과 겹친다 */
  .layout:has(.panel.expanded) .map-fab-theme, .layout:has(.panel.expanded) .map-fab-zoom-in, .layout:has(.panel.expanded) .map-fab-zoom-out { display: none; }
  .map-banner { top: 58px; max-width: calc(100% - 110px); } /* 위쪽 보기 방식·오른쪽 확대 버튼과 겹치지 않게 */
}

/* ---------- 카공 타이머 (js/study.js) ---------- */
/* 카공 중 표시 점: 띠·상세·목록 카드가 같이 쓴다 */
.study-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #23a55a; box-shadow: 0 0 0 3px color-mix(in srgb, #23a55a 22%, transparent);
  animation: study-pulse 1.6s ease-in-out infinite;
}
@keyframes study-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #23a55a 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .study-dot { animation: none; } }
/* 목록·상세 위 띠: 패널 맨 위 (넓은 화면은 목록 위, 휴대폰은 아래 시트의 손잡이 밑) */
.study-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px;
  background: color-mix(in srgb, #23a55a 9%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #23a55a 25%, var(--border));
}
.study-bar[hidden] { display: none; }
.study-cafe {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 0;
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.study-cafe strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.study-cafe:hover strong { text-decoration: underline; }
.study-label { flex: none; font-size: 12px; font-weight: 700; color: #1d8a4b; }
.study-clock { flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.study-stop { flex: none; }
:root[data-theme="dark"] .study-label { color: #6cc38f; }
/* 상세: 카공 시작·끝내기 버튼과 '지금 n명 카공 중' */
.study-btn-slot { display: contents; }
.btn-study { color: #1d8a4b; border-color: color-mix(in srgb, #23a55a 40%, var(--border)); }
.btn-study:hover { background: color-mix(in srgb, #23a55a 8%, var(--surface)); }
.btn-study.is-on { background: #23a55a; border-color: #23a55a; color: #fff; }
:root[data-theme="dark"] .btn-study:not(.is-on) { color: #6cc38f; }
.studying-slot:empty { display: none; }
.studying-now { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #1d8a4b; }
:root[data-theme="dark"] .studying-now { color: #6cc38f; }
/* 목록 카드 이름 옆 */
.studying-tag {
  align-self: center; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #1d8a4b; background: color-mix(in srgb, #23a55a 12%, var(--surface)); white-space: nowrap;
}
.studying-tag .study-dot { width: 6px; height: 6px; box-shadow: none; }
:root[data-theme="dark"] .studying-tag { color: #6cc38f; }
/* 끝내기 창 */
.modal-study { max-width: 420px; }
.study-end { display: grid; gap: 10px; }
.study-end p { margin: 0; }
.study-end-cafe { font-size: 17px; font-weight: 800; }
.study-end-summary { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.study-end .check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.study-end .check input { width: 16px; height: 16px; accent-color: var(--primary); }
.study-end-fix { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.study-end-fix[hidden] { display: none; }
.study-end-fix input { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.study-edit-row { flex-wrap: wrap; } /* 시간 고치기 창: 시작·끝 입력칸을 세로로 맞추고, 좁은 화면에서는 입력칸을 다음 줄로 */
.study-edit-row label { min-width: 9em; }

/* ---------- 내 정보 > 카공 기록 (js/myStudy.js) ---------- */
.study-now-box {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  background: color-mix(in srgb, #23a55a 9%, var(--surface)); border: 1px solid color-mix(in srgb, #23a55a 25%, var(--border));
}
.study-now-box .btn { margin-left: auto; }
.study-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.study-tile { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.study-tile strong { font-size: 16px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .study-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.study-recap-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 카공 잔디: 한 줄이 한 주 (일~토), 왼쪽부터 오래된 주 */
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.heat-col { display: grid; grid-template-rows: 16px repeat(7, auto); gap: 3px; flex: 1 0 14px; max-width: 26px; }
.heat-month { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: visible; }
.heat-cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat-cell.lv0 { background: color-mix(in srgb, var(--border) 70%, var(--surface)); }
.heat-cell.lv1 { background: #c6e6a0; }
.heat-cell.lv2 { background: #7cc770; }
.heat-cell.lv3 { background: #2e9a48; }
.heat-cell.lv4 { background: #18622e; }
.heat-cell.is-future { background: none; }
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.heat-legend .heat-cell { width: 11px; }
/* 시간대 막대 */
.hour-bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; border-bottom: 1px solid var(--border); }
.hour-bar { flex: 1; min-width: 0; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--primary) 55%, var(--surface)); }
.hour-bar.is-peak { background: var(--primary); }
.hour-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
/* 장소·시간 기록 */
.study-places, .study-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.study-place { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.study-place:last-child, .study-session:last-child { border-bottom: 0; }
.study-place .link-btn, .study-place > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.study-place .act-note { flex: none; }
.study-session { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.study-date { flex: none; width: 64px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.study-session-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.study-session > .btn { flex: none; }
.study-session-main > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; justify-self: start; max-width: 100%; }

/* ---------- 카공 결산 이미지 (js/recap.js) ---------- */
.modal-recap { max-width: 560px; }
.recap { display: grid; gap: 12px; justify-items: center; }
.recap-preview-box {
  position: relative; height: min(56vh, 520px); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow);
}
.recap-preview { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.15s; }
.recap-preview:not([src]) { visibility: hidden; }
.recap-preview-box.is-loading .recap-preview { opacity: 0.35; }
.recap-preview-box.is-loading::after {
  content: "그리는 중"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--muted);
}
/* 디자인 고르기: 가로로 넘겨 본다 */
.recap-strip { display: flex; gap: 8px; overflow-x: auto; width: 100%; padding: 4px 4px 8px; scroll-snap-type: x proximity; scroll-padding: 4px; }
.recap-thumb {
  flex: 0 0 76px; display: grid; gap: 4px; border: 0; background: none; padding: 0; color: var(--text); cursor: pointer; scroll-snap-align: start;
}
.recap-thumb-img {
  display: block; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--surface-2);
  outline: 2px solid transparent; outline-offset: 1px;
}
.recap-thumb-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.recap-thumb.is-loading .recap-thumb-img img { opacity: 0.3; }
.recap-thumb[aria-checked="true"] .recap-thumb-img { outline-color: var(--primary); }
.recap-thumb-name { font-size: 11.5px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-thumb[aria-checked="true"] .recap-thumb-name { color: var(--primary); font-weight: 800; }
.recap-hint { margin: 0; text-align: center; }
