/* 팔레트·간격·타이포 토큰은 tokens.css 한 곳에만 있습니다.
   여기 있던 :root 사본은 tokens.css 가 뒤에 실려 이미 전부 덮이던 죽은 값이라 걷어냈습니다.
   옛 이름(--pink, --ink, --radius …)도 tokens.css 가 별칭으로 그대로 들고 있습니다. */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: var(--tracking-body);
  background: var(--warm-50);
}

html body:has(.subpage-header) {
  height: auto;
  min-height: 100%;
}

.subpage-header {
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--line);
}

/*
 * 스크롤 내내 붙어 있는 상단 바. 파셜에서 <header> 밖에 두었기 때문에 페이지 래퍼
 * 끝까지 붙습니다. 레이어는 콘텐츠 위·하단 탭바(2000)와 시트(3000) 아래입니다.
 */
.subpage-header__top {
  position: sticky;
  z-index: var(--z-sticky);
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 68px;
  align-items: center;
  gap: var(--space-6);
  border-bottom: 1px solid var(--line);
  background: var(--surface-veil);
  backdrop-filter: blur(10px);
}

/* 공용 헤더와 같은 세리프 로고를 가운데 두어, 서브페이지에서도 지면이 이어집니다. */
.subpage-header__logo {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-self: center;
  color: var(--ink);
  font-family: var(--font-logo);
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: var(--weight-strong);
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.subpage-header__back,
.subpage-header__nav a,
.subpage-header__current {
  display: inline-flex;
  /* 두세 글자 링크라 폭이 21px 까지 좁아져 WCAG 24x24 를 못 맞췄습니다. */
  min-width: 44px;
  min-height: 44px;
  padding-inline: var(--space-2);
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1;
  text-decoration: none;
}

.subpage-header__back {
  gap: var(--space-2);
  flex: 0 0 auto;
  justify-self: start;
  font-size: var(--text-sm);
  transition: color var(--duration-base) var(--ease-out);
}

.subpage-header__nav {
  min-width: 0;
  justify-self: end;
}

.subpage-header__nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subpage-header__nav li {
  display: inline-flex;
  align-items: center;
}

.subpage-header__nav li + li::before {
  margin: 0 var(--space-2);
  color: var(--line);
  content: "·";
}

.subpage-header__nav a {
  transition: color var(--duration-base) var(--ease-out);
}

.subpage-header__back:hover,
.subpage-header__nav a:hover {
  color: var(--accent-strong);
}

.subpage-header__current {
  color: var(--accent-strong);
  font-weight: var(--weight-display);
}

.subpage-header__back:focus-visible,
.subpage-header__nav a:focus-visible {
  border-radius: var(--radius-sm);
  outline: 2px solid rgb(var(--accent-rgb) / 42%);
  outline-offset: 3px;
}

.subpage-header__intro {
  padding: var(--space-9) 0 var(--space-8);
}

.subpage-header__eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-label);
  letter-spacing: 0.16em;
}

.subpage-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--title-subpage);
  font-weight: var(--display-weight-strong);
  letter-spacing: -0.042em;
  line-height: 1.16;
}

.subpage-header__lead {
  max-width: 640px;
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  text-wrap: pretty;
  word-break: keep-all;
}

button {
  color: inherit;
  font: inherit;
}

.map-page {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
}

.map-canvas {
  position: absolute;
  inset: 0;
  /* 네이버 지도 SDK가 컨테이너 position 을 inline relative 로 덮어써도 크기가 유지되게 명시 */
  width: 100%;
  height: 100%;
  background: var(--gray-100);
}

/* ── 네이버 줌 컨트롤 ────────────────────────────────────────────
   SDK 가 인라인 스타일로 그려서 클래스가 없습니다. 저작권 표기(.map_copyright)와
   로고를 건드리지 않도록, 이 컨트롤에만 있는 테두리 패턴으로 정확히 집어서
   우리 컨트롤 톤(흰 면·라운드·헤어라인·소프트 섀도우)으로 맞춥니다.
   인라인 스타일이라 !important 없이는 덮이지 않습니다. */
.map-canvas div[style*="border: 1px solid rgb(68, 68, 68)"] {
  overflow: hidden !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  box-shadow: var(--control-shadow), 0 0 0 1px rgb(0 0 0 / 8%) !important;
}

/* 가운데 슬라이더 트랙도 같은 면으로. */
.map-canvas div[style*="border: 1px solid rgb(68, 68, 68)"] > div[style*="background-color: rgb(255, 255, 255)"] {
  background-color: var(--surface) !important;
}

.map-canvas.is-unavailable {
  background:
    radial-gradient(circle at 22% 28%, rgb(var(--accent-rgb) / 7%), transparent 31%),
    radial-gradient(circle at 78% 72%, rgb(116 141 123 / 6%), transparent 34%),
    var(--warm-50);
}

.map-configuration {
  position: absolute;
  z-index: 1050;
  top: 50%;
  left: 50%;
  display: none;
  width: min(440px, calc(100% - 40px));
  padding: var(--space-7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  transform: translate(-50%, -50%);
}

.map-configuration.is-visible {
  display: block;
}

.map-configuration__icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid rgb(var(--accent-rgb) / 28%);
  border-radius: 50%;
  color: var(--muted);
  font-size: var(--text-2xl);
  background: var(--rose-50);
}

.map-configuration h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
}

.map-configuration p {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  word-break: keep-all;
}

.map-configuration code {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  background: var(--rose-50);
}

