.map-explorer-shell {
  --map-paper: var(--ivory);
  --map-ink: var(--charcoal);
  --map-olive: var(--olive);
  --map-brass: var(--brass);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 38px) clamp(16px, 3vw, 40px) 36px;
  color: var(--map-ink);
}

.map-explorer-shell .map-intro {
  display: flex;
  align-items: end;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(30, 30, 27, 0.14);
}

.map-explorer-shell .map-intro h1 {
  margin: 0;
  font-family: var(--font-serif-zh, "Songti SC", Georgia, serif);
  font-size: clamp(28px, 3.3vw, 42px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
}

.map-explorer-shell .map-deck {
  margin: 8px 0 0;
  color: #626059;
  font-size: 14px;
}

.map-explorer-shell .map-data-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 12px;
  margin-top: 14px;
  color: #6b461d;
  background: #f6f0e4;
  border-left: 3px solid var(--map-brass);
  font-size: 13px;
}

.map-explorer-shell .map-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(30, 30, 27, 0.12);
}

.map-explorer-shell .map-select-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--map-ink);
  font-size: 13px;
  font-weight: 600;
}

.map-explorer-shell .map-select-label select {
  width: min(340px, 58vw);
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 1px solid rgba(30, 30, 27, 0.2);
  border-radius: 4px;
  background: white;
  color: var(--map-ink);
}

.map-explorer-shell .map-cat-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.map-explorer-shell .map-cat-pill {
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid rgba(30, 30, 27, 0.17);
  border-radius: 4px;
  color: var(--map-ink);
  background: transparent;
  font-size: 12.5px;
  cursor: pointer;
}

.map-explorer-shell .map-cat-pill:hover { border-color: var(--map-olive); }
.map-explorer-shell .map-cat-pill.active { color: white; background: var(--map-olive); border-color: var(--map-olive); }

.map-explorer-shell .map-split-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.55fr);
  align-items: stretch;
  gap: 18px;
  margin-top: 18px;
}

.map-explorer-shell .map-sidebar {
  display: flex;
  min-width: 0;
  max-height: min(76vh, 820px);
  flex-direction: column;
  border: 1px solid rgba(30, 30, 27, 0.13);
  border-radius: 3px;
  background: white;
}

.map-explorer-shell .map-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30, 30, 27, 0.12);
  font-size: 13px;
}

.map-explorer-shell .map-sidebar-head > div { display: grid; gap: 1px; }
.map-explorer-shell .map-sidebar-head > div span,
.map-explorer-shell .map-sidebar-head > span { color: #626059; font-size: 11.5px; }

.map-explorer-shell .map-poi-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 12px;
}

.map-explorer-shell .poi-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 14px 2px 14px 0;
  border: 0;
  border-bottom: 1px solid rgba(30, 30, 27, 0.1);
  border-radius: 0;
  background: white;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.map-explorer-shell .poi-card:hover,
