:root {
  --surface: #fff;
  --surface-soft: #f8fafd;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --blue: #1a73e8;
  --green: #188038;
  --amber: #fbbc04;
  --shadow: 0 2px 8px rgba(60, 64, 67, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  color: var(--text);
  background: #eef2f5;
}

button, input { font: inherit; }

#app {
  display: flex;
  height: 100vh;
  height: 100svh; /* 모바일 브라우저 주소창 유무에 따른 100vh 오차 보정 */
  overflow: hidden;
}

/* ---------- Search sidebar ---------- */
#sidebar {
  position: relative;
  z-index: 20;
  width: 336px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 2px 0 8px rgba(60, 64, 67, .15);
  transition: width .22s ease;
  overflow: hidden;
}

#app.sidebar-hidden #sidebar {
  width: 0;
  border-right: none;
  box-shadow: none;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 650;
  width: 18px;
  height: 52px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 0 6px rgba(0,0,0,.25);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: left .22s ease, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { color: var(--text); }
#app.sidebar-hidden .sidebar-toggle { border-left: 1px solid var(--line); border-radius: 6px; }

.search-header {
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.search-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.search-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
}

#search {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(60, 64, 67, .12);
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

#search:focus {
  outline: 2px solid rgba(26, 115, 232, .18);
  border-color: var(--blue);
}

.search-cancel-btn {
  display: none;
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 14px;
  padding: 0 2px;
  cursor: pointer;
  white-space: nowrap;
}
.search-cancel-btn:active { opacity: .6; }

.search-stats {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.search-section {
  padding: 10px 12px 4px;
  border-top: 1px solid var(--line);
}

.search-section h2 {
  margin: 0 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.city-list,
.region-list,
.journey-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-list,
.region-list {
  display: grid;
  gap: 3px;
}

.city-item,
.region-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.city-item:hover,
.region-item:hover { background: #f1f3f4; }

.city-item.active,
.region-item.active {
  background: #e8f0fe;
  color: #174ea6;
}

.item-main {
  min-width: 0;
}

.item-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.item-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.empty-result {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 13px;
}

.sb-footer {
  margin-top: auto;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.admin-link:hover {
  background: #e8f0fe;
  border-color: var(--blue);
  color: var(--blue);
}

/* ---------- Map ---------- */
#map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #dce8f2;
}

.map-title-card {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 500;
  width: min(460px, calc(100% - 32px));
  padding: 14px 16px;
}

.map-title-card,
.map-filter-card,
.legend,
.player {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(218, 220, 224, .9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.map-title-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.map-title-card p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#map-panels {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  width: min(450px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-filter-card {
  padding: 10px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
#map-filters.collapsed .filter-head,
#ref-layers.collapsed .filter-head { margin-bottom: 0; }
#map-filters.collapsed .journey-list,
#ref-layers.collapsed .journey-list { display: none; }
.filter-collapse-btn { font-size: 16px; padding: 2px 6px; line-height: 1; }

.filter-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 역사 지리: 배경·타이틀 없는 온/오프 칩 전용 */
#ref-layers {
  background: none;
  box-shadow: none;
  border: none;
  padding: 0;
}
#ref-layers .filter-head { display: none; }
#ref-layers.collapsed .journey-list { display: flex; }
#ref-layers .journey-item {
  flex-direction: row;
  align-items: center;
  padding: 5px 10px;
  border-radius: 20px;
}
#ref-layers .journey-actions { display: none; }

.filter-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 0;
}

/* ── 전도여행 필터: 칩 형태 (공통) ── */
.journey-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding: 2px 0 4px;
}

.journey-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  min-width: 0;
  transition: opacity .15s;
}
.journey-item:has(input:not(:checked)) { opacity: 0.42; }