.map-header {
  position: absolute;
  z-index: 1100;
  top: var(--space-6);
  left: var(--space-7);
  right: var(--space-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.map-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  pointer-events: auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--control-shadow);
  pointer-events: auto;
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--display-weight-strong);
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.brand-tagline {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.places-panel-toggle {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  background: var(--surface);
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out), transform var(--duration-slower) var(--ease-out);
  box-shadow: var(--control-shadow);
}

.places-panel-toggle:hover {
  color: var(--ink);
  background: var(--surface-solid);
  transform: translateY(-1px);
}

.places-panel-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.25;
}

.location-button {
  /* 모양은 .ds-btn.ds-btn--secondary 가 갖습니다. 여기에는 지도 위에서만
     필요한 것(부모의 pointer-events 를 되살리기, 등장/퇴장 트랜지션)만 남깁니다. */
  pointer-events: auto;
  transition: opacity var(--duration-slower) var(--ease-standard), transform var(--duration-slower) var(--ease-standard);
}

.location-button:hover {
  color: var(--accent-strong);
  background: var(--surface-solid);
  box-shadow: none;
  transform: translateY(-1px);
}

.location-button:focus-visible,
.filter-chip:focus-visible,
.place-card__close:focus-visible,
.place-card__link:focus-visible,
.place-list-item__button:focus-visible,
.place-list-item__toggle:focus-visible,
.place-list-item__story-link:focus-visible,
.places-panel-toggle:focus-visible,
.places-surface__grabber:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 42%);
  outline-offset: 3px;
}

.location-button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.location-button__icon {
  display: grid;
  place-items: center;
}

.location-button.is-locating > span:first-child {
  animation: location-spin var(--duration-slower) linear infinite;
}

.places-surface {
  --sheet-translate: 0px;
  position: absolute;
  z-index: 1080;
  /* 지도 안 상단 컨트롤(스팟/코스 · 내 위치) 아래에서 시작합니다. */
  top: var(--space-11);
  bottom: var(--space-6);
  left: var(--space-6);
  display: flex;
  width: 364px;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--gray-0);
  box-shadow: var(--panel-shadow);
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--sheet-duration) var(--sheet-ease);
}

.places-surface.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 32px));
}

.places-surface__grabber {
  display: none;
}

.places-surface__heading {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-5) var(--space-4);
}

/* 정렬 기준 — 목록은 요즘 랭킹 순으로 쌓입니다. 데스크톱은 우측 안내문이 그 자리를 씁니다. */
.places-surface__sort {
  display: none;
  margin: 0 0 var(--space-1);
  color: var(--gray-500);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.places-surface__eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.16em;
}

.places-surface__heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  line-height: 1.25;
}

/* "27곳"은 한 덩어리라 줄 사이에서 갈라지지 않게 묶어 둡니다. */
.places-surface__count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.places-surface__hint {
  max-width: 132px;
  margin: 0 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-2xs);
  line-height: 1.55;
  text-align: right;
  word-break: keep-all;
}

.places-surface .category-filter {
  position: static;
  display: flex;
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  gap: var(--space-1);
  padding: 0 var(--space-4) var(--space-4);
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  scrollbar-width: none;
}

.places-surface .category-filter::-webkit-scrollbar {
  display: none;
}

.places-surface__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgb(0 0 0 / 11%) transparent;
  scrollbar-width: thin;
}

.places-list-view[hidden],
.place-card[hidden] {
  display: none;
}

.places-list {
  display: flex;
  flex-direction: column;
  padding: var(--space-1) var(--space-3) var(--space-3);
}

.places-list__empty {
  margin: 0;
  padding: var(--space-8) var(--space-7);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.8;
  text-align: center;
  word-break: keep-all;
}

.places-list-footer {
  margin: 0 var(--space-5);
  padding: var(--space-5) 0 var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: right;
}

.places-list-footer a {
  color: inherit;
  text-underline-offset: 3px;
  transition: color var(--duration-base) var(--ease-out);
}

.places-list-footer a:hover {
  color: var(--accent-strong);
}

.place-list-item {
  position: relative;
  border-bottom: 1px solid var(--hairline-soft);
  background: transparent;
  transition: background var(--duration-base) var(--ease-out), opacity var(--duration-slow) var(--ease-out);
}

.place-list-item[hidden] {
  display: none;
}

.place-list-item:hover,
.place-list-item.is-selected,
.place-list-item.is-map-linked {
  background: rgb(0 0 0 / 5%);
}

.place-list-item__summary {
  position: relative;
}

/* 가로형 — 좌측 52px 사진, 우측에 이름과 메타 한 줄. 한 화면에 더 많은 장소가 보인다. */
.place-list-item__button {
  display: grid;
  width: 100%;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  /* 우측 위 저장 버튼과 우측 아래 펼침 버튼이 겹치지 않을 만큼의 세로 여백입니다. */
  padding: var(--space-4) var(--space-3);
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.place-list-item__thumbnail {
  position: relative;
  display: grid;
  width: 52px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  place-items: center;
  border: 0;
  border-radius: var(--radius-3);
  color: color-mix(in srgb, var(--place-accent) 76%, var(--ink));
  font-family: var(--font-serif);
  font-size: var(--text-base);
  background: color-mix(in srgb, var(--place-accent) 14%, var(--surface-card));
}

.place-list-item__thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--sheet-ease);
}

.place-list-item__thumbnail.has-image img {
  opacity: 1;
}

.place-list-item:hover .place-list-item__thumbnail img {
  transform: scale(1.025);
}

.place-list-item__placeholder {
  position: relative;
}

.place-list-item__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

