/* ============================================================
   China Tour — editorial map interface
   ============================================================ */
:root {
  --paper: #f4efe5;
  --paper-2: #ece5d7;
  --paper-3: #e4dccb;
  --ink: #1f2822;
  --ink-soft: #485148;
  --muted: #777c71;
  --line: rgba(31, 40, 34, .12);
  --line-strong: rgba(31, 40, 34, .22);
  --red: #b84935;
  --red-deep: #933526;
  --green: #2f6657;
  --blue: #3d7ea6;
  --gold: #b78945;
  --brown: #94663f;
  --plum: #a64b5a;
  --shadow: 0 24px 80px rgba(31, 40, 34, .17);
  --serif: "DM Serif Display", "Noto Serif SC", Georgia, serif;
  --sans: "Manrope", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

#app {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  height: 100svh;
  width: 100%;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: relative;
  z-index: 900;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(184, 73, 53, .075), transparent 31%),
    radial-gradient(circle at 98% 90%, rgba(47, 102, 87, .08), transparent 33%),
    var(--paper);
  border-right: 1px solid var(--line-strong);
  box-shadow: 16px 0 50px rgba(31, 40, 34, .08);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: repeating-linear-gradient(115deg, transparent 0 26px, rgba(31, 40, 34, .025) 27px 28px);
  mask-image: linear-gradient(to bottom, black, transparent 65%);
}
.brand {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 26px 26px 18px;
}
.seal {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--red);
  color: #fff7ea;
  font-family: "Noto Serif SC", serif;
  font-size: 23px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 232, .45), 0 8px 18px rgba(147, 53, 38, .23);
  transform: rotate(-2deg);
}
.brand-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.02em;
}
.brand h1 em { color: var(--red); font-style: italic; }
.mobile-close { display: none; margin-left: auto; }

