/* 동네친구 / Dongne Chingu
   Orange is the pojangmacha tent: the colour of "where locals go".
   Hangul is set in Black Han Sans so Korean text reads like a shop sign. */

:root {
  --tarp: #F2671F;
  --tarp-deep: #B94A0C;
  --tarp-soft: #FFD9C2;
  --ink: #172036;
  --slate: #5E6883;
  --surface: #FFFFFF;
  --surface-2: #F2F3F6;
  --line: #E1E4EB;
  --lift: 0 8px 28px rgba(23, 32, 54, 0.16);

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Hiragino Sans", "PingFang SC", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif;
  --hangul: "Black Han Sans", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bottom-h: 180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface-2);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--tarp-deep); }
:focus-visible { outline: 3px solid var(--tarp); outline-offset: 2px; }
[lang="ko"] { word-break: keep-all; }

#map { position: fixed; inset: 0; z-index: 0; background: var(--surface-2); }
/* Quiet the busy OSM colours so the orange pins carry the map. */
#map.leaflet-container { background: #F4F1EA; }
/* Full colour, softened a little so the bubbles and pins stay on top. */
.leaflet-tile-pane { filter: saturate(0.85) brightness(1.04) contrast(0.92); }
.leaflet-container { font-family: var(--font); }
/* Map credit sits on the very bottom edge, below the place cards (OSM requires it to stay visible). */
.leaflet-bottom { bottom: var(--safe-b); }
.leaflet-control-attribution { font-size: 10px; line-height: 1.5; }

/* ---------- top ---------- */
.top {
  position: fixed;
  top: calc(var(--safe-t) + 12px);
  left: 12px;
  right: 12px;
  z-index: 500;
  display: grid;
  justify-items: start;
  gap: 8px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name langs" "tag tag";
  align-items: center;
  gap: 4px 10px;
  padding: 10px 10px 10px 14px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--lift);
}
/* Romanized name sits under the Hangul one, so four language buttons never squeeze it into "Dongne Chin…". */
.brand__name { grid-area: name; min-width: 0; margin: 0; font-size: 1rem; line-height: 1; font-weight: 400; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; white-space: nowrap; }
.brand__ko { font-family: var(--hangul); font-size: 25px; letter-spacing: -0.01em; color: var(--tarp); }
.brand__ro { max-width: 100%; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--slate); overflow: hidden; text-overflow: ellipsis; }
.brand__tag { grid-area: tag; margin: 0; font-size: 13px; color: var(--slate); }

