/* 地图搜索页：共享控件来自 workbench-components；这里只定义画布与业务布局。 */
:root {
  /* Independent collapsed entries. */
  --sheet-collapsed-height: 2.75rem;
  --sheet-mobile-expanded-height: min(62svh, 40rem);
  --sheet-mobile-filter-height: min(12rem, 30svh);
  /* 地图面板、图例与折叠条共用同一层半透明 Glass 表面。 */
  --map-glass-surface: var(--glass-background);
  --map-timer-waiting: #8ab8e6;
  --map-timer-window: #e8b84a;
  --map-timer-invalid: #a3a8ad;
}
/* Scroll the page when the orientation artboard is taller/wider than the window; map fills .lu4-viewport. */
html, body { overflow: auto; }

.map-app { --marker: var(--selection-border); --panel-width: clamp(20rem, 24vw, 24rem); --map-tablet-panel-min: 18rem; --map-tablet-panel-max: 20rem; --map-min-workspace: 22rem; position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; background: var(--lu4-map-canvas); line-height: 1.4; }
.map-ui-stack { display: contents; }
/* Paper glass overlays darker map pixels as well as the light empty canvas. */
.map-app { --text-muted: var(--lu4-glass-text-muted); }
.map-panel { position: absolute; z-index: 5; top: calc(var(--shell-header-height) + var(--space-4)); bottom: var(--space-4); left: var(--space-4); display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; width: var(--panel-width); min-height: 0; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--map-glass-surface); box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); transition: width .18s ease, height .18s ease, transform .18s ease; }
.map-panel > .map-sheet-toggle { display: none; }
.map-panel.is-collapsed { right: auto; bottom: auto; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md); }
.map-panel.is-collapsed > :not(.map-panel__fold) { display: none; }
.map-panel__toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-1) var(--space-4) var(--space-2); }
.map-panel__query-clear { display: grid; width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1rem; line-height: 1; }
.map-panel__query-clear:hover { background: var(--control-hover-bg); color: var(--text-secondary); }
.map-panel__query-clear[hidden] { display: none; }
#query::-webkit-search-cancel-button { display: none; }
.map-panel__status { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); padding: 0 var(--space-4) var(--space-2); border-bottom: 1px solid var(--border); }
.map-panel__status .map-panel__count { min-width:0; }
.map-panel__count { display: block; color: var(--text-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 500; font-variant-numeric: tabular-nums; }
.map-panel__types { margin: var(--space-2) var(--space-4) var(--space-1); }
.map-panel__filter-disclosure { display: contents; }
.map-panel__filter-disclosure > summary { display: none; }
.map-panel__filter-heading { display: flex; min-width: 0; align-items: baseline; gap: var(--space-2); }
.map-panel__filter-heading small { overflow: hidden; color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.map-panel__filters { display: grid; min-height: 0; gap: var(--space-2); padding: 0 var(--space-4) var(--space-2); }
.map-filter-controls { display: grid; gap: var(--space-2); }
#map-clear-filters { flex-shrink:0; white-space:nowrap; }
.map-filter-row { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); overflow: hidden; }
.map-filter-row > .wb-choice-row { width: 100%; max-width: 100%; min-width: 0; }
.map-filter-row__label { color: var(--text-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; white-space: nowrap; }
.map-filter-range { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); }
.map-filter-range input { width: 100%; accent-color: var(--marker, var(--selection-border)); }
.map-filter-level { --wb-input-width: 3.25rem; --wb-input-align: center; display: grid; grid-template-columns: auto 3.25rem minmax(4rem, 1fr) 3.25rem; align-items: center; gap: var(--space-2); }
.map-filter-level__range { min-width:4rem; }
.map-exp-filter { display: grid; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.map-exp-filter > header { display: flex; min-height: 1.875rem; align-items: center; gap: var(--space-2); }
.map-exp-filter > header strong { color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 650; }
.map-exp-filter > header > span { margin-left: auto; color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.35; }
.map-exp-filter__controls { --wb-input-width: 2.5rem; --wb-input-align: start; --wb-input-padding-inline: .25rem; --wb-input-height: 100%; display: grid; grid-template-columns: auto minmax(5rem, 1fr) auto; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.35; }
.map-exp-filter__controls > span { white-space: nowrap; }
.map-exp-filter__controls label { height: 1.875rem; }
.map-exp-filter__controls label b { padding-left: var(--space-2); color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.35; font-weight: 500; }
.map-exp-filter__range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-1); min-width: 0; color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.map-location-field { width: 100%; }
.map-location-filter { position: relative; min-width: 0; }
.map-location-filter > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); padding: 0 var(--space-2); border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--control-bg); color: var(--control-text); }
.map-location-filter > summary strong { overflow: hidden; color: var(--text); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.map-location-filter > summary svg { width: .875rem; height: .875rem; stroke: currentColor; stroke-width: 1.8; }
.map-location-filter[open] > summary { border-color: var(--control-border-hover); background: var(--control-hover-bg); }
.map-location-filter__menu { position: absolute; z-index: 8; top: calc(100% + var(--space-1)); right: 0; left: 0; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--map-glass-surface); box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); }
.map-location-filter__search { margin: var(--space-2); }
.map-location-filter__list { display: grid; gap: .125rem; max-height: min(17rem, 42svh); overflow: auto; padding: 0 var(--space-1) var(--space-1); overscroll-behavior: contain; }
.map-location-filter__option { display: grid; align-content: center; width: 100%; min-height: 2rem; padding: .25rem .5rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.25; text-align: left; }
.map-location-filter__option:hover { background: var(--data-row-hover-bg); color: var(--text); }
.map-location-filter__option[aria-pressed="true"] { background: var(--selection-bg); color: var(--text); font-weight: 600; box-shadow: none; }
.map-location-filter__option small { margin-top: 1px; color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.2; }
.map-location-filter__empty { margin: 0; padding: var(--space-4) var(--space-2); color: var(--text-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); text-align: center; }
[data-location-search][hidden], [data-location-empty][hidden] { display: none; }
.map-results { display: grid; grid-auto-rows: max-content; align-content: start; min-height: 0; overflow: auto; overscroll-behavior: contain; background: transparent; }
.map-result { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; width: 100%; min-height: 3.5rem; padding: .5rem var(--space-4); color: var(--text); text-align: left; }
.map-result--bilingual { min-height: 4.25rem; }
.map-result > span { display: grid; min-width: 0; align-content: center; gap: 1px; }
.map-result__icon { display: block; width: 2rem; height: 2rem; object-fit: cover; border-radius: var(--radius-sm); background: var(--lu4-image-placeholder); }
.map-panel__heading { min-width: 0; }
.map-result__icon--empty { display: grid; place-items: center; color: var(--text-muted); font-size: var(--type-label-size); line-height: 1; font-weight: 700; }
.map-result__name { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 1px .375rem; font-size: var(--type-dense-size); line-height: 1.35; font-weight: 650; }
.map-result__name-text { min-width: 0; overflow-wrap: anywhere; }
.map-result__qualifier { display: inline-flex; min-width: 1.25rem; height: 1rem; flex: 0 0 auto; align-items: center; justify-content: center; padding: 1px .25rem 0; border: 0; border-radius: .25rem; font-family: var(--font-ui); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-result__level { background: var(--control-hover-bg); color: var(--text-secondary); font-size: var(--type-badge-size); line-height: 1; font-weight: 650; }
.map-result__alternate { display: block; overflow-wrap: anywhere; color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.3; }
.map-result__meta { display: block; overflow-wrap: anywhere; color: var(--text-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); }
.map-result__points { align-self: center; color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; font-variant-numeric: tabular-nums; }
.map-result[aria-pressed="true"] { position: relative; z-index: 1; background: var(--selection-bg); color: var(--text); box-shadow: none; }
.map-result[aria-pressed="true"]:hover { background: var(--control-hover-bg); }
.map-empty { justify-items: start; gap: var(--space-3); margin: var(--space-5) var(--space-4); font-size: var(--type-dense-size); line-height: var(--type-dense-line); }
.map-loading { display: grid; gap: 1px; background: var(--border); }
.map-loading__row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 2rem; align-items: center; gap: var(--space-2); min-height: 3.5rem; padding: .5rem var(--space-4); background: transparent; }
html[lang="zh-CN"] .map-loading__row { min-height: 4.25rem; }
.map-loading__icon, .map-loading__line, .map-loading__count { display: block; border-radius: var(--radius-sm); background: var(--surface-interactive); animation: map-skeleton-pulse 1.25s ease-in-out infinite alternate; }
.map-loading__icon { width: 2rem; height: 2rem; }
.map-loading__copy { display: grid; gap: var(--space-2); }
.map-loading__line { width: min(11rem, 80%); height: .75rem; }
.map-loading__line:last-child { width: min(8rem, 58%); height: .55rem; opacity: .72; }
.map-loading__count { width: 1.5rem; height: .65rem; }
@keyframes map-skeleton-pulse { from { opacity: .42; } to { opacity: .82; } }
.map-pagination { min-height: 2.75rem; padding-right: 2.75rem; border-top: 1px solid var(--border); background: transparent; }
.map-sheet-toggle { display: none; }
.map-level-error { margin: 0; color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); }
.map-location-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.map-location-dialog .map-location-filter__menu { position: static; display: flex; flex-direction: column; min-height: 0; margin-top: var(--space-3); padding: 0; border: 0; background: transparent; box-shadow: none; }
.map-location-dialog .map-location-filter__search { flex: none; }
.map-location-dialog .map-location-filter__list { min-height: 0; max-height: min(24rem, 45dvh); overflow: auto; overscroll-behavior: contain; }
.map-location-dialog .map-location-filter__option { min-height: var(--lu4-touch-target); }
.map-fold-toggle { position: absolute; top: auto; left: auto; right: 0; bottom: 0; z-index: 6; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; padding: 0; overflow: visible; border: 0; background: transparent; color: var(--text-muted); touch-action: none; user-select: none; -webkit-user-select: none; }
.map-fold-toggle::before { position: absolute; right: .55rem; bottom: .55rem; width: .55rem; height: .55rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; opacity: .72; transform-origin: 100% 100%; transition: transform .18s ease, opacity .18s ease, color .18s ease; }
.map-fold-toggle svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: 0; pointer-events: none; }
.map-fold-toggle img { width: 1.75rem; height: 1.75rem; object-fit: contain; border-radius: var(--radius-sm); pointer-events: none; }
.map-fold-toggle:hover { color: var(--text); }
.map-fold-toggle:hover::before { opacity: 1; transform: scale(1.18) translate(-.08rem, -.08rem); }
.map-fold-toggle:active::before { transform: scale(1.05) translate(-.04rem, -.04rem); }
.map-sheet-toggle--context { top: 0; bottom: auto; right: auto; left: 0; }
.map-sheet-toggle--context::before { top: 50%; bottom: auto; right: auto; left: 50%; border-right: 0; border-bottom: 0; border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: translate(-50%, -50%); transform-origin: center; }
.map-sheet-toggle--context:hover::before { transform: translate(-50%, -50%) scale(1.12); }
.map-sheet-toggle--context:active::before { transform: translate(-50%, -50%) scale(1.05); }
.is-collapsed > .map-fold-toggle::before { display: none; }
.is-collapsed > .map-fold-toggle svg { opacity: 1; }
.map-fold-toggle:focus-visible, .map-context__close:focus-visible { outline-offset: -3px; }
.map-panel, .map-context__card { transition: none; }
[data-fold-motion] { will-change: clip-path, opacity; }
.map-panel.is-collapsed .map-panel__fold { position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: transparent; box-shadow: inset 0 1px 0 var(--inset-highlight); }
.map-panel.is-collapsed .map-panel__fold::before { display: none; }
.map-panel.is-collapsed .map-panel__fold svg { opacity: 1; }