.map-explorer-shell .poi-card.is-active { background: #f4f5f0; }
.map-explorer-shell .poi-card.is-active { box-shadow: inset 3px 0 var(--map-olive); padding-left: 8px; }
.map-explorer-shell .map-poi-glyph { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 700; background: #e9eee7; color: var(--map-olive); }
.map-explorer-shell .map-poi-glyph.cat-stay { background: #f6f0e4; color: #785d2d; }
.map-explorer-shell .map-poi-glyph.cat-transport { background: #e9e8e3; color: #30302c; }
.map-explorer-shell .map-poi-glyph.cat-food { background: #f5eae1; color: #8f4f24; }
.map-explorer-shell .map-poi-glyph.cat-match { background: #efe7d8; color: #745822; }
.map-explorer-shell .poi-card .poi-thumb { width: 56px; height: 56px; }
.map-explorer-shell .poi-card-body { min-width: 0; }
.map-explorer-shell .poi-meta-row { flex-wrap: wrap; gap: 4px 8px; font-size: 11px; }
.map-explorer-shell .poi-cat-dot { padding: 1px 5px; border-radius: 3px; }
.map-explorer-shell .poi-title { margin: 2px 0; font-size: 14px; line-height: 1.45; }
.map-explorer-shell .poi-local { font-size: 11.5px; overflow-wrap: anywhere; }
.map-explorer-shell .map-poi-dates { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.map-explorer-shell .map-poi-dates span { padding: 1px 5px; color: #514a3a; background: #f5f1e7; font-size: 10.5px; }
.map-explorer-shell .poi-summary { margin: 5px 0 7px; color: #47463f; font-size: 12px; line-height: 1.55; }
.map-explorer-shell .poi-actions { gap: 4px 10px; }
.map-explorer-shell .poi-actions .inline-editorial-btn { min-height: 30px; padding: 3px 0; border: 0; background: none; font-size: 11.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.map-explorer-shell .map-canvas-panel { display: flex; min-width: 0; flex-direction: column; }
.map-explorer-shell .map-canvas-wrap { position: relative; height: min(76vh, 820px); min-height: 420px; overflow: hidden; border: 1px solid rgba(30, 30, 27, 0.14); border-radius: 3px; background: #e9eef0; }
.map-explorer-shell .map-canvas { width: 100%; height: 100%; }
.map-explorer-shell .map-basemap-badge { position: absolute; z-index: 5; top: 12px; left: 12px; max-width: calc(100% - 24px); padding: 5px 9px; border: 1px solid rgba(30, 30, 27, 0.14); border-radius: 3px; background: rgba(250, 248, 243, 0.96); color: #393932; font-size: 11px; }
.map-explorer-shell .map-basemap-badge[data-state="error"] { color: #6b461d; border-color: #c9aa70; }
.map-explorer-shell .map-basemap-badge[data-state="offline"] { color: #514a3a; }
.map-explorer-shell .map-map-hint { position: absolute; z-index: 4; right: 12px; bottom: 10px; padding: 3px 7px; background: rgba(250, 248, 243, 0.92); color: #626059; font-size: 10.5px; pointer-events: none; }
.map-explorer-shell .map-route-caption { display: flex; align-items: center; gap: 8px; padding: 9px 2px; color: #55544d; font-size: 11.5px; }
.map-explorer-shell .map-route-swatch { width: 27px; border-top: 2px dashed var(--map-olive); }
.map-explorer-shell .map-empty { display: grid; gap: 4px; padding: 24px 14px; color: #626059; font-size: 13px; }
.map-explorer-shell .map-empty strong { color: var(--map-ink); }

.map-explorer-shell .map-pin { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #faf8f3; border-radius: 50%; box-shadow: 0 1px 6px rgba(30, 30, 27, .3); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.map-explorer-shell .map-pin.pin-sight { background: var(--map-olive); }
.map-explorer-shell .map-pin.pin-stay { background: #8d6d34; }
.map-explorer-shell .map-pin.pin-transport { background: #353631; }
.map-explorer-shell .map-pin.pin-food { background: #8f4f24; }
.map-explorer-shell .map-pin.pin-match { background: #745822; }
.map-explorer-shell .map-pin.is-selected { width: 35px; height: 35px; outline: 2px solid var(--map-brass); outline-offset: 2px; }
.map-explorer-shell .map-popup-inner { color: var(--map-ink); font-family: var(--font-sans); }
.map-explorer-shell .map-popup-cat { color: #745822; font-size: 11px; }
.map-explorer-shell .map-popup-title { display: block; margin: 2px 0; font-size: 15px; }
.map-explorer-shell .map-popup-local { color: #626059; font-size: 11.5px; }
.map-explorer-shell .map-popup-desc { margin: 6px 0; font-size: 12px; line-height: 1.5; }
.map-explorer-shell .map-popup-link { font-size: 12px; text-decoration: underline; }

.map-explorer-shell .map-svg-fallback { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-explorer-shell .map-svg-fallback:active { cursor: grabbing; }
.map-explorer-shell .map-svg-world path { fill: #faf8f3; stroke: #bfc7c2; stroke-width: .25; vector-effect: non-scaling-stroke; }
.map-explorer-shell .map-svg-grid line { stroke: #c9c4b8; stroke-width: .35; vector-effect: non-scaling-stroke; }
.map-explorer-shell .map-svg-routes polyline { fill: none; stroke: var(--map-olive); stroke-width: 2.4; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.map-explorer-shell .map-svg-marker { cursor: pointer; }
.map-explorer-shell .map-svg-marker circle { fill: var(--map-olive); stroke: #faf8f3; stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-explorer-shell .map-svg-marker text { fill: white; font-family: var(--font-sans); font-size: 8px; text-anchor: middle; pointer-events: none; }
.map-explorer-shell .map-svg-marker.selected circle { stroke: var(--map-brass); stroke-width: 4; }

@media (max-width: 767px) {
  .map-explorer-shell { padding: 18px 14px 22px; }
  .map-explorer-shell .map-intro { padding-bottom: 12px; }
  .map-explorer-shell .map-deck { font-size: 12.5px; }
  .map-explorer-shell .map-controls-bar { align-items: stretch; flex-direction: column; gap: 10px; padding: 11px 0; }
  .map-explorer-shell .map-select-label { justify-content: space-between; }
  .map-explorer-shell .map-select-label select { flex: 1; width: auto; max-width: 76%; }
  .map-explorer-shell .map-cat-pills { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 1px 1px 4px; }
  .map-explorer-shell .map-cat-pill { flex: 0 0 auto; min-height: 35px; padding-inline: 9px; }
  .map-explorer-shell .map-split-layout { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 10px; }
  .map-explorer-shell .map-canvas-wrap { height: min(52svh, 520px); min-height: 300px; }
  .map-explorer-shell .map-sidebar { max-height: 42vh; }
  .map-explorer-shell .map-poi-list { padding-inline: 10px; }
  .map-explorer-shell .poi-card { padding-block: 11px; }
  .map-explorer-shell .poi-summary { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-explorer-shell .poi-card { transition: none; }
}

.map-atlas-detail { position: absolute; left: 12px; bottom: 18px; width: min(300px,90%); padding: 12px; background: var(--ivory); box-shadow: var(--overlay-shadow); font-size: 13px; }
.map-atlas-detail p { margin: 6px 0 0; }
.map-atlas-detail button { float: right; background: none; border: none; cursor: pointer; }
@media(max-width: 767px){ .map-explorer-shell .map-select-label { min-width: 0; width: 100%; } .map-explorer-shell .map-select-label select { min-width: 0; } }