/* 한 줄로 잇는 메타 — 카테고리 아이콘 · 세부 · 기록 수. */
.place-list-item__meta {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
  color: var(--gray-500);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

.place-list-item__meta > * + *::before {
  margin-right: var(--space-2);
  color: var(--gray-400);
  content: "·";
}

.place-list-item__category {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: var(--gray-600);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
}

.place-list-item__category .seollein-icon {
  flex: 0 0 auto;
  color: var(--place-accent);
}

.place-list-item__name {
  display: block;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-heading);
  text-overflow: ellipsis;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.place-list-item:hover .place-list-item__name,
.place-list-item.is-selected .place-list-item__name,
.place-list-item.is-map-linked .place-list-item__name {
  text-decoration-color: color-mix(in srgb, var(--ink) 58%, transparent);
}

.place-list-item__subcategory {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-list-item__content-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.place-list-item__toggle {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-2);
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--gray-500);
  background: var(--surface-card);
  box-shadow: none;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
}

.place-list-item__toggle:hover,
.place-list-item__toggle[aria-expanded="true"] {
  color: var(--ink);
}

.place-list-item__toggle > span,
.place-list-item__toggle > span::after {
  display: block;
  width: 12px;
  height: 1px;
  background: currentColor;
  content: "";
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}

.place-list-item__toggle > span::after {
  transform: rotate(90deg);
}

.place-list-item__toggle[aria-expanded="true"] > span::after {
  opacity: 0;
  transform: rotate(0deg);
}

.place-list-item__expansion {
  display: grid;
  overflow-anchor: none;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows var(--duration-slow) var(--ease-out), opacity var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-slow);
}

.place-list-item.is-expanded .place-list-item__expansion {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows var(--duration-slow) var(--ease-out), opacity var(--duration-base) var(--ease-out), visibility 0s;
}

.place-list-item__expansion-inner {
  min-height: 0;
  overflow: hidden;
}

.place-list-item__expansion-content {
  margin: 0 var(--space-3);
  padding: var(--space-4) 0 var(--space-5);
  border-top: 1px solid var(--hairline-soft);
}

.place-list-item__expansion-subcategory {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--label-tracking);
  line-height: 1.5;
  text-transform: uppercase;
}

.place-list-item__expansion-description {
  margin: var(--space-3) 0 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  line-height: 1.65;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-list-item__expansion-address {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
  margin: var(--space-3) 0 0;
}

.place-list-item__expansion-address span {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--label-tracking);
}

.place-list-item__expansion-address strong {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-list-item__story-link {
  display: inline-flex;
  margin-top: var(--space-4);
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--label-tracking);
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
  transition: color var(--duration-base) var(--ease-out);
}

.place-list-item__story-link::after {
  margin-left: var(--space-2);
  content: "→";
  font-weight: var(--weight-regular);
}

.place-list-item__story-link:hover {
  color: var(--muted);
}

.thrill-meter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: rgb(0 0 0 / 16%);
}

.thrill-meter svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.thrill-meter svg.is-filled {
  color: var(--ink);
}

.thrill-meter--compact {
  gap: var(--space-1);
}

.thrill-meter--compact svg {
  width: 10px;
  height: 10px;
}

/* 칩줄은 목록 시트(모바일)와 좌측 패널(데스크톱) 안에서만 삽니다.
   지도 위에 따로 띄우던 예전 자리는 지금 아무 화면에서도 쓰지 않아 걷어냈습니다. */
.category-filter {
  display: flex;
  width: 100%;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

/* 칩 — 아이콘 + 라벨의 알약. 고른 칩만 먹색으로 채워 한눈에 구분됩니다. */
.filter-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--gray-600);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-body);
  white-space: nowrap;
  background: var(--surface-page);
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
  box-shadow: none;
}

.filter-chip__icon {
  flex: 0 0 auto;
  margin-right: 2px;
}

/* 전체 칩의 개수 — 라벨과 같은 줄에서 숫자만 폭이 흔들리지 않게 잡습니다. */
.filter-chip__count {
  margin-left: var(--space-1);
  color: var(--gray-500);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.filter-chip:hover {
  border-color: var(--gray-900);
  color: var(--ink);
}

.filter-chip.is-active {
  border-color: var(--gray-900);
  color: var(--gray-50);
  background: var(--gray-900);
  box-shadow: none;
}

.filter-chip.is-active .filter-chip__count {
  color: rgb(250 248 245 / 62%);
}

.place-card {
  position: relative;
  width: 100%;
  padding: var(--space-2) var(--space-5) var(--space-5);
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}

.place-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.place-card__close {
  position: absolute;
  z-index: 2;
  top: var(--space-2);
  right: var(--space-4);
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--gray-500);
  line-height: 1;
  background: rgb(253 252 249 / 84%);
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}

.place-card__close:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

/* 사진(4:5)이 왼쪽, 읽는 것이 오른쪽. 시트 한 화면에 카드가 통째로 들어옵니다. */
.place-card__body {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.place-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-3);
  background: var(--gray-200);
}

.place-card__media img,
.place-card__placeholder {
  width: 100%;
  height: 100%;
}

.place-card__media img {
  display: block;
  object-fit: cover;
}

.place-card__media img[hidden] {
  display: none;
}

.place-card__placeholder {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--place-accent) 76%, var(--ink));
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  background: color-mix(in srgb, var(--place-accent) 14%, var(--surface-card));
}

.place-card__placeholder[hidden] {
  display: none;
}