.journey-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.journey-check input { display: none; }

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.journey-label {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.journey-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.mini-btn {
  flex: 1;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafd;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.mini-btn:hover {
  border-color: #a8c7fa;
  background: #e8f0fe;
  color: #174ea6;
}

/* ---------- 배경 지도 전환 ---------- */
#basemap-ctrl {
  position: absolute;
  bottom: 18px;
  left: 16px;
  z-index: 500;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(218, 220, 224, .9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.basemap-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 3px;
  cursor: pointer;
  transition: border-color .15s;
}
.basemap-opt:hover  { border-color: #c5d5ea; }
.basemap-opt.active { border-color: var(--blue); }

/* 접힌 상태: 현재 선택된 배경 지도 1개만 표시, 탭하면 전체 목록이 펼쳐짐 */
#basemap-ctrl:not(.open) .basemap-opt:not(.active) {
  display: none;
}

.basemap-thumb {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  display: block;
}
.basemap-thumb--sat    { background: linear-gradient(135deg, #2b5329 0%, #1a3a0f 40%, #4a7a40 100%); }
.basemap-thumb--esri-topo { background: linear-gradient(135deg, #c8a99d 0%, #eee7df 48%, #8fb7d6 100%); }
.basemap-thumb--hillshade { background: linear-gradient(135deg, #f4f4f4 0%, #c9c9c9 48%, #777 100%); }
.basemap-thumb--light  { background: linear-gradient(135deg, #f8f8f8 0%, #e2e2e2 50%, #f0f0f0 100%); }
.basemap-thumb--political { background: linear-gradient(135deg, #eee6d1 0%, #f3ecd9 45%, #bcdcea 100%); }

/* 정치 지도(국가 경계+이름) 배경 지도용 국가 이름 라벨 — 배경이므로 다른 요소보다 옅고 조용하게 */
.country-label {
  font-size: 11px;
  font-weight: 600;
  color: #5b6472;
  text-align: center;
  letter-spacing: 0.01em;
  text-shadow: 0 0 3px #fff, 0 0 4px #fff, 0 0 4px #fff;
  pointer-events: none;
  white-space: nowrap;
}

.basemap-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.legend {
  position: absolute;
  right: 76px;
  bottom: 18px;
  z-index: 500;
  padding: 10px 12px;
  font-size: 12px;
}

.legend .lg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  white-space: nowrap;
}

.legend .lg-line {
  width: 24px;
  height: 3px;
  border-radius: 2px;
}


/* ---------- Follow player ---------- */
.player {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 560;
  width: min(420px, 46vw);
  padding: 10px 14px 12px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(218, 220, 224, .9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.player.hidden { display: none; }

.pl-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.pl-title { font-weight: 700; font-size: 14px; }

.pl-step { color: var(--muted); font-size: 12px; }

.pl-city {
  margin-left: auto;
  color: #174ea6;
  font-size: 13px;
  font-weight: 700;
}

.pl-bar {
  height: 5px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 3px;
  background: #e8eaed;
}

.pl-bar-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width .3s ease;
}

.pl-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pl-controls button {
  width: 40px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafd;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: background .12s;
}

.pl-controls button:hover {
  background: #e8f0fe;
  color: #174ea6;
}

.pl-desc {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(218, 220, 224, .9);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Detail drawer ---------- */
.drawer-handle { display: none; }

.detail-drawer {
  position: absolute;
  top: 304px;
  right: 16px;
  bottom: 18px;
  z-index: 540;
  width: min(450px, calc(100% - 32px));
}

.detail-drawer.hidden { display: none; }

.detail-drawer-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(218, 220, 224, .92);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(60, 64, 67, .22);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #eef0f2;
}

.detail-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.detail-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.detail-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.detail-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafd;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Detail carousel ---------- */
.detail-carousel {
  flex-shrink: 0;
  background: #111;
  overflow: hidden;
}

.carousel-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1a1a2a;
  overflow: hidden;
}

.carousel-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 52px;
  background: rgba(0, 0, 0, .46);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s;
}
.carousel-arrow:hover { background: rgba(0, 0, 0, .75); }
.ca-prev { left: 5px; }
.ca-next { right: 5px; }

.carousel-counter {
  position: absolute;
  bottom: 7px;
  right: 9px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  pointer-events: none;
}

.carousel-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, .82);
  min-height: 28px;
}

.carousel-caption-text {
  flex: 1;
  font-size: 11px;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carousel-caption-text a {
  color: #8ab4f8;
  text-decoration: none;
}
.carousel-caption-text a:hover { text-decoration: underline; }

.carousel-mgr-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1;
}
.carousel-mgr-btn:hover { color: #fff; background: rgba(255, 255, 255, .14); }

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 5px 0 4px;
  background: rgba(0, 0, 0, .82);
}

.cdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: #555;
  cursor: pointer;
  padding: 0;
  transition: background .15s, transform .15s;
}
.cdot.active { background: #8ab4f8; transform: scale(1.3); }
.cdot:hover:not(.active) { background: #888; }

.carousel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  color: #666;
  font-size: 13px;
  background: #111;
}

/* ---------- Photo manager ---------- */
.pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pm-overlay.hidden { display: none; }

.pm-panel {
  background: var(--surface);
  border-radius: 12px;
  width: 500px;
  max-width: 94vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .38);
}

.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.pm-head-title { font-size: 15px; font-weight: 700; color: var(--text); }
.pm-head button {
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 2px 7px; border-radius: 5px;
}
.pm-head button:hover { background: #f1f3f4; }

.pm-body { flex: 1; overflow-y: auto; padding: 12px 16px 4px; }

.pm-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

.pm-photo-list { margin-bottom: 4px; }

.pm-photo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f3f4;
}
.pm-photo-item:last-of-type { border-bottom: none; }
.pm-photo-item.pm-hidden .pm-photo-thumb { opacity: .35; }
.pm-photo-item.pm-hidden .pm-photo-title { color: #aaa; }

.pm-photo-thumb {
  width: 66px;
  height: 46px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: #f1f3f4;
}

.pm-photo-info { flex: 1; min-width: 0; }
.pm-photo-title {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-photo-src { font-size: 11px; color: var(--muted); margin-top: 2px; }

.pm-photo-actions { display: flex; gap: 4px; flex-shrink: 0; }

.pm-btn {
  border: none;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}
.pm-btn-hide { background: #f1f3f4; color: #5f6368; }
.pm-btn-hide:hover { background: #e8eaed; }
.pm-btn-show { background: #e8f0fe; color: #1a73e8; }
.pm-btn-show:hover { background: #d2e3fc; }
.pm-btn-del { background: #fce8e6; color: #c5221f; }
.pm-btn-del:hover { background: #f5c6c4; }
.pm-btn-order { background: #2a2a3a; color: #aaa; min-width: 26px; padding: 3px 5px; }
.pm-btn-order:hover:not(:disabled) { background: #3a3a4a; color: #fff; }
.pm-btn-order:disabled { opacity: .3; cursor: default; }

.pm-src-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: .02em;
}
.pm-src-local  { background: #1e3a1e; color: #6fcf6f; }
.pm-src-wiki   { background: #2a2a2a; color: #999; }
.pm-src-custom { background: #1a2a3a; color: #6ab0f5; }

.pm-add {
  padding: 14px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.pm-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pm-input-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  color: var(--text);
}
.pm-input-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,115,232,.14); }
.pm-input-row button {
  border: none;
  background: var(--blue);
  color: #fff;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pm-input-row button:hover { background: #1557b0; }
.pm-input-row button:disabled { background: var(--line); color: #9aa0a6; cursor: default; }

.pm-status {
  font-size: 12px;
  color: #c5221f;
  min-height: 18px;
  margin: 6px 0 0;
}
.pm-status.ok { color: #137333; }

.pm-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.pm-reset-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.pm-reset-btn:hover { background: #f1f3f4; color: #c5221f; border-color: #f5c6c4; }

.detail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 14px 14px;
}

.detail-section {
  padding: 12px 0;
  border-bottom: 1px solid #eef0f2;
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-section p {
  margin: 0;
  line-height: 1.62;
  font-size: 13px;
}

.detail-en {
  margin-top: 8px !important;
  color: var(--muted);
  font-size: 12px !important;
}

.chip-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-notes {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.route-notes li {
  padding-left: 10px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.route-notes strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.person-route-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e6007e;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

/* 같은 도시를 여러 번 방문한 정거장 — 순번을 한 배지에 함께 표시 */
.person-route-badge--multi {
  width: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* 구약 지도 여정 순번 배지 — 여정별 색상, 클릭 시 해당 정거장으로 이동 */
.journey-route-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--badge-color, #444);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  cursor: pointer;
}

.journey-route-badge--multi {
  width: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.info-grid div {
  padding: 8px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  background: #f8fafd;
}

.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.info-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}

/* ---------- Region labels and markers ---------- */
.region-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  color: #fff;
  font-size: 14px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
  opacity: .94;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 9px rgba(0, 0, 0, .8);
  cursor: pointer;
  pointer-events: auto;
}

.region-label .rl-en {
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: .72;
  text-transform: uppercase;
}

/* 속주: 크고 굵은 이탤릭, 황금빛 그림자 */
.region-label--province {
  font-size: 14px;
  font-weight: 800;
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0,0,0,.95), 0 0 10px rgba(160,100,0,.8);
}

/* 지방: 중간 크기, 보통체 */
.region-label--region {
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 7px rgba(0,0,0,.65);
}

/* 섬: 작고 이탤릭, 청색 그림자, 영어 숨김 */
.region-label--island {
  font-size: 9px;
  font-weight: 600;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 6px rgba(20,60,140,.6);
}
.region-label--island .rl-en { display: none; }

/* 지형·현대 지명: 넓은 자간, 옅은 청록빛 그림자로 성경 지역 라벨과 구분 */
.region-label--geo {
  font-size: 11px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 1.5px;
  opacity: .8;
  text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 7px rgba(40,140,190,.6);
}

.region-label:hover { opacity: 1; }

.region-label--selected {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 210, 40, .95)) drop-shadow(0 0 2px rgba(0, 0, 0, .9));
  transform: scale(1.18);
}

.reference-route-label {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
  color: #fff;
  cursor: pointer;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 9px rgba(80, 40, 20, .82);
}

.reference-route-label span:first-child {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-style: italic;
  font-weight: 800;
}

.reference-route-label span:last-child {
  overflow: hidden;
  max-width: 100%;
  margin-top: 2px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  opacity: .72;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.reference-route-label--sea {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 9px rgba(3, 105, 161, .86);
}

.reference-route-label--gate {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 9px rgba(180, 130, 40, .9);
}

.city-marker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.city-label {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff;
  pointer-events: none;
  line-height: 1;
}

.map-labels-on .city-label { display: block; }

.city-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  font-size: 9px;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}

.city-marker--selected {
  width: 27px;
  height: 27px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .65), 0 3px 12px rgba(0, 0, 0, .45);
  animation: marker-pulse 1.6s ease-out 1;
}

@keyframes marker-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(26, 115, 232, .8),  0 3px 12px rgba(0,0,0,.45); }
  60%  { box-shadow: 0 0 0 10px rgba(26, 115, 232, 0),   0 3px 12px rgba(0,0,0,.45); }
  100% { box-shadow: 0 0 0 3px rgba(26, 115, 232, .65),  0 3px 12px rgba(0,0,0,.45); }
}

/* ---------- Rich map popups ---------- */
.leaflet-popup-content-wrapper {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(60, 64, 67, .32);
}

.leaflet-popup-content {
  width: min(380px, 78vw) !important;
  margin: 0;
  font-size: 13px;
}

.leaflet-popup-tip { background: var(--surface); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

.info-popup {
  max-height: 520px;
  overflow: auto;
}

.popup-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafd 0%, #fff 100%);
}

.popup-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.popup-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.popup-header p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.popup-section {
  padding: 12px 18px;
  border-bottom: 1px solid #eef0f2;
}

.popup-section h4 {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--muted);
}

.popup-section p {
  margin: 0;
  line-height: 1.55;
}

.popup-en {
  margin-top: 7px !important;
  color: var(--muted);
  font-size: 12px;
}

.popup-badges,
.popup-chips,
.nearby-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-popup-chips {
  margin-top: 9px;
}

.badge,
.vchip,
.nearby-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge {
  padding: 3px 9px;
  color: #fff;
}

.vchip,
.nearby-chip {
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: #f8fafd;
  color: var(--text);
}

.verse-quote {
  width: 100%;
  margin: -1px 0 2px;
  padding: 6px 10px;
  border-left: 3px solid var(--line);
  background: #f8fafd;
  border-radius: 0 8px 8px 0;
}

.verse-quote p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.verse-quote sup {
  margin-right: 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}

.verse-quote-note {
  margin-top: 4px !important;
  font-size: 10.5px !important;
  color: var(--muted);
}

.popup-routes {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.popup-routes li {
  padding-left: 10px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}

.popup-routes strong {
  display: block;
  color: var(--text);
}

.popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px 16px;
}

.popup-grid div {
  padding: 8px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  background: #f8fafd;
}

.popup-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.popup-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}

/* ---------- Leaflet controls ---------- */
.leaflet-control-zoom a {
  color: var(--text);
}

.leaflet-control-attribution {
  font-size: 10px;
}

/* ---------- 모바일 줌 버튼 ---------- */
.mobile-zoom {
  display: none; /* 데스크톱에서는 Leaflet 기본 사용 */
}

@media (max-width: 760px) {
  /* Leaflet 기본 줌 숨기고 커스텀 버튼 표시 */
  .leaflet-control-zoom { display: none !important; }

  .mobile-zoom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    right: 12px;
    bottom: calc(12px + var(--map-nav-h, 0px)); /* JS의 syncZoomBtn()이 드로어 높이에 맞게 덮어씀 */
    z-index: 650;
  }
  .mobile-zoom button {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.82);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-zoom button:active { background: rgba(255,255,255,0.95); }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  #sidebar { width: 310px; }
  .journey-list { grid-template-columns: 1fr; }
  .player { width: min(440px, 60vw); }
}

@media (max-width: 760px) {
  #app {
    flex-direction: column;
    height: calc(100vh - var(--map-nav-h, 0px));
    height: calc(100svh - var(--map-nav-h, 0px));
  }

  #sidebar {
    width: 100% !important;
    height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    transition: height .22s ease;
  }

  #map-wrap {
    transition: height .22s ease, flex-basis .22s ease;
  }

  /* 검색 중(포커스 또는 입력값 있음): 검색 영역이 화면을 채우도록 확장.
     단, 결과 선택 후 사이드바가 접혀 있을 때는(sidebar-hidden) 지도가 우선한다. */
  #app.search-expanded:not(.sidebar-hidden) #sidebar {
    height: calc(100vh - var(--map-nav-h, 0px));
    height: calc(100svh - var(--map-nav-h, 0px));
  }

  #app.search-expanded:not(.sidebar-hidden) #map-wrap {
    height: 0;
    flex: 0 0 0;
    overflow: hidden;
  }

  #app.search-expanded:not(.sidebar-hidden) .search-cancel-btn {
    display: inline-block;
  }

  #app.sidebar-hidden #sidebar {
    height: 0;
    border-bottom: none;
  }

  .sidebar-toggle {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 18px;
    border-left: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 6px 6px;
    font-size: 14px;
  }
  /* 사이드바 닫힘: 목록 버튼은 타이틀과 같은 행 우측 */
  #app.sidebar-hidden .sidebar-toggle {
    top: 10px;
    left: auto;
    right: 10px;
    transform: none;
    width: 72px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.28);
    color: var(--text);
  }

  #map-wrap {
    height: 62vh;
    flex: 1;
  }

  .search-header {
    padding: 12px 14px 8px;
  }

  .search-box {
    padding: 10px 14px 8px;
  }

  /* 사이드바 열림: 타이틀은 사이드바 헤더에 있으므로 지도 위 카드 숨김 */
  .map-title-card { display: none; }

  /* 사이드바 닫힘: 타이틀 최상단 좌측 / 목록 버튼 최상단 우측 / 필터 그 아래 */
  #app.sidebar-hidden .map-title-card {
    display: block;
    top: 10px;
    left: 10px;
    right: 92px;   /* 목록 버튼(72px) + 여백(10px) 확보 */
    width: auto;
    padding: 8px 12px;
  }
  #app.sidebar-hidden .map-title-card h2 { font-size: 16px; }
  #app.sidebar-hidden .map-title-card p  { display: none; }

  #app.sidebar-hidden #map-panels {
    top: 88px;                    /* 타이틀 카드(h2+모드버튼 ~68px) + 여백 10px */
    width: calc(100% - 20px);
  }

  #map-panels {
    top: 10px;
    right: 10px;
    width: min(360px, calc(100% - 20px));
  }

  /* ── 모바일 필터: 가로 스크롤 전용 override ── */
  #map-filters .filter-collapse-btn { display: none; }

  #map-filters .journey-list,
  #ref-layers .journey-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #map-filters .journey-list::-webkit-scrollbar,
  #ref-layers .journey-list::-webkit-scrollbar { display: none; }

  .legend {
    display: none;
  }

  #basemap-ctrl {
    display: flex;
    position: fixed;
    bottom: calc(10px + var(--map-nav-h, 0px));
    left: 10px;
    padding: 4px;
    gap: 3px;
  }

  #basemap-ctrl .basemap-thumb {
    width: 30px;
    height: 30px;
  }

  #basemap-ctrl .basemap-name {
    font-size: 9px;
  }

  #basemap-ctrl .basemap-opt {
    padding: 2px;
  }

  .player {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + var(--map-nav-h, 0px));
    width: auto;
    transform: none;
    max-height: 40vh;
    overflow-y: auto;
  }

  .pl-city { flex-basis: 100%; margin-left: 0; }

  .pl-desc { font-size: 12px; }

  /* 모바일: 드로어를 화면 하단 고정 바텀시트로 */
  .detail-drawer {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: var(--map-nav-h, 0px) !important;
    left: 0 !important;
    width: 100% !important;
    height: 50vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    z-index: 600;
  }

  .detail-drawer.hidden { display: none; }

  .detail-drawer-shell {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
  }

  /* 핸들 영역을 넓혀 드래그하기 쉽게 */
  .drawer-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    cursor: ns-resize;
    touch-action: none;
  }
  .drawer-handle::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #bdc1c6;
    border-radius: 2px;
  }

  .detail-head h3 { font-size: 18px; }

  .city-marker {
    width: 15px;
    height: 15px;
    font-size: 8px;
    border-width: 1.5px;
  }
  .city-marker--selected {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  .leaflet-popup-content {
    width: min(360px, 86vw) !important;
  }
}