.langs { grid-area: langs; display: flex; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.langs button {
  border: 0;
  background: transparent;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
}
.langs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 11px;
  max-width: 100%;
  padding: 7px 12px;
  border: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--lift);
  font-size: 13px;
  text-align: left;
}
.legend__item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend__how { color: var(--tarp-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.swatch--local { background: var(--tarp); }
.swatch--mixed { background: var(--tarp-soft); }
.swatch--tourist { background: #fff; box-shadow: inset 0 0 0 1.5px var(--slate); }

.maker-note {
  margin: 0;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.hint {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(100%, 380px);
  padding: 9px 10px 9px 12px;
  border-left: 4px solid var(--tarp);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--lift);
  font-size: 14px;
  line-height: 1.35;
}
.hint[hidden] { display: none; }
.hint p { margin: 0; }
.hint strong { color: var(--tarp-deep); font-weight: 800; white-space: nowrap; }
.hint button {
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* The neighbourhood's station: walk times and courses start here. */
.here {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-10px, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(23, 32, 54, 0.28);
}
.here svg { width: 14px; height: 14px; }

/* ---------- course ---------- */
.pin__step {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin: -1px 5px -1px -3px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
}
.chip--course { display: inline-flex; align-items: center; gap: 5px; border-color: var(--tarp); color: var(--tarp-deep); font-weight: 600; }
.chip--course svg { width: 15px; height: 15px; }
.chip--course[aria-pressed="true"] { background: var(--tarp); border-color: var(--tarp); color: #fff; }
.card.card--course {
  grid-template-columns: 1fr;
  align-content: center;
  gap: 4px;
  background: var(--ink);
  color: #fff;
}
.card.card--course .card__name { display: flex; align-items: center; gap: 6px; white-space: normal; }
.card.card--course .card__name svg { width: 18px; height: 18px; flex: none; color: var(--tarp); }
.card.card--course .card__meta { color: rgba(255, 255, 255, 0.75); white-space: normal; }
.course__blurb { font-size: 13.5px; line-height: 1.35; color: rgba(255, 255, 255, 0.9); }
.thumb-wrap { position: relative; display: block; }
.step {
  position: absolute;
  top: -6px;
  left: -6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 0 2px #fff;
}
.sheet__step { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--tarp-soft); color: var(--tarp-deep); font-size: 13.5px; font-weight: 600; }
.sheet__step svg { width: 15px; height: 15px; }
.next-stop {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-align: left;
}
.next-stop > svg { grid-column: 2; grid-row: 1 / span 3; width: 22px; height: 22px; }
.next-stop__label { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); }
.next-stop__name { font-size: 17px; font-weight: 700; }
.next-stop__leg { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.next-stop__leg svg { width: 13px; height: 13px; }

/* ---------- pins ---------- */
.pin-wrap { background: none; border: 0; }
.pin {
  --pin-bg: var(--surface);
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 7px));
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 5px;
  border-radius: 8px;
  background: var(--pin-bg);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 10px rgba(23, 32, 54, 0.28);
  transition: transform 0.18s ease;
}
.pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom: 0;
  border-top-color: var(--pin-bg);
}
.pin--local { --pin-bg: var(--tarp); color: #fff; }
.pin--mixed { --pin-bg: var(--tarp-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--tarp), 0 3px 10px rgba(23, 32, 54, 0.28); }
.pin--tourist, .pin--unknown { color: var(--slate); box-shadow: inset 0 0 0 1.5px var(--slate), 0 3px 10px rgba(23, 32, 54, 0.22); }
.pin.is-active {
  transform: translate(-50%, calc(-100% - 7px)) scale(1.18);
  box-shadow: 0 0 0 3px var(--ink), 0 6px 16px rgba(23, 32, 54, 0.3);
}
.leaflet-marker-icon:focus-visible { outline: none; }
.leaflet-marker-icon:focus-visible .pin { box-shadow: 0 0 0 3px var(--tarp), 0 6px 16px rgba(23, 32, 54, 0.3); }

/* ---------- bottom rail ---------- */
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  padding-bottom: calc(var(--safe-b) + 20px);
  pointer-events: none;
}
.bottom > * { pointer-events: auto; }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 12px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar, .rail::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(23, 32, 54, 0.1);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12px;
  padding: 2px 12px 4px;
  scrollbar-width: none;
}
.card {
  flex: 0 0 min(80vw, 310px);
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--lift);
  text-align: left;
}
.card.is-active { box-shadow: 0 0 0 2.5px var(--ink), var(--lift); }
.card__text { display: grid; gap: 2px; min-width: 0; }
.card__name { font-weight: 700; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__ko { font-family: var(--hangul); font-size: 14px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-size: 13px; color: var(--slate); white-space: nowrap; }
.card__tier { overflow: hidden; text-overflow: ellipsis; }
.card__walk, .sheet__walk { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.card__walk { flex: none; }
.card__walk::before { content: "·"; margin-right: 3px; }
.card__walk svg { width: 13px; height: 13px; }
.sheet__walk { gap: 5px; font-size: 14px; color: var(--slate); }
.sheet__walk svg { width: 16px; height: 16px; }
.card--empty { grid-template-columns: 1fr; color: var(--slate); }

.thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--tarp-soft);
  color: var(--tarp);
  font-family: var(--hangul);
  font-size: 34px;
  line-height: 1;
}

.badge {
  display: inline-block;
  padding: 2px 7px 3px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--slate);
  box-shadow: inset 0 0 0 1.5px var(--slate);
}
.badge--local { background: var(--tarp); color: #fff; box-shadow: none; }
.badge--mixed { background: var(--tarp-soft); color: var(--ink); box-shadow: none; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(23, 32, 54, 0.24);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: calc(var(--safe-b) + 28px);
}
.sheet.is-open { transform: none; }

.sheet__media { position: relative; }
.sheet__photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.sheet__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 76px;
  background: var(--tarp-soft);
  color: var(--tarp);
  font-family: var(--hangul);
  font-size: 44px;
  line-height: 1;
}
.sheet__closebar { position: sticky; top: 0; height: 0; z-index: 2; }
.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--lift);
}
.sheet__body { padding: 20px 20px 0; max-width: 640px; }
.sheet__body.info { padding-top: 26px; }
.sheet__body.info .sheet__name { padding-right: 56px; }
.sheet__name { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.sheet__ko { margin: 6px 0 0; font-family: var(--hangul); font-size: 18px; color: var(--slate); }
.sheet__cat { margin: 4px 0 0; font-size: 15px; color: var(--slate); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }

.block { margin-top: 28px; }
.block h3 { margin: 0 0 10px; font-size: 17px; font-weight: 800; }
.fine { margin: 10px 0 0; font-size: 13px; color: var(--slate); }

.ratio__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ratio__head .badge { font-size: 16px; padding: 3px 9px 4px; }
.ratio__line { margin: 0 0 12px; font-size: 15px; }
.bars { display: grid; gap: 10px; }
.bars__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: end; }
.bars__label { font-size: 14px; font-weight: 600; }
.bars__label small { display: block; font-weight: 400; color: var(--slate); font-size: 12px; }
.bars__n { font-weight: 800; font-variant-numeric: tabular-nums; }
.bars__track { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: 5px; min-width: 3px; }
.bars__fill--kr { background: var(--tarp); }
.bars__fill--tr { background: var(--slate); }