/* 사진 위 기록 수 배지 — 사진 오른쪽 아래에 얹힙니다. */
.place-card__photo-count {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  display: inline-flex;
  height: 22px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  color: var(--gray-50);
  font-size: 10px;
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  background: rgb(28 26 23 / 62%);
}

.place-card__photo-count[hidden] {
  display: none;
}

.place-card__name {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-heading);
  word-break: keep-all;
}

.place-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}

.place-card__category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gray-500);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.06em;
}

.place-card__category .seollein-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--category-color, var(--gray-500));
}

.place-card__description {
  margin: var(--space-2) 0 0;
  color: var(--gray-600);
  font-size: var(--text-xs);
  line-height: 1.75;
  word-break: keep-all;
}

.place-card__address {
  margin: var(--space-2) 0 0;
  color: var(--gray-500);
  font-size: var(--text-2xs);
  line-height: 1.65;
}

.place-card__link {
  display: inline-block;
  margin-top: var(--space-2);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

.place-card__link:hover {
  color: var(--ink);
}

.map-status,
.map-toast {
  position: absolute;
  z-index: 1200;
  left: 50%;
  max-width: calc(100% - 36px);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  color: #fdfbf9;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  text-align: center;
  background: rgb(26 26 26 / 84%);
  box-shadow: var(--control-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}

.map-status {
  top: 170px;
}

.map-toast {
  bottom: var(--space-7);
}

.map-status.is-visible,
.map-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.seollein-marker-wrapper,
.user-marker-wrapper {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* 핀 — 좌표 한가운데 얹힌 흰 원. 카테고리는 색이 아니라 아이콘으로 읽힙니다. */
.seollein-marker-wrapper {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
  will-change: opacity, transform;
}

.seollein-marker-wrapper.is-visible {
  opacity: 1;
  transform: scale(1);
}

.user-marker-wrapper {
  width: 30px;
  height: 30px;
}

.seollein-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--gray-600);
  background: var(--gray-0);
  box-shadow: 0 4px 10px rgb(28 26 23 / 16%);
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}

.seollein-marker .seollein-icon {
  display: block;
}

.seollein-marker-wrapper:hover .seollein-marker,
.seollein-marker-wrapper.is-list-linked .seollein-marker {
  color: var(--ink);
  transform: scale(1.06);
}

/* 고른 핀은 먹색으로 뒤집고 42/38 만큼만 키웁니다(아이콘도 같이 21 → 23px). */
.seollein-marker-wrapper.is-selected .seollein-marker {
  border-color: transparent;
  color: var(--gray-50);
  background: var(--ink-gradient);
  box-shadow: 0 0 0 2px var(--gray-0), 0 8px 18px rgb(28 26 23 / 30%);
  transform: scale(1.105);
}

.seollein-marker-label {
  position: absolute;
  bottom: 42px;
  left: 50%;
  min-width: max-content;
  padding: var(--space-1) 9px;
  border-radius: var(--radius-1);
  color: var(--gray-50);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  line-height: 1.3;
  white-space: nowrap;
  background: var(--gray-900);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}

.seollein-marker-wrapper.is-list-linked .seollein-marker-label,
.seollein-marker-wrapper.is-selected .seollein-marker-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.map-page.has-place-link .seollein-marker-wrapper.is-selected:not(.is-list-linked) .seollein-marker-label {
  opacity: 0;
  transform: translate(-50%, 4px);
}

/* 클러스터 — 핀이 겹칠 때 개수로 묶어 보여준다. 개수 구간에 따라 크기가 세 단계다. */
.seollein-cluster {
  display: grid;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--gray-50);
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--ink-gradient);
  box-shadow: 0 0 0 2px var(--gray-0), 0 6px 14px rgb(28 26 23 / 25%);
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.seollein-cluster:hover {
  transform: scale(1.06);
}

.seollein-cluster:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 42%);
  outline-offset: 3px;
}

.seollein-cluster--sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-2xs);
}

.seollein-cluster--md {
  width: 34px;
  height: 34px;
  font-size: var(--text-xs);
}

.seollein-cluster--lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

@media (prefers-reduced-motion: reduce) {
  .seollein-cluster {
    transition: none;
  }

  .seollein-cluster:hover {
    transform: none;
  }
}

/* 내 위치 — 파란 점 + 흰 링 + 옅은 헤일로. 계속 도는 애니메이션은 두지 않습니다. */
.user-marker {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
}

.user-marker > span {
  display: block;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--map-locate);
  box-shadow: 0 0 0 3px var(--gray-0), 0 0 0 9px rgb(74 111 165 / 18%);
}

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