.tabs {
  position: relative;
  display: flex;
  gap: 6px;
  margin: 0 26px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .34);
}
.tab {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: .2s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: var(--paper); box-shadow: 0 4px 12px rgba(31, 40, 34, .17); }
.tab-dot {
  display: none;
  width: 5px; height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: middle;
}
.tab.has-prefs .tab-dot { display: inline-block; }

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 26px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 40, 34, .22) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(31, 40, 34, .18); border-radius: 10px; }
.panel { display: none; animation: fadeUp .3s ease both; }
.panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lede {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.38;
  letter-spacing: -.01em;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .42);
  transition: .2s ease;
}
.search-wrap:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(184, 73, 53, .1); background: #fffaf1; }
.search-wrap svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.search-wrap input::placeholder { color: #929487; }
.search-wrap kbd {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
  font-size: 9px;
  font-family: var(--sans);
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 13px 0 3px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .34);
  color: var(--ink-soft);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  transition: .18s ease;
}
.chip:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .7); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cat, var(--muted)); }
.chip-dot.mountains { background: var(--green); }
.chip-dot.rivers { background: var(--blue); }
.chip-dot.hot_springs { background: var(--red); }
.chip-dot.ancient_towns { background: var(--brown); }
.chip-dot.family { background: var(--plum); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 23px 0 10px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.count-pill {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.place-list { display: flex; flex-direction: column; gap: 7px; }
.place-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 9px 8px 9px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: .18s ease;
}
.place-card:hover, .place-card.selected {
  border-color: var(--line);
  background: rgba(255, 255, 255, .47);
  transform: translateX(2px);
}
.place-card.selected { border-color: rgba(184, 73, 53, .28); background: rgba(255, 250, 241, .75); }
.place-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--cat-soft, #e8e5dc);
  color: var(--cat, var(--ink));
}
.place-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.place-main { min-width: 0; }
.place-main h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.score-num { font-family: var(--serif); font-size: 16px; line-height: 1; }
.score-bar { width: 31px; height: 3px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.score-bar span { display: block; height: 100%; border-radius: 3px; background: var(--cat, var(--green)); }
.rank-badge {
  position: absolute;
  top: -5px; left: 33px;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 7px;
  font-weight: 800;
  border: 2px solid var(--paper);
}

.shortlist-card {
  margin: 19px 0 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .27);
}
.shortlist-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.shortlist-head h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 400; }
.text-btn { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 9px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: var(--red); }
.shortlist-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.shortlist-item { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 10.5px; border-top: 1px solid var(--line); }
.shortlist-item:first-child { border-top: 0; }
.shortlist-item button { border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.empty-note { margin: 5px 0 0; color: var(--muted); font-size: 10px; }

.callout {
  display: flex;
  gap: 11px;
  margin: 8px 0 22px;
  padding: 15px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 30px rgba(31, 40, 34, .14);
}
.callout-mark {
  flex: 0 0 24px; height: 24px;
  display: grid; place-items: center;
  border: 1px solid rgba(244, 239, 229, .35);
  border-radius: 50%;
  color: #e8c7b8;
  font-family: var(--serif);
  font-size: 15px;
}
.callout h3 { margin: 0 0 3px; font-family: var(--serif); font-size: 16px; font-weight: 400; }
.callout p { margin: 0 0 9px; color: rgba(244, 239, 229, .67); font-size: 10px; line-height: 1.45; }
.callout .primary-btn { background: var(--red); border-color: var(--red); color: #fff8ee; padding: 7px 11px; font-size: 10px; }

.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  transition: .2s ease;
}
.primary-btn:hover { background: var(--red); border-color: var(--red); transform: translateY(-1px); }
.primary-btn span { font-size: 13px; line-height: 0; }
.ghost-btn { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ghost-btn:hover { border-color: var(--ink); background: rgba(255, 255, 255, .4); }
.wide { width: 100%; margin-top: 10px; }

/* ---------- matchmaker ---------- */
.match-intro h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.03;
}
.match-intro p:last-child { margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.step-dots { display: flex; gap: 5px; margin-bottom: 17px; }
.step-dot { flex: 1; height: 2px; border-radius: 2px; background: var(--paper-3); transition: .2s; }
.step-dot.active { background: var(--red); }
.quiz-step { display: none; }
.quiz-step.active { display: block; animation: fadeUp .25s ease both; }
.step-kicker { margin: 0 0 4px; color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.quiz-step h3 { margin: 0 0 15px; font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.05; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field > span, .range-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.field select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .47);
  padding: 0 10px;
  font-size: 12px;
  outline: 0;
}
.field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(184, 73, 53, .1); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row .chip { font-size: 10.5px; padding: 7px 10px; }
.interest-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.interest-grid .chip { justify-content: center; }
.hint { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.range-field {
  position: relative;
  display: block;
  margin: 0 0 18px;
  padding-bottom: 3px;
}
.range-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.range-field input[type="range"] {
  width: 100%;
  height: 3px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--red) 0%, var(--red) var(--pct, 50%), var(--paper-3) var(--pct, 50%), var(--paper-3) 100%);
  outline: 0;
}
.range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--red);
  box-shadow: 0 2px 5px rgba(31, 40, 34, .18);
  cursor: grab;
}
.range-field input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--red);
  cursor: grab;
}
.range-field output {
  position: absolute;
  right: 0;
  bottom: 9px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
}
.quiz-actions { display: flex; gap: 8px; margin-top: 17px; }
.quiz-actions .primary-btn { margin-left: auto; }
.cookie-note { display: flex; align-items: center; gap: 6px; margin: 11px 0 5px; color: var(--muted); font-size: 9px; }
.cookie-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.match-results { padding-top: 4px; }
.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.results-head h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.results-list { display: flex; flex-direction: column; gap: 7px; }
.result-card {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .3);
  text-align: left;
  transition: .18s;
}
.result-card:hover { background: rgba(255, 255, 255, .7); transform: translateX(2px); }
.result-rank { font-family: var(--serif); font-size: 20px; color: var(--red); }
.result-card h4 { margin: 0; font-size: 12px; font-weight: 800; }
.result-card p { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.result-ring {
  --pct: 50;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--paper-3) 0);
  position: relative;
}
.result-ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--paper); }
.result-ring span { position: relative; z-index: 1; font-size: 9px; font-weight: 800; }