.note { margin: 0 0 12px; font-size: 17px; line-height: 1.6; }
.says { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: 16px; }

.order__ko { margin: 0; font-family: var(--hangul); font-size: 24px; line-height: 1.2; }
.order__roman { margin: 2px 0 0; color: var(--slate); font-size: 14px; }
.order__mean { margin: 4px 0 0; font-size: 16px; }

.say__card { padding: 18px; border-radius: 16px; border: 2px solid var(--tarp); }
.say__ko { margin: 0; font-family: var(--hangul); font-size: 30px; line-height: 1.25; }
.say__roman { margin: 6px 0 0; color: var(--slate); font-size: 15px; }
.say__mean { margin: 2px 0 14px; font-size: 16px; }
.say__btns { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--tarp); border-color: var(--tarp); color: #fff; }
.btn.is-playing { background: var(--ink); border-color: var(--ink); color: #fff; }
.credit { display: block; margin-top: 6px; font-size: 12px; color: var(--slate); }

.addr { margin: 0 0 12px; font-size: 18px; font-weight: 600; line-height: 1.4; user-select: all; -webkit-user-select: all; }

.links { display: grid; gap: 8px; margin-top: 28px; }
.links .btn { justify-content: flex-start; }

.info p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; }
.info .legend-rows { display: grid; gap: 8px; margin: 4px 0 16px; }
.info .legend-rows div { display: flex; align-items: center; gap: 10px; }

/* ---------- show-to-staff sign ---------- */
.sign {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--safe-t) + 32px) 24px calc(var(--safe-b) + 64px);
  border: 0;
  background: var(--tarp);
  color: #fff;
  text-align: center;
}
.sign[hidden] { display: none; }
.sign__ko { font-family: var(--hangul); font-size: clamp(52px, 16vw, 150px); line-height: 1.12; word-break: keep-all; }
.sign__roman { font-size: 18px; font-weight: 600; }
.sign__mean { font-size: 17px; opacity: 0.9; }
.sign__hint { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 24px); font-size: 14px; opacity: 0.85; }

/* ---------- toast / error ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 16px);
  z-index: 1100;
  transform: translate(-50%, -150%);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transition: transform 0.25s ease;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }

.load-error {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface-2);
  text-align: center;
}

/* ---------- wide screens: sheet becomes a side panel ---------- */
@media (min-width: 900px) {
  .top { left: auto; width: 460px; right: 16px; justify-items: end; }
  .sheet {
    top: 16px;
    bottom: 16px;
    left: 16px;
    right: auto;
    width: 420px;
    max-height: none;
    border-radius: 20px;
    transform: translateX(calc(-100% - 32px));
    padding-bottom: 28px;
  }
  .sheet.is-open { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .toast, .pin { transition: none; }
}

/* ---------- first load: pins drop in one by one ---------- */
@keyframes pin-drop {
  0% { opacity: 0; transform: translate(-50%, calc(-100% - 46px)) scale(0.6); }
  60% { opacity: 1; transform: translate(-50%, calc(-100% - 2px)) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, calc(-100% - 7px)); }
}
.pin.is-intro { animation: pin-drop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; animation-delay: calc(var(--i, 0) * 120ms + 250ms); }
.pin.is-dim { opacity: 0.35; }

/* ---------- "Play my day" ---------- */
.play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 11px 18px 11px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--tarp);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(242, 103, 31, 0.45);
  animation: play-pulse 2.4s ease-in-out 2.6s 3;
}
.play[hidden] { display: none; }
.play svg { width: 16px; height: 16px; }
.play small { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); font-size: 12px; }
.play.is-on { background: var(--ink); box-shadow: var(--lift); animation: none; }
@keyframes play-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(242, 103, 31, 0.45), 0 0 0 0 rgba(242, 103, 31, 0.5); }
  50% { box-shadow: 0 6px 18px rgba(242, 103, 31, 0.45), 0 0 0 12px rgba(242, 103, 31, 0); }
}