@media (max-width: 700px) {
  /* 제목줄과 칩줄을 위아래로 쌓습니다. 칩이 아이콘까지 달고 나서 한 줄에 같이 서기엔 좁습니다. */
  .map-mode-pane--spots.is-active {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

  .map-page {
    min-height: 460px;
  }

  .map-header {
    top: max(12px, env(safe-area-inset-top));
    left: var(--space-3);
    right: var(--space-3);
    align-items: flex-start;
  }

  .places-panel-toggle {
    display: none;
  }

  /* 시트 — 종이 면이 지도 위로 24px 라운드로 올라옵니다. blur 는 두지 않습니다.
     끌어올리는 동안 배경을 계속 다시 그리면 제스처가 무거워집니다. */
  .places-surface {
    --sheet-radius: 24px;
    top: var(--space-12);
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 96px);
    border-width: 1px 0 0;
    border-color: var(--border-default);
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    background: var(--surface-page);
    box-shadow: var(--shadow-sheet);
    opacity: 1;
    --sheet-translate: 48%;
    transform: translateY(var(--sheet-translate));
    transition: transform var(--sheet-duration) var(--sheet-ease);
    will-change: transform;
  }

  .places-surface.is-dragging {
    user-select: none;
    transition: none;
  }

  /* 손잡이 — 막대는 36×4px 이고, 손가락이 닿는 면만 넉넉히 둡니다. */
  .places-surface__grabber {
    display: grid;
    width: 100%;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: none;
  }

  .places-surface__grabber:active {
    cursor: grabbing;
  }

  .places-surface__grabber span {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgb(28 26 23 / 18%);
    transition: width var(--duration-base) var(--sheet-ease), background var(--duration-base) var(--ease-out);
  }

  /* 잡고 있는 동안 살짝 길어지고 진해집니다. */
  .places-surface__grabber:active span,
  .places-surface.is-dragging .places-surface__grabber span,
  .places-surface__grabber:focus-visible span {
    width: 48px;
    background: rgb(28 26 23 / 40%);
  }

  /* 시트 안은 위에서 아래로 — 제목줄, 칩줄, 목록. */
  .places-surface__heading {
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-5) var(--space-3);
    transition: opacity var(--duration-base) var(--ease-out);
  }

  .places-surface__eyebrow,
  .places-surface__hint,
  .places-surface .trend-keywords {
    display: none;
  }

  .places-surface__sort {
    display: block;
    margin: 0;
  }

  .places-surface__heading h2 {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-body);
    line-height: 1.3;
    white-space: nowrap;
  }

  .places-surface .category-filter {
    min-width: 0;
    gap: var(--space-2);
    padding: 0 var(--space-5) var(--space-3);
    border-bottom: 0;
    transition: opacity var(--duration-base) var(--ease-out);
  }

  .places-surface__body {
    border-top: 1px solid var(--border-subtle);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-overflow-scrolling: touch;
    transition: opacity var(--duration-base) var(--ease-out);
  }

  .places-surface[data-sheet-state="collapsed"] .places-surface__heading,
  .places-surface[data-sheet-state="collapsed"] .category-filter,
  .places-surface[data-sheet-state="collapsed"] .places-surface__body {
    opacity: 0;
    pointer-events: none;
  }

  .places-surface.is-showing-detail .places-surface__heading,
  .places-surface.is-showing-detail .category-filter {
    display: none;
  }

  /* 핀 선택 카드일 때 시트를 카드 높이만큼만 띄우는 일은 JS 가 합니다
     (map_controller 의 sheetSnapPositions). 시트 안 .map-mode-pane 이 absolute 라
     높이에 기여하지 않아서, height:auto 로는 시트가 손잡이만 남기고 접힙니다. */

  .brand-lockup {
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 50%;
  }

  .brand-name {
    font-size: var(--text-lg);
  }

  .brand-tagline {
    max-width: 145px;
    margin-top: var(--space-1);
    overflow: hidden;
    font-size: var(--text-2xs);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 내 위치 — 지도 우상단에 떠 있는 44px 원. */
  .location-button {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    background: var(--surface-page);
    box-shadow: var(--shadow-float);
  }

  .map-course-create-link {
    display: none;
  }

  .location-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .map-configuration {
    width: calc(100% - 24px);
    padding: var(--space-6) var(--space-6);
    border-radius: var(--radius);
  }

  .map-configuration h2 {
    font-size: var(--text-xl);
  }

  .map-configuration p {
    font-size: var(--text-sm);
  }

  .place-list-item__copy {
    gap: 2px;
  }

  .place-list-item__toggle {
    right: var(--space-2);
    width: 26px;
    height: 26px;
  }

  /* 안전 영역은 시트 본문(.places-surface__body)이 이미 한 번 잡습니다.
     여기서 또 더하면 탭바가 있는 화면에서 카드 밑에 빈 칸이 두 겹으로 남습니다. */
  .place-card {
    padding: var(--space-2) var(--space-5) var(--space-5);
  }

  /* 긴 소개문은 세 줄까지만 — 시트 안에서 카드가 한 화면을 넘지 않게. */
  .place-card__description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .map-status {
    top: 145px;
  }

  .map-toast {
    top: 150px;
    bottom: auto;
  }

}

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

.map-canvas img[src*="map.naver.net"],
.map-canvas img[src*="nrbe.pstatic.net"],
.map-canvas img[src*="map.pstatic.net/nrb/"],
.course-editor-live-map__canvas img[src*="map.naver.net"],
.course-editor-live-map__canvas img[src*="nrbe.pstatic.net"],
.course-editor-live-map__canvas img[src*="map.pstatic.net/nrb/"],
.course-share-map__canvas img[src*="map.naver.net"],
.course-share-map__canvas img[src*="nrbe.pstatic.net"],
.course-share-map__canvas img[src*="map.pstatic.net/nrb/"] {
  filter: url("#map-tone") !important;
}

@media (max-width: 700px) {
  .map-canvas img[src*="map.naver.net"],
  .map-canvas img[src*="nrbe.pstatic.net"],
  .map-canvas img[src*="map.pstatic.net/nrb/"] {
    filter: saturate(0.35) !important;
  }
}

.map-tone-filter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.district-label {
  display: block;
  width: 88px;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  line-height: 24px;
  letter-spacing: var(--label-tracking);
  text-align: center;
  text-shadow: 0 1px 0 #fff, 0 0 3px #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.86;
}

.rail-station-overlay {
  position: relative;
  display: block;
  width: 176px;
  height: 26px;
  color: var(--muted);
  pointer-events: none;
}