/* ---------- map ---------- */
.map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #dfe6dc;
}
#map { position: absolute; inset: 0; z-index: 1; background: #dfe6dc; }
.leaflet-container { font-family: var(--sans); background: #dfe6dc; }
.leaflet-control-attribution {
  background: rgba(244, 239, 229, .82) !important;
  color: var(--muted) !important;
  font-size: 8px !important;
  padding: 2px 6px !important;
  border-radius: 5px 0 0 0;
}
.leaflet-control-attribution a { color: var(--ink-soft) !important; }
.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 8px 22px rgba(31, 40, 34, .16) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  color: var(--ink) !important;
  background: rgba(244, 239, 229, .93) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: 16px !important;
}
.leaflet-control-zoom a:hover { background: #fff9ef !important; }

.map-topbar {
  position: absolute;
  z-index: 600;
  top: 22px; left: 26px; right: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.map-title { padding: 9px 13px 10px; border-radius: 11px; background: rgba(244, 239, 229, .84); backdrop-filter: blur(12px); box-shadow: 0 8px 26px rgba(31, 40, 34, .11); }
.map-title .eyebrow { margin-bottom: 2px; }
.map-title h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.map-actions { display: flex; gap: 6px; pointer-events: auto; }
.map-action {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(244, 239, 229, .9);
  backdrop-filter: blur(10px);
  box-shadow: 0 7px 20px rgba(31, 40, 34, .12);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}
.map-action:hover { background: #fff9ef; color: var(--ink); }
.map-action svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.layer-dock {
  position: absolute;
  z-index: 610;
  top: 92px;
  right: 26px;
  display: flex;
  gap: 6px;
}
.dock-group { position: relative; }
.dock-label {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(244, 239, 229, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 7px 20px rgba(31, 40, 34, .12);
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}
.dock-label span { color: var(--muted); margin-left: 3px; }
.dock-menu {
  display: none;
  position: absolute;
  top: 37px;
  right: 0;
  min-width: 158px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(244, 239, 229, .97);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 35px rgba(31, 40, 34, .16);
}
.dock-group.open .dock-menu { display: block; }
.dock-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 7px 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
}
.dock-menu button:hover { background: rgba(31, 40, 34, .06); }
.dock-menu button.active { color: var(--red); font-weight: 800; }
.dock-menu button.active::after { content: "✓"; font-size: 10px; }

.map-legend {
  position: absolute;
  z-index: 600;
  left: 26px;
  bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 460px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 239, 229, .84);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(31, 40, 34, .1);
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 700;
}
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-dot.mountains { background: var(--green); }
.legend-dot.rivers { background: var(--blue); }
.legend-dot.hot_springs { background: var(--red); }
.legend-dot.ancient_towns { background: var(--brown); }
.legend-dot.family { background: var(--plum); }

.map-caption {
  position: absolute;
  z-index: 600;
  right: 26px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(31, 40, 34, .56);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
}
.caption-rule { width: 14px; height: 1px; background: rgba(31, 40, 34, .28); }

/* ---------- markers ---------- */
.place-pin { background: transparent; border: 0; }
.place-pin-inner {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border-radius: 50% 50% 50% 8px;
  background: var(--cat, var(--ink));
  color: #fffdf6;
  border: 2px solid rgba(255, 252, 244, .92);
  box-shadow: 0 5px 14px rgba(31, 40, 34, .28);
  transform: rotate(-45deg);
  transition: .18s ease;
}
.place-pin-inner svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; transform: rotate(45deg); }
.place-pin-inner:hover, .place-pin.selected .place-pin-inner { transform: rotate(-45deg) scale(1.16); box-shadow: 0 7px 18px rgba(31, 40, 34, .35); }
.place-pin.match-1 .place-pin-inner { box-shadow: 0 0 0 5px rgba(184, 73, 53, .17), 0 5px 14px rgba(31, 40, 34, .28); }
.place-pin.dimmed { opacity: .22; filter: grayscale(.5); }
.mountain-pin { background: transparent; border: 0; }
.mountain-pin span { display: block; width: 8px; height: 8px; transform: rotate(45deg); background: #7d6a54; border: 1px solid rgba(255,255,255,.6); }
.airport-pin { background: transparent; border: 0; }
.airport-pin span {
  display: grid; place-items: center;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: rgba(31, 40, 34, .82);
  color: var(--paper);
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, .5);
}
.hub-label {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
}
.cluster {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(31, 40, 34, .9);
  color: var(--paper);
  border: 2px solid rgba(244, 239, 229, .88);
  box-shadow: 0 6px 20px rgba(31, 40, 34, .28);
  font-size: 11px;
  font-weight: 800;
}
.cluster.small { width: 31px; height: 31px; font-size: 9px; }
.station-dot { background: #2e4d42; border: 1px solid rgba(255,255,255,.7); }
.leaflet-tooltip {
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  background: rgba(244, 239, 229, .96) !important;
  color: var(--ink) !important;
  box-shadow: 0 7px 20px rgba(31, 40, 34, .13) !important;
  font-size: 10px !important;
  padding: 5px 7px !important;
}
.leaflet-tooltip::before { display: none; }

/* ---------- detail drawer ---------- */
.detail {
  position: absolute;
  z-index: 1100;
  top: 0; right: 0; bottom: 0;
  width: 382px;
  overflow-y: auto;
  background: rgba(247, 242, 232, .97);
  backdrop-filter: blur(18px);
  border-left: 1px solid var(--line-strong);
  box-shadow: -18px 0 60px rgba(31, 40, 34, .15);
  padding: 25px 25px 32px;
  animation: slideIn .28s cubic-bezier(.2,.7,.2,1) both;
  scrollbar-width: thin;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-close { position: absolute; z-index: 3; top: 15px; right: 15px; background: rgba(255, 255, 255, .72); }
.detail-content { position: relative; z-index: 1; }
.detail-hero {
  position: relative;
  min-height: 150px;
  margin: 0 0 18px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(31, 40, 34, .12), rgba(31, 40, 34, .42)),
    radial-gradient(circle at 30% 27%, var(--cat-soft) 0 18%, transparent 55%),
    linear-gradient(125deg, var(--cat) 0%, #2f3f38 100%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: #fffaf0;
}
.detail-hero::before {
  content: attr(data-cn);
  position: absolute;
  right: 12px; top: 4px;
  color: rgba(255, 250, 239, .17);
  font-family: "Noto Serif SC", serif;
  font-size: 68px;
  line-height: 1;
  white-space: nowrap;
}
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, transparent 0 18px, rgba(255,255,255,.055) 19px 20px);
}
.detail-hero .hero-meta { position: relative; z-index: 1; }
.detail-hero .hero-meta p { margin: 0 0 2px; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; opacity: .7; }
.detail-hero .hero-meta h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.02; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.meta-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}
.meta-pill strong { color: var(--ink); }
.detail-score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.detail-score {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--red) calc(var(--pct) * 1%), var(--paper-3) 0);
  position: relative;
}
.detail-score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--paper); }
.detail-score span { position: relative; z-index: 1; font-family: var(--serif); font-size: 18px; }
.detail-score-copy p { margin: 0; font-size: 9px; color: var(--muted); font-weight: 700; }
.detail-score-copy strong { display: block; font-family: var(--serif); font-size: 15px; font-weight: 400; }
.detail p.summary { margin: 0 0 12px; font-family: var(--serif); font-size: 17px; line-height: 1.38; }
.detail p.why { margin: 0 0 15px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.detail h3 { margin: 18px 0 8px; font-family: var(--serif); font-size: 17px; font-weight: 400; }
.hotel-card {
  display: block;
  padding: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .38);
  text-decoration: none;
  transition: .18s;
}
.hotel-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .72); }
.hotel-card strong { display: block; font-size: 11px; }
.hotel-card span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.hotel-card em { display: inline-block; margin-top: 5px; color: var(--red); font-style: normal; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.detail-actions { display: flex; gap: 7px; margin-top: 16px; }
.detail-actions .primary-btn { flex: 1; }
.detail-note {
  margin: 14px 0 0;
  padding: 10px;
  border-left: 2px solid var(--gold);
  background: rgba(183, 137, 69, .08);
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.55;
}

/* ---------- toast + misc ---------- */
.icon-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}
.icon-btn:hover { background: rgba(255, 255, 255, .6); }
.icon-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 26px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .01em;
}
.foot-links { display: flex; gap: 10px; }
.foot-links a { text-decoration: none; font-weight: 800; }
.foot-links a:hover { color: var(--red); }
.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 700;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-scrim { position: fixed; inset: 0; z-index: 850; background: rgba(31, 40, 34, .3); backdrop-filter: blur(2px); }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  #app { grid-template-columns: 390px minmax(0, 1fr); }
  .brand { padding-left: 21px; padding-right: 21px; }
  .tabs { margin-left: 21px; margin-right: 21px; }
  .panel-scroll { padding-left: 21px; padding-right: 21px; }
  .sidebar-foot { padding-left: 21px; padding-right: 21px; }
}
@media (max-width: 820px) {
  body { overflow: hidden; }
  #app { display: block; height: 100svh; }
  .map-wrap { height: 100svh; }
  .sidebar {
    position: fixed;
    z-index: 1000;
    left: 0; right: 0; bottom: 0;
    height: 53svh;
    border-right: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 60px rgba(31, 40, 34, .18);
  }
  .brand { padding: 16px 18px 10px; }
  .brand h1 { font-size: 26px; }
  .seal { width: 32px; height: 32px; flex-basis: 32px; font-size: 19px; }
  .mobile-close { display: grid; }
  .tabs { margin: 0 18px; }
  .panel-scroll { padding: 12px 18px 4px; }
  .sidebar-foot { display: none; }
  .map-topbar { top: 13px; left: 13px; right: 13px; }
  .map-title { padding: 7px 10px; }
  .map-title h2 { font-size: 15px; }
  .map-title .eyebrow { font-size: 8px; }
  .map-actions .map-action span { display: none; }
  .map-action { width: 32px; height: 32px; justify-content: center; padding: 0; }
  .layer-dock { top: 63px; right: 13px; }
  .map-legend { left: 13px; bottom: 13px; max-width: calc(100% - 26px); font-size: 8px; }
  .map-caption { display: none; }
  .detail { width: 100%; top: 0; bottom: 0; padding: 20px 18px 30px; }
  .lede { font-size: 16px; }
  .interest-grid { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(53svh + 15px); }
}
@media (max-width: 430px) {
  .brand-copy .eyebrow { font-size: 8px; }
  .brand h1 { font-size: 24px; }
  .map-legend { display: none; }
  .section-head h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* map annotations */
.range-label, .land-label, .river-label, .rail-label {
  color: rgba(31, 40, 34, .58);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .13em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(244, 239, 229, .9), 0 0 8px rgba(244, 239, 229, .8);
  pointer-events: none;
}
.range-label { color: #6f5d48; }
.land-label { color: rgba(31, 40, 34, .42); font-size: 7.5px; }
.river-label { color: rgba(61, 126, 166, .62); font-style: italic; letter-spacing: .1em; }
.rail-label { color: rgba(184, 73, 53, .65); font-size: 6.5px; letter-spacing: .09em; }
.rail-corridor { animation: railFlow 24s linear infinite; }
@keyframes railFlow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -200; } }
.hub-label { color: rgba(31, 40, 34, .62); font-size: 7px; font-weight: 800; letter-spacing: .06em; text-shadow: 0 1px 0 rgba(244, 239, 229, .95); }
.hub-tooltip { font-size: 9px !important; }