/* ── 모바일 지도 위 모드 전환 ────────────────────────────────── */
.mobile-mode-switch {
  display: none;
}

@media (max-width: 760px) {
  #app.sidebar-hidden .mobile-mode-switch {
    display: flex;
    gap: 6px;
    margin-top: 6px;
  }
  .mmb {
    padding: 4px 12px;
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
  }
  .mmb.active {
    background: #2c5f8a;
    color: #fff;
    border-color: #2c5f8a;
  }
}

/* ── 모드 토글 버튼 ─────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 12px 4px;
}

.mode-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  transition: background 0.15s, color 0.15s;
}

.mode-btn:hover {
  background: #e8e8e8;
}

.mode-btn.active {
  background: #2c5f8a;
  color: #fff;
  border-color: #2c5f8a;
}

/* 모드 버튼이 다른 페이지로 이동하는 링크(<a>)일 때도 버튼처럼 보이도록 */
a.mode-btn, a.mmb {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 사이드바 탭 ─────────────────────────────────────────────── */
.sidebar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  background: #fff;
}

.sidebar-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s, border-color .15s;
}

.sidebar-tab:hover { color: var(--text); }

.sidebar-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ── 인물 목록 ──────────────────────────────────────────────── */
.person-role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0 8px;
}

.role-filter-btn {
  padding: 3px 9px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: #f5f5f5;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}

.role-filter-btn:hover { background: #e8e8e8; }

.role-filter-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.person-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}

.person-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}