.rail-station-overlay__dot {
  position: absolute;
  top: var(--space-3);
  left: var(--space-1);
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid rgb(253 252 249 / 92%);
  border-radius: 50%;
  background: var(--rail-station-fill);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 11%);
}

.rail-station-overlay__name {
  position: absolute;
  top: var(--space-1);
  left: var(--space-4);
  display: block;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.015em;
  text-shadow:
    0 1px 0 #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.rail-station-overlay.is-named .rail-station-overlay__name {
  opacity: 0.9;
  transform: translateX(0);
}

.rail-station-overlay--transfer .rail-station-overlay__dot {
  top: var(--space-2);
  left: var(--space-1);
  width: 8px;
  height: 8px;
  border-width: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 22%);
}

.rail-station-overlay--transfer .rail-station-overlay__name {
  color: #56534f;
  font-weight: var(--weight-strong);
}

/* ─── 광안리 3시간 코스 ─────────────────────────────── */

.map-header__actions {
  display: flex;
  gap: var(--space-2);
  pointer-events: auto;
}

.course-button.is-active {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.map-course-create-link {
  border-color: var(--ink);
  color: var(--gray-0);
  background: var(--ink);
}

.map-course-create-link:hover {
  border-color: #000;
  color: var(--gray-0);
  background: #000;
}

.course-stop {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.course-stop__index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: var(--gray-0);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  background: var(--spark);
  box-shadow: none;
}

.course-stop__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--gray-0);
  box-shadow: none;
}

.course-stop__name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-body);
}

.course-stop__stay {
  color: var(--muted);
  font-size: var(--text-2xs);
  letter-spacing: 0.02em;
}

.course-walk {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border: 1px solid rgb(var(--accent-rgb) / 26%);
  border-radius: var(--radius-pill);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: rgb(252 250 247 / 92%);
}

.course-summary {
  position: absolute;
  z-index: 1150;
  bottom: var(--space-6);
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
  pointer-events: none;
}

.course-summary.is-open {
  opacity: 1;
  transform: translate(-50%, 0);
}

.course-summary strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
}

.course-summary span {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
}

.course-summary__figures {
  margin-top: var(--space-1);
  color: var(--accent-strong) !important;
}

@media (width <= 700px) {
  .map-header__actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .course-summary {
    width: calc(100% - 48px);
  }
}

.course-stop--flip {
  flex-direction: row-reverse;
  transform: translateX(calc(-100% + 26px));
}

/* ─── 요즘 설렘 (트렌드 키워드 + 랭킹) ─────────────────── */

.trend-keywords {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-6) var(--space-3);
}

.trend-keywords__label {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
}

.trend-keywords__chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.trend-keywords__chips::-webkit-scrollbar {
  display: none;
}

.trend-keyword-chip {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-xs);
  background: transparent;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
  box-shadow: var(--control-shadow);
}

.trend-keyword-chip:hover {
  color: var(--accent-strong);
}

.trend-keyword-chip.is-active {
  border-color: rgb(var(--accent-rgb) / 42%);
  color: var(--accent-strong);
  background: var(--rose-50);
}

/* ═══════════════════════════════════════════════════════════════════
   지도 셸 + 공용 상단 헤더
   브랜드명·전체 네비는 헤더가 가져갔고, 지도 안에는 스팟/코스 전환과
   목록 패널만 남습니다. 헤더 높이를 숫자로 박지 않고 flex 로 남은 높이를
   지도에 주기 때문에, map_controller 의 시트 스냅 계산(.map-page 높이 기준)이
   그대로 맞습니다.
   ═══════════════════════════════════════════════════════════════════ */

/* 지도 화면만 팔레트를 따로 두던 블록은 걷어냈습니다. 와인은 tokens.css 의 한 벌이고,
   글자·아이콘은 진한 쪽(--accent-strong)을 쓰기 때문에 지도에서도 대비가 남습니다. */