.tour-cap {
  max-width: min(100%, 420px);
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--lift);
}
.tour-cap[hidden] { display: none; }
.tour-cap.is-in { animation: cap-in 0.35s ease both; }
@keyframes cap-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.tour-cap p { margin: 0; }
.tour-cap__top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tour-cap .step { position: static; width: 22px; height: 22px; font-size: 12px; background: var(--tarp); box-shadow: none; }
.tour-cap__count { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, 0.7); }
.tour-cap__credit { margin-left: auto; font-size: 11.5px; color: var(--tarp-soft); }
.tour-cap__name { font-size: 18px; font-weight: 800; line-height: 1.25; }
.tour-cap__name [lang="ko"] { font-family: var(--hangul); font-weight: 400; font-size: 15px; color: rgba(255, 255, 255, 0.7); }
.tour-cap__note { margin-top: 6px !important; font-size: 14.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.92); }
body.is-touring .legend, body.is-touring .hint, body.is-touring .maker-note { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pin.is-intro, .play, .tour-cap.is-in { animation: none; }
}

/* ---------- course stops as illustrated speech bubbles ---------- */
.bub-line { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.bub-line line { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.bub-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--ink), 0 2px 6px rgba(23, 32, 54, 0.3);
}
.bub-dot--local { background: var(--tarp); }
.bub-dot--mixed { background: var(--tarp-soft); }
.bub {
  position: absolute;
  left: 0;
  top: 0;
  width: 104px;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.bub__in {
  display: block;
  position: relative;
  padding: 5px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--ink), 0 8px 18px rgba(23, 32, 54, 0.28);
  transition: transform 0.2s ease;
}
.bub__in img { display: block; width: 94px; height: 94px; border-radius: 11px; object-fit: cover; }
.bub__ratio { position: absolute; top: -9px; right: -9px; box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(23, 32, 54, 0.3); }
.bub__label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 1px 1px;
  min-height: 32px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.12;
  overflow: hidden;
}
.bub__step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
}
.bub:hover .bub__in { transform: scale(1.05); }
.bub.is-active { z-index: 2; }
.bub.is-active .bub__in { transform: scale(1.14); box-shadow: 0 0 0 4px var(--tarp), 0 12px 24px rgba(23, 32, 54, 0.35); }
.bub.is-dim { opacity: 0.45; }
.leaflet-marker-icon:has(.bub.is-active) { z-index: 9000 !important; }
@keyframes bub-pop {
  0% { opacity: 0; transform: translateY(18px) scale(0.4); }
  70% { opacity: 1; transform: translateY(-4px) scale(1.06); }
  100% { opacity: 1; transform: none; }
}
.bub.is-intro .bub__in { animation: bub-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; animation-delay: calc(var(--i, 0) * 140ms + 250ms); }

.sheet__illust { aspect-ratio: 16 / 10; object-position: center 60%; }
.tour-cap__next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 12px 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--tarp);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.tour-cap__next svg { width: 15px; height: 15px; }
.course__blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .bub.is-intro .bub__in { animation: none; }
}

/* Korean mode: the Korean name line would repeat the title. */
html[lang="ko"] .card__ko, html[lang="ko"] .sheet__ko { display: none; }

/* "Why this map?": the maker's intent, opened as a sheet. */
.why {
  margin-left: 2px;
  padding: 2px 9px;
  border: 1.5px solid var(--tarp);
  border-radius: 999px;
  background: var(--surface);
  color: var(--tarp-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: 1px;
}

/* ---------- compact bubbles (mockup) ---------- */
.bub { width: 76px; }
.bub__in { padding: 4px; border-radius: 13px; box-shadow: 0 0 0 2.5px var(--ink), 0 6px 14px rgba(23, 32, 54, 0.25); }
.bub__in img { width: 68px; height: 62px; border-radius: 9px; }
.bub__step {
  position: absolute; top: -8px; left: -8px; display: grid; place-items: center;
  width: 21px; height: 21px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 11.5px; font-weight: 800; box-shadow: 0 0 0 2px #fff;
}
.bub__ratio { top: -8px; right: -8px; font-size: 11px; padding: 1px 5px; }
.bub__label {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: 0; padding: 3px 0 0; font-size: 10.5px; line-height: 1.1; text-align: center; white-space: normal;
}
.bub.is-active .bub__in { transform: scale(1.25); }

/* Several photos per place: swipe sideways, counter in the corner. */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery::-webkit-scrollbar { display: none; }
.gallery > .sheet__photo { flex: 0 0 100%; scroll-snap-align: start; }
.gallery__count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(23, 32, 54, 0.72);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  pointer-events: none;
}