.person-item:hover  { background: #f1f3f4; }
.person-item.active { background: #e8f0fe; color: #174ea6; }

.person-role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f1f3f4;
  color: var(--muted);
  white-space: nowrap;
}

/* ── 인물 관련 도시 칩 (city detail 내) ────────────────────────── */
.person-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: #e8f0fe;
  color: #1a73e8;
  cursor: pointer;
  border: 1px solid #c5d5ea;
  transition: background .12s;
}
.person-chip:hover { background: #d2e3fc; }

/* ── 인물 선택 시 마커 강조 ─────────────────────────────────── */
.city-marker--highlighted {
  box-shadow: 0 0 0 3px rgba(26,115,232,.5), 0 0 0 6px rgba(26,115,232,.2) !important;
}

/* ── 지형 포인트 마커 (산·구릉) ──────────────────────────────── */
.terrain-pt {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  gap: 1px;
}

.terrain-pt--mountain .tp-sym {
  font-size: 13px;
  color: #5d3a1a;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 0 4px #fff;
}

.terrain-pt--hill .tp-sym {
  font-size: 10px;
  color: #7a5020;
  line-height: 1;
  text-shadow: 0 0 3px #fff;
}

.terrain-pt--site .tp-sym {
  font-size: 11px;
  color: #7b3f9e;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 0 4px #fff;
}

.tp-name {
  font-size: 10px;
  font-weight: 700;
  color: #3b1e07;
  text-shadow: 0 0 3px #fff, 0 0 4px #fff;
  white-space: nowrap;
  line-height: 1.1;
}

.tp-elev {
  font-size: 8px;
  font-weight: 600;
  color: #6b4226;
  text-shadow: 0 0 2px #fff;
  line-height: 1;
}

/* ── 지형 면 라벨 ──────────────────────────────────────────── */
.terrain-area-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
}