html body:has(.map-page) {
  display: flex;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

html body:has(.map-page) .map-page {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* 지도 위에서는 헤더가 스크롤될 일이 없어 흐름에 그대로 둡니다. */
body:has(.map-page) .mag-header {
  position: relative;
  z-index: 1600;
  flex: 0 0 auto;
}

/* 지도 안 스팟/코스 전환 */
/* 캡션이 한 줄을 차지하므로 아래 줄에서 컨트롤들이 나란히 놓이게 합니다. */
.map-header__left {
  flex-wrap: wrap;
}

.map-mode-nav {
  display: inline-flex;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--control-shadow);
  pointer-events: auto;
}

.map-mode-nav__item {
  display: inline-flex;
  min-height: 32px;
  white-space: nowrap;
  align-items: center;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}

.map-mode-nav__item:hover {
  color: var(--ink);
}

.map-mode-nav__item.is-active {
  color: var(--accent-strong);
  background: var(--accent-tint);
}

/* ─── 지도 ⇄ 매거진 모드 토글 (헤더 공용) ──────────────── */

.mode-toggle {
  display: inline-flex;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.mode-toggle__item {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}

.mode-toggle__item:hover {
  color: var(--ink);
}

.mode-toggle__item.is-active {
  color: var(--accent-strong);
  background: var(--accent-tint);
}

/* 모드 설명 — 지도 안에서만 보이는 짧은 캡션 */
.map-mode-caption {
  order: -1;
  width: 100%;
  margin: 0 0 var(--space-2) var(--space-1);
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-body);
  text-shadow: 0 1px 0 #fff, 0 0 6px #fff;
  pointer-events: none;
}

/* 좁은 화면에서는 지도 면적이 아까워 캡션을 접습니다.
   (map_controller 가 참조하는 타깃이라 요소 자체는 남깁니다.) */
@media (max-width: 700px) {
  .map-mode-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* ─── 브랜드 카드 내 서브 네비게이션 ─────────────────── */

.brand-nav {
  display: flex;
  gap: 0;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.brand-nav a {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

.brand-nav a + a::before {
  margin: 0 var(--space-2);
  color: var(--line);
  content: "·";
}

.brand-nav a:hover {
  color: var(--accent-strong);
}

.brand-nav a.is-active {
  color: var(--accent-strong);
}

/* ─── 지도 코스 모드 — 동선 고르는 줄 ────────────────────
   읽는 코스 카드 목록은 /courses 가 따로 맡습니다. 지도 안에서는 '어떤 동선을
   지도에 그릴지' 고르기만 하면 되므로 줄 하나에 번호·이름·동네만 둡니다. */

.courses-index-picks {
  display: flex;
  flex-direction: column;
}

.courses-index-pick {
  display: grid;
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  gap: var(--space-3);
  align-items: center;
  margin: 0;
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-top: 1px solid var(--border-subtle);
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out);
}

.courses-index-pick:first-child {
  border-top: 0;
}

.courses-index-pick:hover,
.courses-index-pick.is-active {
  background: var(--surface-sunken);
}

.courses-index-pick:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 42%);
  outline-offset: -2px;
}

.courses-index-pick__number {
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.courses-index-pick__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.courses-index-pick__copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.courses-index-pick__copy em {
  color: var(--gray-500);
  font-size: var(--text-2xs);
  font-style: normal;
}

.courses-index-pick__arrow {
  color: var(--gray-400);
  transition: color var(--duration-base) var(--ease-out);
}

.courses-index-pick:hover .courses-index-pick__arrow,
.courses-index-pick.is-active .courses-index-pick__arrow {
  color: var(--ink);
}

/* 전체 목록으로 나가는 문 — 지도 밖의 읽는 화면입니다. */
.courses-index-more {
  display: inline-block;
  margin-top: var(--space-3);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

.courses-index-more:hover {
  color: var(--ink);
}


.map-header__actions [hidden] {
  display: none;
}

.map-mode-stack {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
}

.map-mode-pane {
  position: absolute;
  inset: 0;
  display: flex;
  min-height: 0;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-out), visibility 0s linear var(--duration-fast);
}

.map-mode-pane.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.map-mode-pane--courses .courses-index-surface__body {
  min-height: 0;
  flex: 1 1 auto;
}

.map-course-list-summary {
  position: absolute;
  z-index: 1060;
  top: var(--space-12);
  left: 412px;
  display: grid;
  width: min(310px, calc(100% - 440px));
  gap: var(--space-1);
  padding: var(--space-4) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--sheet-ease);
}

.map-course-list-summary.is-open {
  opacity: 1;
  transform: translateY(0);
}

.map-course-list-summary[hidden] {
  display: none;
}

.map-course-list-summary p {
  margin: 0;
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.15em;
}

.map-course-list-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-course-list-summary > span {
  color: var(--muted);
  font-size: var(--text-2xs);
}

.map-course-list-summary a {
  justify-self: end;
  margin-top: var(--space-1);
  color: var(--accent-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  text-decoration: none;
}

.map-course-list-summary a[hidden] {
  display: none;
}

.map-course-list-summary a:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 46%);
  outline-offset: 3px;
}

.map-course-list-status {
  position: absolute;
  z-index: 1090;
  right: var(--space-6);
  bottom: var(--space-6);
  max-width: min(320px, calc(100% - 48px));
  margin: 0;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-2xs);
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.map-course-list-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-intro {
  position: absolute;
  z-index: 1040;
  top: 31%;
  left: 50%;
  margin: 0;
  color: rgb(26 26 26 / 82%);
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: var(--display-weight);
  letter-spacing: -0.035em;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 12px rgb(255 255 255 / 92%);
  transform: translate(-50%, 9px);
  white-space: nowrap;
}

.map-intro.is-visible {
  animation: map-intro-fade-up 3.1s var(--ease-out) both;
}

.map-intro[hidden] {
  display: none;
}

@keyframes map-intro-fade-up {
  0% { opacity: 0; transform: translate(-50%, 9px); }
  18%, 68% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -3px); }
}