/* mobile collapsed state */
@media (max-width: 820px) {
  .sidebar.collapsed { height: 69px; min-height: 69px; }
  .sidebar.collapsed .tabs,
  .sidebar.collapsed .panel-scroll,
  .sidebar.collapsed .sidebar-foot { display: none; }
  .sidebar.collapsed .brand { padding-bottom: 13px; }
  .sidebar.collapsed .mobile-close svg { transform: rotate(180deg); }
}

/* about anchor */
#about {
  margin: 0 0 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .23);
}
#about h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 16px; font-weight: 400; }
#about p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.cluster { position: relative; }
.cluster > span { transform: translateY(-3px); }
.cluster-dots { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); display: flex; gap: 2px; }
.cluster-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; border: 1px solid rgba(244,239,229,.65); }
.place-hit { pointer-events: all; cursor: pointer; }
.place-symbol:focus { outline: none; }
.place-symbol:focus .place-ring { stroke: #1f2822; opacity: 1 !important; }
.atlas-tooltip { position: absolute; z-index: 900; width: 230px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(247,242,232,.97); box-shadow: 0 12px 30px rgba(31,40,34,.18); pointer-events: none; backdrop-filter: blur(8px); }
.atlas-tooltip[hidden] { display: none; }
.tooltip-kicker { color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
.atlas-tooltip strong { display: block; font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1.05; }
.atlas-tooltip p { margin: 4px 0 6px; color: var(--ink-soft); font-size: 9px; line-height: 1.45; }
.tooltip-meta { color: var(--muted); font-size: 8px; font-weight: 700; }
.tooltip-score { float: right; color: var(--red); font-family: var(--serif); font-size: 14px; font-weight: 400; }

/* ============================================================
   D3 atlas
   ============================================================ */
.atlas-map { position: absolute; inset: 0; overflow: hidden; background: #d7e4e2; }
.atlas-svg { display: block; width: 100%; height: 100%; cursor: grab; }
.atlas-svg:active { cursor: grabbing; }
.atlas-ocean { pointer-events: none; }
.atlas-graticule { fill: none; stroke: #8fa8a3; stroke-width: .45; opacity: .32; pointer-events: none; }
.atlas-country { transition: fill .25s ease; }
.atlas-country.neighbour { pointer-events: none; }
.atlas-country.china { pointer-events: none; }
.atlas-china-outline { pointer-events: none; }
.atlas-provinces { pointer-events: none; }
.atlas-landforms, .atlas-rivers, .atlas-lakes, .atlas-rail, .atlas-roads { pointer-events: none; }
.atlas-glyphs { pointer-events: none; }
.atlas-labels { pointer-events: none; }

.atlas-label {
  fill: #2a352e;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .01em;
  paint-order: stroke;
  stroke: rgba(246, 241, 231, .92);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.atlas-label.gateway { font-size: 10.5px; font-weight: 800; fill: #33453a; letter-spacing: .02em; }
.atlas-label.place { font-weight: 700; }
.atlas-label.place.tier-1 { font-size: 10.5px; font-weight: 800; fill: #1f2a23; }
.atlas-label.place.tier-2 { font-size: 9.4px; font-weight: 700; fill: #34443a; }
.atlas-label.place.tier-3 { font-size: 8.8px; font-weight: 600; fill: #4c5c51; }
.atlas-label.place.gem { fill: #7a3a4c; font-style: italic; }
.atlas-label.neighbour { fill: rgba(86, 94, 86, .46); font-size: 7px; font-weight: 800; letter-spacing: .18em; }
.atlas-label.sea { fill: rgba(61, 126, 166, .48); font-size: 6.5px; font-weight: 800; letter-spacing: .15em; font-style: italic; }
.atlas-label.region { fill: rgba(73, 85, 75, .34); font-size: 7px; font-weight: 800; letter-spacing: .2em; }
.atlas-label.landform { fill: rgba(108, 91, 69, .42); font-size: 6px; font-weight: 800; letter-spacing: .14em; }
.atlas-label.airport { fill: rgba(31, 40, 34, .65); font-size: 7px; font-weight: 800; letter-spacing: .06em; }

.place-symbol { cursor: pointer; }
.place-symbol .place-dot { transition: r .15s ease; }
.place-symbol:hover .place-dot { r: 6.5; }
.place-symbol.is-top .place-ring { animation: atlasPulse 2.8s ease-in-out infinite; }
@keyframes atlasPulse { 0%, 100% { opacity: .55; } 50% { opacity: .95; } }
.place-symbol.is-gem .place-gem { filter: drop-shadow(0 2px 2px rgba(31,40,34,.18)); }
.place-symbol.is-gem:hover .place-gem { filter: drop-shadow(0 3px 4px rgba(31,40,34,.25)); }

.legend-gem {
  display: inline-block;
  width: 6px; height: 6px;
  transform: rotate(45deg);
  background: var(--plum);
  border-radius: 1px;
  margin-right: 4px;
}
.chip-dot.gems { background: var(--plum); transform: rotate(45deg); border-radius: 1px; width: 5px; height: 5px; }
.airport-mark { fill: #fbf6eb; font-size: 5px; font-family: var(--sans); pointer-events: none; }

/* hide obsolete leaflet controls if any cached markup remains */
.leaflet-control-container { display: none; }
.place-symbol { pointer-events: all; }
.place-cluster { cursor: zoom-in; }
.cluster-bg { filter: drop-shadow(0 3px 6px rgba(31,40,34,.22)); }
.cluster-count { fill: #fbf6eb; font-family: var(--sans); font-weight: 800; pointer-events: none; }
.atlas-label.feature { fill: rgba(47, 102, 87, .66); font-size: 6.5px; font-weight: 800; letter-spacing: .15em; }