.tal-ko {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 0 4px #fff, 0 0 5px #fff, 0 0 5px #fff;
}

.tal-en {
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 0 4px #fff;
}

/* 지형 유형별 색상 */
.terrain-area-label--water    .tal-ko { color: #1a4f78; }
.terrain-area-label--water    .tal-en { color: #2471a3; }
.terrain-area-label--plain    .tal-ko { color: #2e7520; }
.terrain-area-label--plain    .tal-en { color: #4a9a35; }
.terrain-area-label--valley   .tal-ko { color: #2a6820; }
.terrain-area-label--valley   .tal-en { color: #4a9030; }
.terrain-area-label--highland .tal-ko { color: #6b4a28; }
.terrain-area-label--highland .tal-en { color: #8b6a40; }
.terrain-area-label--desert   .tal-ko { color: #7a5e10; }
.terrain-area-label--desert   .tal-en { color: #9a7e25; }

/* 쉐펠라 전용 — 강조 표시 */
.terrain-area-label--shephelah .tal-ko {
  color: #5a3a08;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.terrain-area-label--shephelah .tal-en {
  color: #7a5214;
  font-size: 9px;
}

.terrain-area-label--shephelah_valley .tal-ko {
  color: #6a4510;
  font-size: 10px;
}
.terrain-area-label--shephelah_valley .tal-en {
  color: #9a7020;
  font-size: 8px;
}

.terrain-area-label--city_wall .tal-ko {
  color: #4a2e08;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.terrain-area-label--city_wall .tal-en {
  color: #6b4c1a;
  font-size: 8px;
}

/* ── 강·골짜기 이름 라벨 ───────────────────────────────────── */
.river-name-label {
  font-size: 10px;
  font-weight: 700;
  color: #1a5276;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.valley-name-label {
  font-size: 9px;
  font-weight: 700;
  color: #2d6a1f;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}

/* 지형 팝업 */
.terrain-popup .popup-kicker { color: #7a5214; }

/* ---------- 모바일 하단 메뉴 네비 (Next.js 앱의 하단 탭바와 동일한 6개 메뉴) ---------- */
.map-bottom-nav { display: none; }

@media (max-width: 760px) {
  :root {
    --map-nav-h: calc(58px + env(safe-area-inset-bottom));
  }

  .map-bottom-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
  }

  .mbn-item.mbn-active {
    color: var(--text);
    font-weight: 600;
  }

  .mbn-icon {
    width: 22px;
    height: 22px;
  }
}