@media (max-width: 700px) {
  .subpage-header {
    margin-bottom: var(--space-7);
  }

  .subpage-header__top {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
    gap: var(--space-1);
    padding: var(--space-2) 0 var(--space-3);
  }

  /* 좁은 화면은 뒤로가기·내비만 남깁니다. 로고까지 쌓으면 세 줄이 됩니다. */
  .subpage-header__logo {
    display: none;
  }

  .subpage-header__nav {
    justify-self: start;
  }

  /*
   * 붙어 있는 바라 높이가 곧 뺏기는 화면입니다. 다섯 항목이 두 줄로 접히면
   * 바가 157px 까지 커져서(사전·기록·소개) 한 줄로 눕히고 넘치면 옆으로 굴립니다.
   * 유틸리티 바(.mag-util__links)와 같은 방식입니다.
   */
  .subpage-header__nav ul {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .subpage-header__nav ul::-webkit-scrollbar {
    display: none;
  }

  .subpage-header__nav li {
    white-space: nowrap;
  }

  .subpage-header__nav li + li::before {
    margin: 0 var(--space-2);
  }

  .subpage-header__intro {
    padding: var(--space-8) 0 var(--space-7);
  }

  .brand-lockup {
    max-width: calc(100vw - 84px);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
  }

  .brand-name {
    font-size: var(--text-lg);
  }

  .brand-tagline {
    display: none;
  }

  .brand-nav {
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    white-space: nowrap;
  }

  .brand-nav a {
    font-size: var(--text-2xs);
  }

  .brand-nav a + a::before {
    margin: 0 var(--space-1);
  }
}

/* ─── 모바일 하단 탭바 ───────────────────────────────── */

/*
 * 모바일에서 코스·트렌드·캘린더·사전·기록·쿠폰이 브랜드 카드 안 작은 글씨로만
 * 존재해 잘 보이지 않아서, 화면 아래 고정 탭바로 꺼냈습니다.
 * 데스크톱은 기존 브랜드 카드 / 서브페이지 헤더 네비를 그대로 씁니다.
 */
.bottom-nav {
  position: fixed;
  z-index: 2000;
  right: 0;
  bottom: 0;
  left: 0;
  padding-bottom: var(--bottom-nav-inset);
  border-top: 1px solid var(--hairline-soft);
  background: var(--surface-veil);
  backdrop-filter: blur(10px);
  box-shadow: 0 -6px 20px rgb(28 26 23 / 7%);
}

.bottom-nav__tabs {
  display: grid;
  height: var(--bottom-nav-height);
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bottom-nav__tab {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--gray-500);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

/* 현재 탭 표시는 먹색 + 굵기까지만. 색면도 밑줄도 쓰지 않습니다. */
.bottom-nav__tab.is-active {
  color: var(--ink);
  font-weight: var(--weight-strong);
}

.bottom-nav__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.bottom-nav__icon svg {
  display: block;
}

.bottom-nav__label {
  line-height: 1;
}

/* 데스크톱은 지금 방식 그대로 — 탭바를 띄우지 않습니다. */
@media (width > 700px) {
  .bottom-nav {
    display: none;
  }
}

@media (width <= 700px) {
  .map-course-list-summary {
    top: var(--space-11);
    right: var(--space-3);
    left: var(--space-3);
    width: auto;
    padding: var(--space-3) var(--space-4);
  }

  .map-course-list-summary strong {
    font-size: var(--text-base);
  }

  .map-course-list-status {
    right: var(--space-3);
    bottom: var(--space-10);
    left: var(--space-3);
    max-width: none;
  }

  .places-surface[data-sheet-state="collapsed"] .map-mode-pane {
    opacity: 0;
    pointer-events: none;
  }

  .map-intro {
    top: 27%;
    font-size: var(--text-xl);
  }
}

@media (width <= 700px) {
  body.has-bottom-nav {
    padding-bottom: var(--bottom-nav-total);
  }

  /*
   * 지도는 탭바 위쪽만 차지하게 합니다. .map-page 가 짧아지면 그 안에 절대 배치된
   * 시트·줌 컨트롤·코스 요약이 함께 올라오고, map_controller 의 스냅 위치도
   * .map-page 높이에서 다시 계산되므로 JS 를 건드리지 않아도 3단 스냅이 그대로 맞습니다.
   */
  body.has-bottom-nav .map-page {
    height: calc(100dvh - var(--bottom-nav-total));
  }

  /* 안전 영역은 탭바가 이미 덮으므로 시트 목록에서 한 번 더 띄우지 않습니다. */
  body.has-bottom-nav .places-surface__body {
    padding-bottom: 0;
  }

  /* 하단 탭바와 같은 링크라 브랜드 카드 안 텍스트 네비는 감춥니다. (데스크톱은 유지) */
  body.has-bottom-nav .brand-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-mode-pane,
  .map-course-list-summary,
  .map-course-list-status {
    transition: none;
  }

  .map-intro {
    display: none;
    animation: none;
  }

  .bottom-nav__backdrop,
  .bottom-nav__sheet,
  .bottom-nav__tab {
    transition: none;
  }

  .bottom-nav__sheet {
    transform: none;
  }
}

.subpage-header {
  position: relative;
  isolation: isolate;
}

/*
 * 헤더 뒤로 지면을 꽉 채우는 색면. 폭은 뷰포트가 아니라 '문서가 실제로 쓰는 폭'이어야
 * 합니다. 100vw 는 클래식 스크롤바 폭까지 포함해서 그만큼(≈7px) 가로 스크롤을 만듭니다.
 * --viewport-width 는 레이아웃의 인라인 스크립트가 documentElement.clientWidth 로 채웁니다.
 * (스크립트가 없으면 100vw 로 떨어져 예전 동작 그대로입니다.)
 */
.subpage-header::before {
  position: absolute;
  z-index: -1;
  inset: 0 50%;
  width: var(--viewport-width, 100vw);
  content: "";
  background: var(--cream);
  transform: translateX(-50%);
}

.subpage-header__eyebrow,
.subpage-header__current {
  color: var(--cobalt);
}

.subpage-header__back:hover,
.subpage-header__nav a:hover,
.places-list-footer a:hover {
  color: var(--accent-strong);
}

.subpage-header {
  border-top: 1px solid var(--editorial-frame);
  border-bottom-color: var(--editorial-frame);
}

.subpage-header__top {
  border-bottom-color: var(--editorial-frame);
}

.subpage-header::before {
  background: var(--paper);
}

.subpage-header__eyebrow,
.subpage-header__current,
.bottom-nav__sheet-arrow {
  color: var(--pink-strong);
}