.map-stage { position: absolute; inset: 0; min-width: 0; min-height: 0; overflow: hidden; background: var(--lu4-map-canvas); }
.map-stage__viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.map-stage__viewport.has-marker-hover { cursor: pointer; }
.map-stage__viewport.is-dragging { cursor: grabbing; }
.map-stage__world { position: absolute; top: 0; left: 0; width: 1812px; height: 2620px; transform-origin: 0 0; will-change: transform; }
.map-stage__image { display: block; width: 100%; height: 100%; user-select: none; }
.map-stage__canvas { position: absolute; inset: 0; pointer-events: none; }
.map-stage__tooltip { position: absolute; z-index: 4; width: max-content; min-width: 9.5rem; max-width: min(18rem, calc(100% - var(--space-6))); border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-background); color: var(--text); pointer-events: none; box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); }
.map-stage__tooltip .map-stage__tooltip-level,
.map-stage__stack-option > b { align-self: center; }
.map-stage__tooltip .map-stage__tooltip-level[hidden] { display: none; }
.map-stage__stack-menu { position: absolute; z-index: 4; display: grid; width: max-content; min-width: 12rem; max-width: min(18rem, calc(100% - var(--space-6))); max-height: min(20rem, 55svh); padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--map-glass-surface); color: var(--text); box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); }
.map-stage__stack-option { width: 100%; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.map-stage__stack-option + .map-stage__stack-option { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--border) 52%, transparent); }
.map-stage__stack-option:hover, .map-stage__stack-option:focus-visible { background: var(--control-hover-bg); }
.map-stage__tooltip[hidden], .map-stage__stack-menu[hidden], .map-context[hidden] { display: none; }
.map-stage__legend { position: absolute; top: calc(var(--shell-header-height) + var(--space-4)); left: 50%; z-index: 2; display: flex; align-items: flex-start; width: max-content; max-width: calc(100% - 6rem); border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--map-glass-surface); color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; transform: translateX(-50%); box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); }
.map-stage__legend[hidden], .map-stage__legend-items[hidden] { display: none; }
.map-stage__legend-toggle { display: inline-flex; flex: 0 1 auto; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; max-height: inherit; padding: 0; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) {
  .map-stage__legend-toggle:hover { background: var(--control-hover-bg); }
}
.map-stage__legend-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.map-stage__legend-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); min-width: 0; padding: var(--space-2) var(--space-3); }
.map-stage__legend:not(.is-collapsed) .map-stage__legend-preview { display: none; }
.map-stage__legend-items { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; min-height: 44px; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); }
.map-stage__legend-item { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.map-legend-clock { width: 1rem; height: 1rem; flex: 0 0 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:is(.map-stage__legend-item, .map-stage__legend-preview) i { width: .75rem; height: .75rem; flex: 0 0 .75rem; border: 1px solid var(--lu4-map-legend-outline); border-radius: 50%; background: var(--legend); }
:is(.map-stage__legend-item, .map-stage__legend-preview) i.is-diamond { width: .675rem; height: .675rem; flex-basis: .675rem; border-radius: 1px; transform: rotate(45deg); }
:is(.map-stage__legend-item, .map-stage__legend-preview) i.is-square { width: .675rem; height: .675rem; flex-basis: .675rem; border-radius: 2px; }
.map-context { position: absolute; top: auto; right: var(--space-4); bottom: var(--space-4); z-index: 5; display: grid; align-content: end; gap: var(--space-2); width: min(var(--panel-width), calc(100% - var(--space-8))); max-height: calc(100% - var(--shell-header-height) - var(--space-8)); overflow: hidden; }
.map-context.is-adaptive-suppressed { display: none; }
.map-context__card { --context-rule-inset: .375rem; position: relative; display: flex; width: 100%; max-height: calc(100svh - var(--shell-header-height) - var(--space-8)); flex-direction: column; gap: .625rem; padding: .875rem; overflow: hidden; overscroll-behavior: contain; container-type: inline-size; container-name: map-context-card; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--map-glass-surface); box-shadow: var(--floating-shadow), inset 0 1px 0 var(--inset-highlight); -webkit-backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); backdrop-filter: var(--glass-canvas-backdrop, var(--glass-backdrop)); }
.map-context__scroll { display: grid; grid-auto-rows: max-content; align-content: start; min-height: 0; flex: 1 1 auto; gap: .625rem; overflow: auto; overscroll-behavior: contain; }
/* Hidden slots must leave no grid track (and no extra gap) between siblings. */
.map-context__scroll > [hidden] { display:none; }
.map-context__timer > .boss-timer--compact { margin-block:0; }
@media (min-width: 640px) {
  .map-context:has(.map-context__card--secondary:not([hidden])) .map-context__card { max-height: calc((100svh - var(--shell-header-height) - var(--space-8) - var(--space-2)) / 2); }
}
.map-context__card.is-collapsed { justify-self: end; width: 2.75rem; height: 2.75rem; min-height: 2.75rem; max-height: 2.75rem; padding: 0; overflow: hidden; border-radius: var(--radius-md); box-shadow: none; container-type: normal; }
.map-context__card.is-collapsed > .map-fold-toggle { inset: 0; width: 100%; height: 100%; }
.map-context__card.is-collapsed > :not(.map-sheet-toggle) { display: none; }
/* Square corner targets keep the top and side insets balanced without a full toolbar. */
.map-context__card:not(.is-collapsed) { padding-top: 2.25rem; }
.map-context__card:not(.is-collapsed) > .map-fold-toggle { width: 2.25rem; height: 2.25rem; }
.map-context__card > .map-context__close { position: absolute; top: 0; right: 0; z-index: 6; width: 2.25rem; height: 2.25rem; min-height: 0; }
.map-context__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.map-context__head-actions { display: flex; flex: 0 0 auto; align-self: center; align-items: center; gap: var(--space-1); }
.map-context__identity { display: flex; flex: 1 1 auto; align-items: center; gap: .625rem; min-width: 0; }
.map-context__identity > div { min-width: 0; }
.map-context__icon { width: 3rem; height: 3rem; flex: 0 0 3rem; border-radius: var(--radius-md); object-fit: cover; background: var(--lu4-image-placeholder); }
.map-context__icon:not([src]), .map-context__icon[src=""] { display: none; }
.map-context__kicker { margin: 0 0 1px; color: var(--lu4-accent); font-size: var(--type-micro-size); font-weight: 750; line-height: 1.4; }
.map-context__title { margin: 0; color: var(--text); font-size: var(--type-component-title-size); line-height: 1.3; }
.map-context__alternate-name { margin: 1px 0 0; color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.4; }
.map-context__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.map-context__badges[hidden], .map-context__extras[hidden] { display: none; }
.map-context__summary-badge { display: inline-flex; min-height: 1.5rem; align-items: center; gap: var(--space-1); padding: .1875rem .5rem; border: 1px solid var(--control-border); border-radius: 999px; background: var(--control-bg); color: var(--text-secondary); font: 500 var(--type-micro-size)/1 var(--font-ui); }
.map-context__summary-badge small,
.map-context__summary-badge strong { display: block; font-size: inherit; line-height: 1; }
.map-context__summary-badge small { color: var(--text-muted); }
.map-context__summary-badge strong { color: var(--text); font-family: inherit; font-weight: 650; font-variant-numeric: tabular-nums; }
.map-context__description { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.65; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.map-context__section { display: grid; gap: var(--space-2); }
.map-context__section[hidden] { display: none; }
.map-context__section > h3,
.map-context__relation-section h3 { display: flex; min-height: 1.5rem; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 700; }
.map-context__section > h3 b,
.map-context__relation-section h3 b,
.map-context__disclosure summary b { display: inline-grid; min-width: 1.375rem; height: 1.375rem; place-items: center; padding-inline: .35rem; border-radius: 999px; background: var(--surface-interactive); color: var(--text-secondary); font-size: var(--type-micro-size); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-context__facts { --fact-inline-padding: var(--context-rule-inset); display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; border: 0; border-radius: 0; background: transparent; }
.map-context__fact { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 1.875rem; column-gap: .75rem; padding: .125rem var(--fact-inline-padding); border: 0; background: transparent; }
.map-context__fact--group-start { margin-top: .375rem; padding-top: .5rem; }
.map-context__fact--group-start::before { position: absolute; top: 0; right: var(--fact-inline-padding); left: var(--fact-inline-padding); height: 1px; background: color-mix(in srgb, var(--border) 52%, transparent); content: ""; }
.map-context__fact > span { color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 400; }
.map-context__fact > strong { justify-self: end; overflow-wrap: anywhere; color: var(--control-text); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 400; text-align: right; }
.map-context__fact--quest { grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; }
.map-context__fact--quest > strong { min-width: 0; }
.map-context__fact-value { min-width: 0; justify-self: end; color: var(--control-text); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 400; text-align: right; }
.map-context__area-disclosure { grid-column: 1; border: 0; }
.map-context__area-disclosure summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 1rem; align-items: center; min-height: 1.875rem; column-gap: .5rem; padding: .125rem var(--fact-inline-padding); border-radius: var(--radius-sm); }
.map-context__area-disclosure summary:hover { background: var(--control-hover-bg); }
.map-context__area-disclosure summary > span { color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 400; }
.map-context__area-disclosure summary > strong { justify-self: end; overflow-wrap: anywhere; color: var(--control-text); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 400; text-align: right; }
.map-context__area-disclosure summary svg { width: 1rem; height: 1rem; stroke: var(--text-muted); stroke-width: 1.75; }
.map-context__area-more { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; padding: 0 calc(var(--fact-inline-padding) + 1.5rem) .0625rem var(--fact-inline-padding); }
.map-context__area-more a { display: flex; min-height: 1.5rem; align-items: center; color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 550; text-align: right; text-decoration: none; }
.map-context__area-more a:hover { color: var(--link-hover); }
.map-context__relation-section { display: grid; gap: var(--space-2); }
.map-context__relation-section[hidden] { display: none; }
.map-context__rewards { padding: 0; gap: .625rem; }
.map-context__rewards > h3,
[data-entity-key^="quest:"] .map-context__relation-section > h3 { color: var(--lu4-accent); font-size: 1rem; font-weight: 600; }
[data-entity-key^="quest:"] .map-context__relation-section { margin-top: .25rem; padding-top: .875rem; border-top: 1px solid var(--border); gap: .625rem; }
[data-entity-key^="quest:"] .map-context__relation-section h3 b { height: auto; min-width: 0; padding: 0; border-radius: 0; background: transparent; color: var(--text-muted); font-weight: 500; }
.map-context__relations { display: grid; }
.map-context__source-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .375rem; margin-bottom: .5rem; }
.map-context__source-switch button { display: grid; min-width: 0; min-height: 2.5rem; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); padding: .375rem .625rem; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--control-bg); color: var(--text-secondary); text-align: left; }
.map-context__source-switch button:hover { border-color: var(--control-border-hover); background: var(--control-hover-bg); color: var(--text); }
.map-context__source-switch button[aria-pressed="true"] { border-color: var(--selection-border); background: var(--selection-bg); color: var(--text); }
.map-context__source-switch,
.map-context__relation-group { --source-color: var(--lu4-accent); }
.map-context__source-switch span { display: flex; align-items: center; gap: .375rem; overflow: hidden; font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.map-context__source-switch span::before { width: .5rem; height: .5rem; flex: 0 0 .5rem; border-radius: 50%; background: var(--source-color); content: ""; }
.map-context__source-switch b { display: inline-grid; min-width: 1.375rem; height: 1.375rem; place-items: center; padding-inline: .35rem; border-radius: 999px; background: var(--surface); color: var(--text-secondary); font-size: var(--type-micro-size); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-context__source-results { display: grid; }
.map-context__relation-group { display: grid; gap: .125rem; }
.map-context__relation-group + .map-context__relation-group { position: relative; margin-top: .5rem; padding-top: .5rem; }
.map-context__relation-group + .map-context__relation-group::before { position: absolute; top: 0; right: var(--context-rule-inset); left: var(--context-rule-inset); height: 1px; background: color-mix(in srgb, var(--border) 64%, transparent); content: ""; }
.map-context__relation-group h4 { display: flex; min-height: 1.375rem; align-items: center; gap: var(--space-2); margin: 0; color: var(--source-color, var(--text-secondary)); font-size: var(--type-micro-size); line-height: 1.35; font-weight: 700; }
.map-context__relation-group h4::before { width: 2px; height: .875rem; border-radius: 999px; background: var(--source-color, var(--selection-border)); content: ""; }
.map-context__relation-group h4 b { display: inline-grid; min-width: 1.25rem; height: 1.25rem; place-items: center; padding-inline: .3125rem; border-radius: 999px; background: var(--surface-interactive); color: var(--source-color, var(--text-secondary)); font-size: var(--type-badge-size); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-context__relation-group h4 small { margin-left: auto; color: var(--text-muted); font-size: var(--type-badge-size); line-height: 1.35; font-weight: 500; }
.map-context__relation-group > div { display: grid; }
.map-context__relation { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; width: 100%; min-height: 2.625rem; padding: .3125rem var(--space-1); border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--type-label-size); line-height: 1.4; text-align: left; }
.map-context__relation:hover,
.map-context__relation[aria-selected="true"] { color: var(--text); }
.map-context__relation > img { width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm); background: var(--lu4-image-placeholder); object-fit: cover; }
.map-context__relation-identity { display: grid; min-width: 0; align-content: center; gap: 1px; }
.map-context__relation-title { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: .375rem; }
.map-context__relation strong { overflow-wrap: anywhere; color: var(--control-text); font-weight: 600; }
.map-context__relation small { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--type-label-size); }
.map-context__relation .map-context__relation-level { display: inline-flex; min-width: 1.25rem; height: 1rem; flex: 0 0 auto; align-items: center; justify-content: center; margin: 0; padding: 1px .25rem 0; border-radius: .25rem; background: var(--control-hover-bg); color: var(--text-secondary); font-size: var(--type-badge-size); line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-context__relation .map-context__relation-alternate { color: var(--text-secondary); }
.map-context__relation-trailing { display: flex; min-width: 0; max-width: 8rem; align-items: center; justify-content: flex-end; gap: .4rem; color: var(--text-secondary); text-align: right; }
.map-context__relation-trailing small { margin: 0; color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.35; font-weight: 500; font-variant-numeric: tabular-nums; }
.map-context__relation-trailing i { flex: 0 0 auto; color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.5; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.map-context__step-index { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; padding: 0; border: 1px solid var(--control-border-hover); border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: var(--type-micro-size); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.map-context__step-copy { color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.5; }
.map-quest-step { padding-block: .375rem; min-width: 0; }
.map-quest-step__action { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .5rem; align-items: start; }
.map-quest-step .map-context__step-copy { padding-top: .125rem; font-size: var(--type-dense-size); line-height: 1.65; color: var(--text); }
.map-context button.map-quest-npc { display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: var(--lu4-accent); font: inherit; text-align: inherit; cursor: pointer; }
.map-quest-instructions { margin: .375rem 0 0; padding-left: 1rem; color: var(--text-secondary); font-size: var(--type-label-size); }
.map-quest-instructions li + li { margin-top: .125rem; }
.map-quest-step[data-selected="true"] .map-context__step-index { border-color: var(--selection-border); background: var(--selection-bg); color: var(--lu4-accent); }
.map-quest-step .map-context__step-index:disabled { opacity: .6; cursor: default; }
.map-quest-step .map-context__entity-ref { color: inherit; font-weight: inherit; }
.map-quest-step button.map-context__entity-ref { display: inline; margin: 0; padding: 0; border: 0; background: transparent; font: inherit; text-align: inherit; cursor: pointer; }
.map-quest-step .map-context__entity-ref[data-entity-type="npc"] { color: var(--lu4-accent); font-weight: 500; text-underline-offset: .15em; }
.map-quest-step button.map-context__entity-ref:hover,
.map-quest-step button.map-context__entity-ref:focus-visible,
.map-quest-step button.map-context__entity-ref[aria-pressed="true"] { color: var(--lu4-accent-hover); text-decoration: underline; }
.map-context { --quest-target-row-min: 2rem; --quest-target-line: 1.5; --quest-target-open-gap: .25rem; --wb-inline-entity-icon-size: 1.125rem; --wb-inline-entity-secondary-size: var(--type-label-size); }
.map-quest-targets { margin: .375rem 0 0 2.25rem; color: var(--text-secondary); }
.map-quest-targets summary { cursor: pointer; font-size: var(--type-label-size); padding-block: .25rem; }
.map-quest-targets > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: var(--quest-target-open-gap); }
details.map-quest-targets[open] > summary { margin-bottom: 0; }
details.map-quest-route-option[open] > summary { margin-bottom: var(--quest-target-open-gap); }
.map-quest-targets--expanded, .map-quest-targets--expanded > div { margin-top: 0; }
.map-quest-targets button { display: flex; align-items: center; gap: .375rem; width: fit-content; max-width: 100%; min-height: var(--quest-target-row-min); padding: .125rem 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--type-label-size); line-height: var(--quest-target-line); text-align: left; cursor: pointer; }
.map-quest-targets button span { min-width: 0; overflow-wrap: anywhere; }
.map-quest-targets button:hover span,
.map-quest-targets button[aria-pressed="true"] span { color: var(--link); text-decoration: underline; text-underline-offset: .15em; }
.map-quest-stage { min-width: 0; }
.map-quest-directory { display: grid; gap: .375rem; margin: .5rem 0; padding-block: .5rem; font-size: var(--type-label-size); }
.map-quest-directory a { color: var(--link); text-decoration: none; }
.map-quest-directory a:hover { text-decoration: underline; }
.map-quest-choice { margin: .75rem 0 .25rem; color: var(--text); font-size: var(--type-dense-size); font-weight: 600; }
.map-quest-notice { margin: .5rem 0 .75rem; padding: .5rem .625rem; border-radius: var(--radius-sm); background: var(--control-bg); color: var(--text-secondary); font-size: var(--type-label-size); line-height: 1.65; }
.map-quest-inferred { display: block; margin-top: .25rem; color: var(--text-muted); font-size: var(--type-label-size); }
.map-quest-stage > h4 { margin: .5rem 0 .25rem; color: var(--text-secondary); font-size: var(--type-label-size); font-weight: 600; }
.map-quest-step__supplement { margin-left: 2.25rem; min-width: 0; font-size: var(--type-label-size); line-height: 1.65; }
.map-quest-recovery { margin: .5rem 0 0 2.25rem; }
.map-quest-recovery > h5 { margin: 0; font-size: var(--type-dense-size); line-height: 1.65; font-weight: 600; color: var(--text); }
.map-quest-recovery > .map-quest-step { margin-top: .25rem; }
.map-quest-step__supplement:empty { display: none; }
.map-quest-conditions { margin-block: .375rem; font-size: var(--type-label-size); color: var(--text-secondary); }
.map-quest-conditions p { margin: 0; }
.map-quest-conditions p + p { margin-top: .25rem; }
.map-quest-disclosure, .map-quest-optional-stage { margin-top: .5rem; font-size: var(--type-label-size); color: var(--text-secondary); }
.map-quest-disclosure > summary, .map-quest-optional-stage > summary { padding-block: .5rem; cursor: pointer; color: var(--text); overflow-wrap: anywhere; }
.map-quest-disclosure > summary small, .map-quest-optional-stage > summary small { margin-left: .5rem; color: var(--text-muted); font-size: var(--type-micro-size); font-weight: 400; }
.map-quest-disclosure > summary:focus-visible, .map-quest-optional-stage > summary:focus-visible { outline: 2px solid var(--selection-border); outline-offset: 2px; border-radius: var(--radius-sm); }
.map-quest-disclosure__hint { margin: .125rem 0 .5rem; color: var(--text-muted); }
.map-quest-optional-stage { margin-top: .75rem; }
.map-quest-optional-stage > summary { font-weight: 600; }
.map-quest-optional-stage > div { padding-bottom: .25rem; }
.map-quest-alternative-list, .map-quest-reward-entries, .map-quest-trade-list { list-style: none; margin: 0; padding: 0; }
.map-quest-alternative-list > li, .map-quest-trade-list > li { padding-block: .5rem; overflow-wrap: anywhere; }
.map-quest-alternative-list > li + li { padding-top: .75rem; }
section.map-quest-alternatives > h5 { margin: 0 0 .25rem; font: inherit; font-weight: 600; }
section.map-quest-alternatives > .map-quest-alternative-list > li { padding-block: .125rem; }
section.map-quest-alternatives .map-quest-inline-exchange { margin: 0; }
.map-quest-notes > li { padding-block: .25rem; }
.map-quest-notes > li + li { padding-top: .25rem; }
.map-quest-trade-list > li + li { border-top: 1px solid var(--border); }
.map-quest-alternative-list p, .map-quest-trade-list p { margin: 0 0 .25rem; line-height: 1.65; }
.map-quest-alternative-list h5 { margin: 0 0 .375rem; color: var(--text); font-size: var(--type-label-size); font-weight: 600; }
.map-quest-trade__line { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: .375rem; line-height: 1.7; }
.map-quest-trade__line + .map-quest-trade__line { margin-top: .25rem; }
.map-quest-trade__label { font-size: var(--type-micro-size); color: var(--text-muted); }
.map-quest-supply { display: inline; }
.map-quest-supply b { font-weight: 600; color: var(--text); white-space: nowrap; }
.map-quest-reward-entries > li { padding-block: .25rem; line-height: 1.65; }
.map-quest-reward-entries .map-quest-bundle { border-left: 2px solid var(--border); padding-left: .5rem; margin-block: .25rem; }
.map-quest-bundle__join { color: var(--text-muted); }
@media (pointer: coarse) { .map-quest-disclosure > summary, .map-quest-optional-stage > summary { min-height: 2.75rem; align-content: center; } }
.map-quest-step-choices { min-width: 0; padding-block: .375rem; }
.map-quest-step-choices > header { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .5rem; align-items: start; }
.map-quest-step-choices__number[aria-pressed="true"] { border-color: var(--selection-border); background: var(--selection-bg); color: var(--lu4-accent); }
.map-quest-step-choices__number:disabled { opacity: .6; cursor: default; }
.map-quest-step-choices > header > div { min-width: 0; }
.map-quest-step-choices > header h4 { margin: 0; padding-top: .125rem; font-size: var(--type-dense-size); line-height: 1.65; font-weight: 500; color: var(--text); }
.map-quest-step-choices .map-quest-choice { margin: .25rem 0 .5rem; font-size: var(--type-label-size); font-weight: 400; color: var(--text-secondary); }
.map-quest-route-option { min-width: 0; margin: .375rem 0 0 2.25rem; font-size: var(--type-label-size); }
.map-quest-route-option > summary { color: var(--text); line-height: 1.65; }
.map-quest-step--option .map-quest-step__action { display: flex; flex-direction: column; gap: .25rem; }
.map-quest-step--option { padding: 0 0 .375rem; }
.map-quest-step--option .map-context__step-copy { order: -1; }
.map-quest-step--option .map-quest-targets, .map-quest-step--option .map-quest-step__supplement { margin-left: 0; }
.map-quest-stage-choices > .map-quest-optional-stage { margin-left: 2.25rem; }
.map-quest-step-choices--nested > header { grid-template-columns: minmax(0, 1fr); }
.map-quest-step-choices--nested > .map-quest-route-option { margin-left: 0; }
.map-quest-step-choices > .map-quest-step--option,
.map-quest-step-choices > .map-context__step-copy { margin-left: 2.25rem; }
.map-context__extras { display: grid; gap: 0; }
.map-context__fact--attribute { grid-template-columns: max-content minmax(0, 1fr); column-gap: .5rem; }
.map-context__fact--attribute > span { white-space: nowrap; }
.map-context__fact--attribute .map-context__fact-value { width: 100%; }
.map-context__attribute-values { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .125rem .375rem; }
.map-context__attribute-values > span { display: inline; padding: 0; border: 0; color: var(--attribute-color); font: inherit; white-space: nowrap; }

@container map-context-card (max-width: 19rem) {
  .map-context__head,
  .map-context__identity { gap: var(--space-2); }
  .map-context__icon { width: 2.75rem; height: 2.75rem; flex-basis: 2.75rem; }
  .map-context__title { font-size: 1rem; }
  .map-context__badge { min-width: 2.75rem; min-height: 2.75rem; }
}

.map-context__disclosure { position: relative; border-top: 0; }
.map-context__disclosure::before { position: absolute; z-index: 1; top: 0; right: var(--context-rule-inset); left: var(--context-rule-inset); height: 1px; background: color-mix(in srgb, var(--border) 52%, transparent); content: ""; pointer-events: none; }
.map-context__disclosure > summary { display: grid; min-height: 2.75rem; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); padding: 0 var(--context-rule-inset); color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 700; }
.map-context__disclosure > summary b { min-width: auto; height: auto; padding: 0; background: transparent; color: var(--text-muted); }
.map-context__disclosure > summary svg { width: .875rem; height: .875rem; stroke: currentColor; stroke-width: 1.8; }
.map-context__list { display: grid; }
.map-context__list-row { position: relative; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; min-height: 3rem; align-items: center; gap: var(--space-2); padding: .4375rem 0; border-top: 0; }
.map-context__list-row::before { position: absolute; top: 0; right: var(--context-rule-inset); left: var(--context-rule-inset); height: 1px; background: color-mix(in srgb, var(--border) 64%, transparent); content: ""; }
.map-context__list-row img { width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm); background: var(--lu4-image-placeholder); object-fit: cover; }
.map-context__list-row > span { display: grid; min-width: 0; align-content: center; gap: 2px; }
.map-context__list-row strong, .map-context__list-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-context__list-row strong { color: var(--control-text); font-size: var(--type-label-size); line-height: 1.3; font-weight: 650; }
.map-context__list-row small { color: var(--text-muted); font-size: var(--type-micro-size); line-height: 1.25; }
.map-context__list-row > b { justify-self: end; color: var(--text); font-size: var(--type-micro-size); line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-context__entity-ref { color: var(--link); font-weight: 650; }
.map-context__entity-ref:hover { color: var(--link-hover); }
.map-context__link { position: sticky; z-index: 2; bottom: 0; display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 2.5rem; margin-top: .125rem; padding: 0 .75rem; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--control-bg); color: var(--control-text); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 650; text-align: center; text-decoration: none; }
.map-context__card > .map-context__link { position: relative; flex: 0 0 auto; width: auto; }
.map-context__link:hover { background: var(--control-hover-bg); border-color: var(--control-border-hover); color: var(--lu4-accent-hover); }
.map-context__link > svg { width: .875rem; height: .875rem; flex: 0 0 .875rem; fill: none; stroke: var(--lu4-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.map-context__point { display: flex; flex-direction: column; gap: .625rem; }
.map-context__point[hidden] { display: none; }
.map-context__point a { width: max-content; color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; text-decoration: none; }
.map-context__point > .map-context__link { width: auto; color: var(--control-text); }
.map-context__point-facts { margin-top: var(--space-1); }
/* Bounded side panels on tablets and laptops, including portrait and short landscape. */
@media (min-width: 640px) and (max-width: 1279px) {
  .map-app { --panel-width: clamp(var(--map-tablet-panel-min), 30vw, var(--map-tablet-panel-max)); --map-panel-inset: var(--space-3); }
  .map-app.is-single-overlay { --panel-width: clamp(19rem, 38vw, 20rem); }
  .map-panel { top: calc(var(--shell-header-height) + var(--space-3)); bottom: var(--space-3); left: var(--space-3); }
  .map-context { top: auto; right: var(--space-3); bottom: var(--space-3); width: min(var(--panel-width), calc(100% - var(--space-6))); max-height: calc(100% - var(--shell-header-height) - var(--space-6)); }
  .map-context__card { max-height: calc(100svh - var(--shell-header-height) - var(--space-6)); }
  .map-stage__legend { top: calc(var(--shell-header-height) + var(--space-3)); max-width: calc(100% - var(--space-6)); }
}

/* Sheets are reserved for phone widths. */
@media (max-width: 639px) {
  .map-app { --panel-width: 0px; height: 100%; min-height: 0; }
  .map-stage { left: 0; height: auto; }
  .map-stage__legend { top: calc(var(--shell-header-height) + var(--space-3)); max-width: calc(100% - var(--space-6)); z-index: 3; }
  .map-stage__legend-items { display: flex; flex-direction: column; align-items: stretch; min-height: 0; gap: var(--space-2); padding: .625rem var(--space-3); }
  .map-stage__legend-item { min-height: 24px; }
  .map-ui-stack { position: absolute; z-index: 5; top: calc(var(--shell-header-height) + var(--space-3)); right: var(--space-3); bottom: var(--space-3); left: var(--space-3); display: block; pointer-events: none; }
  /* Keep corner entries on screen even when the shell's minimum artboard is taller. */
  .map-ui-stack { max-height: calc(100svh - var(--shell-header-height) - var(--space-3) - var(--space-3)); max-height: calc(100dvh - var(--shell-header-height) - var(--space-3) - var(--space-3)); }
  .map-panel, .map-context__card { pointer-events: auto; }
  .map-panel { position: absolute; inset: 0 0 auto; display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; width: 100%; height: var(--sheet-mobile-expanded-height); max-height: calc(100% - var(--space-8)); overflow: hidden; border-width: 1px; border-radius: var(--radius-lg); padding-bottom: 0; }
  .map-panel > .map-sheet-toggle { display: grid; }
  .map-panel__fold { display: none; }
  .map-panel__types { margin: var(--space-2) var(--space-3) 0; }
  .map-panel__toolbar { padding: var(--space-1) var(--space-3); }
  .map-panel__filter-disclosure { display: grid; min-height: 0; max-height: var(--sheet-mobile-filter-height); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .map-panel__filter-disclosure > summary { display: flex; min-height: 2rem; align-items: center; justify-content: space-between; padding: 0 var(--space-3); color: var(--text-secondary); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: 600; }
  .map-panel__filter-disclosure > summary svg { width: .875rem; height: .875rem; stroke: currentColor; stroke-width: 1.8; }
  .map-panel__filters { max-height: calc(var(--sheet-mobile-filter-height) - 2rem); overflow: auto; padding: 0 var(--space-3) var(--space-2); overscroll-behavior: contain; }
  .map-panel__status { padding:.125rem var(--space-3); }
  /* Count and reset share the result status row, not the filter disclosure. */
  .map-panel__filter-heading small { display:none; }
  .map-panel__count { line-height: 1.5rem; }
  .map-result { grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: var(--space-2); min-height: 3.25rem; padding: .375rem var(--space-3); }
  .map-result--bilingual { min-height: 4rem; }
  .map-result__icon { width: 1.75rem; height: 1.75rem; }
  .map-result__name { font-size: var(--type-dense-size); line-height: 1.35; }
  .map-result__alternate { line-height: 1.3; }
  .map-result__meta { line-height: var(--type-label-line); }
  .map-loading__row { min-height: 3.25rem; padding: .375rem var(--space-3); }
  html[lang="zh-CN"] .map-loading__row { min-height: 4rem; }
  .map-pagination { position: relative; z-index: 4; min-height: 2.75rem; padding-block: 0; padding-right: 2.75rem; border-top: 0; }
  .map-sheet-toggle--search { grid-row: auto; }
  .map-location-filter__menu { position: relative; top: auto; margin-top: var(--space-1); }
  .map-location-filter__option { min-height: 2rem; }
  .map-location-filter__list { max-height: 10rem; }
  .map-results { min-height: 0; overflow: auto; }
  .map-panel.is-collapsed { position: absolute; inset: 0 auto auto 0; display: block; width: var(--sheet-collapsed-height); height: var(--sheet-collapsed-height); min-height: var(--sheet-collapsed-height); max-height: var(--sheet-collapsed-height); padding-bottom: 0; overflow: hidden; border-radius: var(--radius-md); transform: none; }
  .map-panel.is-collapsed > :not(.map-sheet-toggle--search) { display: none; }
  .map-panel.is-collapsed > .map-sheet-toggle--search { position: relative; inset: auto; display: grid; width: 100%; height: 100%; padding: 0; border-radius: inherit; }
  .map-panel.is-collapsed > .map-sheet-toggle--search::after { top: 0; bottom: auto; }
  .map-panel { transition: none; }
  .map-context { position: absolute; inset: auto 0 0; display: flex; width: 100%; max-height: calc(100% - var(--space-8)); flex-direction: column; overflow: visible; gap: var(--space-2); pointer-events: none; }
  /* 顶部操作区与正文分离，正文单独滚动；表面色只在卡片上。 */
  .map-context__card { position: relative; display: flex; flex-direction: column; width: 100%; height: auto; max-height: var(--sheet-mobile-expanded-height); padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
  .map-context__scroll { flex: 1 1 auto; min-height: 0; display: grid; gap: .5rem; padding: .25rem .625rem .625rem; overflow: auto; overscroll-behavior: contain; }
  .map-context__head { gap: var(--space-2); padding-right: 2.75rem; }
  .map-context__identity { gap: var(--space-2); }
  .map-context__icon { width: 2.75rem; height: 2.75rem; flex-basis: 2.75rem; }
  .map-context__head-actions { gap: var(--space-1); }
  .map-context__badge { min-width: 2.75rem; min-height: 2.75rem; }
  .map-context__fact { padding-right: var(--fact-inline-padding); padding-left: var(--fact-inline-padding); }
  .map-context__link { min-height: 2.25rem; }
  .map-context__card > .map-context__link { width: auto; margin: 0 .625rem .625rem; }
  .map-context__point { gap: var(--space-2); }
  /* 谁先出现谁在下：主体固定下方、次级固定上方；折叠/展开不改序 */
  .map-context__card--primary { order: 2; }
  .map-context__card--secondary { order: 1; }
  .map-context__card.is-collapsed { align-self: flex-end; width: var(--sheet-collapsed-height); container-type: normal; flex: 0 0 var(--sheet-collapsed-height); height: var(--sheet-collapsed-height); min-height: var(--sheet-collapsed-height); max-height: var(--sheet-collapsed-height); padding: 0; overflow: hidden; border-radius: var(--radius-md); }
  .map-context__card.is-collapsed > :not(.map-sheet-toggle--context) { display: none; }
  .map-context__card.is-collapsed > .map-sheet-toggle--context { position: absolute; inset: 0; display: grid; width: 100%; height: 100%; padding: 0; border-radius: inherit; }
  .is-collapsed > .map-sheet-toggle::after { display: none; }
  .is-collapsed > .map-sheet-toggle:hover { background: var(--control-hover-bg); }
  .is-collapsed > .map-sheet-toggle:active { background: var(--selection-bg); }
  .map-sheet-toggle > svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .map-sheet-toggle > img { width: 1.75rem; height: 1.75rem; object-fit: contain; border-radius: var(--radius-sm); pointer-events: none; }
  /* Both entities remain reachable; opening one collapses, rather than hides, the other. */
}

@media (max-width: 639px) and (max-height: 599px) {
  .map-panel__types { margin-top: var(--space-1); margin-bottom: 0; }
  .map-panel__toolbar { padding-block: var(--space-1); }
  .map-panel__filter-disclosure > summary { min-height: 2.25rem; }
  .map-panel__status { padding-bottom: var(--space-1); }
  .map-panel__count { font-size: var(--type-label-size); }
}

/* Filter dimensions share the site's single-line, horizontally scrollable choices. */
.map-filter-row { align-items: center; }
.map-filter-row .wb-chip { white-space: nowrap; }
.map-location-dialog .map-location-filter__menu { -webkit-backdrop-filter: none; backdrop-filter: none; }
.map-panel:not(.is-collapsed):has(.map-pagination[hidden]) { padding-bottom: 2.75rem; }
.is-collapsed > .map-sheet-toggle::before { display: none; }
.is-collapsed > .map-sheet-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
@media (min-width: 640px) {
  .map-panel__filters { max-height: min(34svh, 22rem); overflow: auto; overscroll-behavior: contain; }
  /* Grow with content, not the canvas. The result track scrolls once the cap is reached. */
  .map-panel:not(.is-collapsed) {
    bottom: auto;
    height: auto;
    max-height: min(45rem, calc(100svh - var(--shell-header-height) - var(--map-panel-inset, var(--space-4)) * 2));
    max-height: min(45rem, calc(100dvh - var(--shell-header-height) - var(--map-panel-inset, var(--space-4)) * 2));
  }
}
@media (min-width: 640px) and (max-width: 959px), (min-width: 640px) and (max-height: 639px) {
  .map-panel__filter-disclosure { display: grid; min-height: 0; grid-template-rows: auto minmax(0, 1fr); max-height: min(45svh, 18rem); overflow: hidden; border-block: 1px solid var(--border); }
  .map-panel__filter-disclosure > summary { display: flex; align-items: center; justify-content: space-between; min-height: 2rem; padding: 0 var(--space-3); font-size: var(--type-label-size); color: var(--text-secondary); }
  .map-panel__filter-disclosure > summary svg { width: 1rem; height: 1rem; stroke: currentColor; }
  .map-panel__filters { max-height: calc(min(45svh, 18rem) - 2rem); }
  .map-panel__status { display:flex; padding:.125rem var(--space-3); }
  .map-panel__filter-heading small { display:none; }
  .map-panel { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; }
  .map-context__head { flex-wrap: wrap; }
}
@media (max-width: 639px) {
  .map-context__head { padding-right: 0; }
}
@media (min-width: 640px) and (max-height: 480px) {
  .map-panel { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
  .map-panel__heading { grid-column: 1 / -1; }
  .map-panel__toolbar { grid-column: 1; grid-row: 2; padding-right: var(--space-1); }
  .map-panel__filter-disclosure { display:contents; }
  .map-panel__filter-disclosure::details-content { display:contents; }
  .map-panel__filter-disclosure > summary { grid-column:2; grid-row:2; align-self:center; gap:var(--space-1); padding-inline:var(--space-2); margin-right:var(--space-2); }
  .map-panel__filter-heading small { display: none; }
  /* Share the result track instead of a hard-coded top offset: the status/reset
   * row remains reachable even when its English text wraps. */
  .map-panel__filters { position:relative; grid-column:1/-1; grid-row:4; align-self:start; z-index:6; inset:auto; max-height:100%; margin-inline:var(--space-2); padding:var(--space-3); border:1px solid var(--glass-border); border-radius:var(--radius-md); background:var(--lu4-overlay-background); -webkit-backdrop-filter:var(--lu4-overlay-backdrop); backdrop-filter:var(--lu4-overlay-backdrop); }
  .map-panel__filter-disclosure:not([open]) .map-panel__filters { display:none; }
  .map-panel__status { grid-column:1/-1; grid-row:3; }
  .map-results { grid-column:1/-1; grid-row:4; }
  .map-pagination { grid-column:1/-1; grid-row:5; }
  .map-result { min-height: 4rem; padding-block: var(--space-1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .map-loading__icon, .map-loading__line, .map-loading__count { animation: none; opacity: .68; }
}
