:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #203440;
  background: #fff;
  font-synthesis: none;
  --blue: #0b78b8;
  --blue-dark: #145c85;
  --blue-light: #edf6fb;
  --yellow: #f5c400;
  --ink: #203440;
  --muted: #5d7381;
  --line: #dce6ec;
  --map-surface: #eef3f6;
  --screening: #287aa8;
  --medical: #2169b5;
  --care: #99701f;
  --community: #6f60a1;
  --education: #95617e;
  --shops: #947322;
  --enterprise: #597585;
  --shadow: 0 8px 32px rgb(29 66 88 / 12%), 0 1px 3px rgb(29 66 88 / 6%);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --header-height: 92px;
  --privacy-bar-height: 54px;
}

* { box-sizing: border-box; }
/* Keep app scrolling inside its panels and prevent landscape font inflation. */
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { margin: 0; }
body { overscroll-behavior: none; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, summary { user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, a, summary, [tabindex] { outline-offset: 4px; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); }
a { color: var(--blue); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 1000; padding: 12px 20px; background: #fff; border: 2px solid var(--blue); border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* Brand and shared controls. */
.site-header { height: var(--header-height); padding: 0 28px 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; gap: 17px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 80px; height: 72px; object-fit: contain; flex: none; }
.brand-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-name { font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand-caption { font-size: 14px; color: var(--muted); line-height: 1.4; letter-spacing: .06em; }
.header-actions { display: flex; align-items: center; gap: 26px; }
.header-context { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--muted); }
.header-context>span { width: 7px; height: 7px; background: var(--yellow); border-radius: 50%; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.5; font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform 130ms var(--ease-out); }
.button--primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button--quiet { background: #fff; }
.button--location { color: var(--blue-dark); background: var(--blue-light); border-color: #cee2ee; }
.button[aria-pressed="true"] { color: var(--blue-dark); background: var(--blue-light); border-color: #98c4dc; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 10px; background: #f2f6f8; color: var(--muted); transition: transform 130ms var(--ease-out); }
.button:active, .icon-button:active, .category-filter:active { transform: scale(.97); }

/* The map is the main canvas; the sidebar is a compact service directory. */
/* clip prevents focus/scrollIntoView from moving the map shell programmatically. */
.workspace { display: flex; height: calc(100dvh - var(--header-height) - var(--privacy-bar-height)); min-height: 0; overflow: clip; }
.sidebar { width: 366px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fff; z-index: 20; }
.sidebar-top { padding: 22px 20px 20px; flex: none; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-eyebrow { margin-bottom: 7px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.section-heading h1 { font-size: 25px; line-height: 1.4; font-weight: 700; letter-spacing: .03em; }
.section-heading h1::after { content: ""; display: inline-block; vertical-align: middle; width: 17px; height: 4px; margin-left: 12px; border-radius: 2px; background: var(--yellow); }
.sidebar-close { display: none; }
.filter-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.filter-heading h2 { font-size: 15px; line-height: 1.5; font-weight: 600; }
.filter-heading>span { font-size: 12px; color: var(--muted); }
.category-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.category-filter { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 52px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.5; text-align: left; transition: transform 130ms var(--ease-out); }
.filter-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filter-label>.icon { width: 20px; height: 20px; }
.category-filter[data-category="all"] .icon { color: var(--blue); }
[data-category="screening"] .icon { color: var(--screening); }
[data-category="medical"] .icon { color: var(--medical); }
[data-category="care"] .icon { color: var(--care); }
[data-category="community"] .icon { color: var(--community); }
[data-category="education"] .icon { color: var(--education); }
[data-category="shops"] .icon { color: var(--shops); }
[data-category="enterprise"] .icon { color: var(--enterprise); }
.category-filter [data-count] { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.category-filter.is-active, .category-filter[aria-pressed="true"] { border-color: #8ebbd4; background: var(--blue-light); color: var(--blue-dark); box-shadow: inset 0 0 0 1px rgb(25 118 170 / 8%); font-weight: 600; }
.category-filter[aria-pressed="true"] [data-count] { color: var(--blue-dark); }
.list-heading { flex: none; padding: 15px 20px 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f9fbfc; }
.list-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; line-height: 1.5; font-weight: 600; }
.list-count { min-width: 29px; padding: 1px 7px; border-radius: 6px; background: #e7f1f7; color: var(--blue-dark); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.list-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.point-list-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c4d5df transparent; }
.point-list { list-style: none; padding: 8px 12px; margin: 0; }
.point-list>li { content-visibility: auto; contain-intrinsic-size: auto 132px; }
/* Focused/selected rows render fully before the app measures or reveals them. */
.point-list>li:focus-within, .point-list>li:has(.point-card[aria-pressed="true"]) { content-visibility: visible; contain-intrinsic-size: none; }
.point-list>li+li { border-top: 1px solid #e8eef2; }
.point-card { display: block; width: 100%; padding: 15px 12px; min-height: 96px; margin: 0; border: 0; border-left: 3px solid transparent; border-radius: 8px; background: #fff; color: var(--ink); text-align: left; }
.point-card.is-selected, .point-card[aria-pressed="true"] { border-left-color: var(--blue); background: var(--blue-light); }
.point-card__name { display: block; font-size: 18px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.point-card__address { display: block; margin-top: 5px; font-size: 15px; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
.point-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.point-card__category-icon { width: 17px; height: 17px; }
.point-card__distance { margin-left: auto; font-variant-numeric: tabular-nums; }
.sidebar-foot { display: flex; align-items: center; gap: 12px; padding: 13px 22px; flex: none; border-top: 1px solid var(--line); background: #fbfcfd; font-size: 12px; line-height: 1.7; color: var(--muted); }
.sidebar-foot>.icon { width: 24px; height: 24px; color: #769eb5; }
.list-empty { padding: 34px 22px; text-align: center; }
.list-empty>.icon { width: 32px; height: 32px; margin: 0 auto 15px; color: #88a8ba; }
.list-empty h3 { font-size: 18px; }
.list-empty p { margin-top: 9px; font-size: 15px; color: var(--muted); }
.list-empty .button { margin-top: 20px; }

/* Map controls float above the map without reducing its height. */
.map-workspace { position: relative; flex: 1; min-width: 0; background: var(--map-surface); }
.map-canvas-wrap { position: absolute; inset: 0; isolation: isolate; overflow: hidden; }
.map-canvas { position: absolute; inset: 0; background: var(--map-surface); }
.map-toolbar { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; align-items: center; z-index: 12; }
.map-toolbar .button { box-shadow: 0 2px 7px rgb(29 66 88 / 8%); min-height: 46px; font-size: 15px; padding-inline: 12px; }
.map-toolbar .icon { width: 19px; height: 19px; }
.map-view-buttons { display: flex; gap: 8px; }
.sidebar-toggle { display: none; }
.map-status-panel { position: absolute; top: 20px; left: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; width: fit-content; max-width: calc(100% - 470px); padding: 9px 12px; border: 1px solid #dbe6ed; border-radius: 10px; background: rgb(255 255 255 / 97%); box-shadow: 0 2px 7px rgb(29 66 88 / 5%); z-index: 3; font-size: 13px; line-height: 1.6; }
.status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--blue); }
#map-progress { color: var(--muted); font-variant-numeric: tabular-nums; }
.retry-locations { min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: var(--blue-dark); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 90px 26px 130px; background: #eff5f8; z-index: 1; }
.map-fallback__content { max-width: 400px; text-align: center; }
.map-fallback__icon { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 22px; border: 1px solid #d3e2eb; border-radius: 20px; background: #fff; color: var(--blue); }
.map-fallback__icon .icon { width: 36px; height: 36px; stroke-width: 1.5; }
.map-fallback__eyebrow { margin-bottom: 10px; font-size: 14px; color: var(--muted); letter-spacing: .05em; }
.map-fallback h2 { font-size: 25px; line-height: 1.4; font-weight: 600; }
.map-fallback #map-fallback-description { max-width: 330px; margin: 15px auto 0; font-size: 17px; line-height: 1.8; color: var(--muted); }
.map-fallback .button { margin-top: 22px; }
.map-legend { position: absolute; bottom: 34px; left: 20px; border: 1px solid var(--line); border-radius: 10px; background: rgb(255 255 255 / 97%); color: var(--muted); box-shadow: 0 2px 7px rgb(29 66 88 / 5%); z-index: 3; font-size: 14px; }
.map-legend summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; cursor: pointer; list-style: none; }
.map-legend summary::-webkit-details-marker { display: none; }
.map-legend summary>.icon { width: 18px; height: 18px; color: var(--blue); }
.map-legend summary>.legend-chevron { width: 14px; height: 14px; margin-left: 7px; transform: rotate(-90deg); color: var(--muted); }
.map-legend[open] summary>.legend-chevron { transform: rotate(90deg); }
.map-legend__items { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; padding: 3px 15px 16px; font-size: 13px; }
.map-legend__items>span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.map-legend__items .icon { width: 18px; height: 18px; }

/* A detail card sits near the selected point rather than replacing the map. */
.detail-panel { position: absolute; right: 20px; bottom: 54px; width: 356px; max-width: calc(100% - 40px); max-height: calc(100% - 112px); overflow-y: auto; overscroll-behavior: contain; padding: 20px 23px 21px; border: 1px solid #d4e2ea; border-radius: 16px; background: #fff; box-shadow: var(--shadow); z-index: 10; }
.detail-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -5px -9px 8px 0; }
.detail-category { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; line-height: 1.5; font-weight: 600; padding: 6px 9px; border-radius: 7px; background: var(--blue-light); color: var(--blue-dark); }
.detail-category>.icon { width: 18px; height: 18px; color: var(--category-color, var(--blue)); }
.detail-panel h2 { font-size: 23px; line-height: 1.5; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
.detail-address-block { display: flex; gap: 10px; margin-top: 19px; }
.detail-address-block>.icon { width: 19px; height: 19px; margin-top: 3px; color: var(--blue); }
.detail-label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
.detail-address-block p { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.detail-status, .detail-review-note, .detail-source-reference { display: none !important; }
.detail-peers { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.detail-peers p { margin-bottom: 9px; color: var(--muted); line-height: 1.6; }
.detail-peers button { width: 100%; min-height: 44px; padding: 9px 11px; margin-top: 7px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; font-size: 15px; line-height: 1.5; text-align: left; white-space: normal; }
.detail-peers button[aria-pressed="true"] { border-color: #98c4dc; color: var(--blue-dark); background: var(--blue-light); }
.detail-actions { display: flex; gap: 9px; margin-top: 22px; }
.detail-actions .button { flex: 1; min-height: 48px; padding-inline: 11px; font-size: 16px; }
.detail-actions .button[aria-disabled="true"] { pointer-events: none; background: #edf1f3; color: #647984; border-color: #edf1f3; cursor: default; }
.detail-footnote { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; color: var(--muted); }

/* Privacy choices sit in the map area; the directory remains usable. */
.privacy-bar { height: var(--privacy-bar-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 24px; background: #fff; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.privacy-bar-owner { min-width: 0; display: flex; align-items: center; gap: 20px; color: var(--muted); }
.privacy-bar-actions>a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; white-space: nowrap; }
.privacy-bar-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.privacy-bar-button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--blue-dark); padding: 8px 10px; text-decoration: underline; text-underline-offset: 4px; font-size: 14px; line-height: 1.5; }
.map-consent { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 92px 26px 48px; overflow-y: auto; overscroll-behavior: contain; background: var(--map-surface); }
.privacy-choice-card { width: min(100%, 550px); padding: 30px 32px; background: #fff; border: 1px solid #d3e2eb; border-radius: 18px; box-shadow: 0 4px 20px rgb(29 66 88 / 6%); }
.privacy-choice-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; background: var(--blue-light); border: 1px solid #d7e8f2; border-radius: 13px; color: var(--blue-dark); }
.privacy-choice-icon>.icon { width: 27px; height: 27px; }
.privacy-eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.privacy-choice-card h2, .privacy-controls h2, .location-consent h2 { color: var(--ink); font-size: 25px; line-height: 1.45; font-weight: 600; }
.privacy-choice-description { margin-top: 18px; color: var(--ink); font-size: 18px; line-height: 1.85; overflow-wrap: anywhere; }
.privacy-choice-description p+p { margin-top: 12px; }
.privacy-policy-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 14px; font-size: 16px; line-height: 1.5; }
.privacy-policy-links>a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.privacy-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.privacy-choice-actions .button { min-height: 50px; font-size: 18px; white-space: normal; }
.privacy-controls { position: absolute; top: 82px; right: 20px; z-index: 40; width: min(430px, calc(100% - 40px)); max-height: calc(100% - 110px); overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 25px; border: 1px solid #d1e1eb; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 17px; line-height: 1.8; }
.privacy-controls-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -5px -8px 14px 0; }
.privacy-controls-heading h2 { font-size: 23px; }
.privacy-map-status { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: var(--blue-light); color: var(--blue-dark); font-size: 17px; }
.privacy-controls-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.privacy-controls-actions .button { min-height: 50px; font-size: 18px; white-space: normal; }
.privacy-controls-note { margin-top: 18px; font-size: 15px; line-height: 1.8; color: var(--muted); }
.privacy-controls-policy { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; font-size: 16px; text-underline-offset: 4px; }
.location-consent { width: min(560px, calc(100% - 40px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #cbdde8; border-radius: 18px; box-shadow: 0 12px 46px rgb(22 49 65 / 20%); background: #fff; color: var(--ink); overscroll-behavior: contain; }
.location-consent::backdrop { background: rgb(19 44 58 / 45%); }
.location-consent-content { padding: 28px 30px 30px; }

body.large-text .privacy-choice-description, body.large-text .privacy-controls { font-size: 20px; }
body.large-text .privacy-choice-card h2, body.large-text .location-consent h2 { font-size: 28px; }
body.large-text .privacy-choice-actions .button, body.large-text .privacy-controls-actions .button { font-size: 20px; }
body.large-text .privacy-controls-note { font-size: 17px; }
body.large-text .privacy-policy-links, body.large-text .privacy-controls-policy { font-size: 18px; }

@media (hover: hover) and (pointer: fine) {
  .privacy-bar-button:hover { background: var(--blue-light); }
  .privacy-policy-links>a:hover, .privacy-bar a:hover, .privacy-controls-policy:hover { color: var(--blue-dark); }
}

@media (max-width: 1000px) {
  .privacy-bar-owner>span { display: none; }
}

@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  :root { --privacy-bar-height: calc(54px + env(safe-area-inset-bottom, 0px)); }
  .privacy-bar { padding: 4px max(12px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); gap: 8px; }
  .privacy-bar-actions { gap: 9px; }
  .privacy-bar-button { padding-inline: 8px; font-size: 14px; }
  .privacy-bar-actions>a { font-size: 14px; }
  .map-consent { padding: 112px var(--phone-right) 22px var(--phone-left); place-items: start center; }
  .privacy-choice-card { padding: 23px 21px; border-radius: 16px; }
  .privacy-choice-card h2, .location-consent h2 { font-size: 23px; }
  .privacy-choice-icon { width: 44px; height: 44px; margin-bottom: 13px; }
  .privacy-choice-description { font-size: 18px; line-height: 1.8; margin-top: 15px; }
  .privacy-policy-links { gap: 4px 14px; font-size: 16px; margin-top: 10px; }
  .privacy-choice-actions { grid-template-columns: 1fr; gap: 10px; margin-top: 15px; }
  .privacy-choice-actions .button { min-height: 50px; font-size: 18px; }
  .privacy-controls { top: 72px; left: var(--phone-left); right: var(--phone-right); width: auto; max-height: calc(100% - 92px); padding: 20px 21px 23px; }
  .location-consent { width: calc(100% - var(--phone-left) - var(--phone-right)); max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border-radius: 16px; }
  .location-consent-content { padding: 24px 22px; }
  body.large-text .privacy-choice-card h2, body.large-text .location-consent h2 { font-size: 25px; }
  body.large-text .privacy-choice-description { font-size: 20px; }
}

/* Semantic icons remain upright and readable at normal map zoom. */
.map-marker { position: relative; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); --marker-color: var(--blue); font-family: inherit; cursor: pointer; outline-offset: 3px; }
.map-marker__dot { position: relative; display: grid; place-items: center; width: 35px; height: 35px; border: 2px solid #fff; border-radius: 11px; background: var(--marker-color); box-shadow: 0 2px 6px rgb(24 53 71 / 26%); }
.map-marker__dot::after { content: ""; position: absolute; left: calc(50% - 4px); bottom: -5px; width: 7px; height: 7px; background: var(--marker-color); border-radius: 0 0 2px 0; transform: rotate(45deg); z-index: -1; }
.map-marker__dot>.icon { width: 22px; height: 22px; color: #fff; stroke-width: 1.8; }
.map-marker.is-selected .map-marker__dot { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--marker-color), 0 3px 7px rgb(24 53 71 / 24%); }
.map-marker__count { position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding-inline: 4px; display: grid; place-items: center; border: 1px solid #fff; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-marker.is-cluster .map-marker__dot { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px rgb(11 120 184 / 16%), 0 2px 7px rgb(24 53 71 / 22%); }
.map-marker.is-cluster .map-marker__dot::after, .map-marker.is-cluster .map-marker__dot>.icon { display: none; }
.map-marker.is-cluster .map-marker__count { inset: 0; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; font-size: 17px; }
.map-marker__label { display: none; position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); max-width: 250px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgb(29 66 88 / 13%); font-size: 14px; line-height: 1.5; font-weight: 600; white-space: normal; width: max-content; overflow-wrap: anywhere; text-align: left; pointer-events: none; }
.map-marker:focus-visible .map-marker__label, .map-marker.is-selected .map-marker__label { display: block; }
.toast { position: fixed; left: 50%; bottom: calc(var(--privacy-bar-height) + 16px); transform: translateX(-50%); width: max-content; max-width: min(90vw, 560px); padding: 13px 20px; border-radius: 10px; background: #234a61; color: #fff; box-shadow: var(--shadow); z-index: 100; font-size: 15px; line-height: 1.6; text-align: center; }
.noscript-note { position: fixed; bottom: 0; inset-inline: 0; padding: 15px; background: #fff7d6; color: #72591d; z-index: 110; text-align: center; }

@media (hover: hover) and (pointer: fine) {
  .button:hover { background: #f4f8fb; border-color: #a7c9dc; }
  .button--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
  .button--location:hover { background: #e1eff7; }
  .sidebar-toggle:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
  .icon-button:hover { background: #e6f0f6; color: var(--blue-dark); }
  .category-filter:hover { background: #f6fafc; border-color: #a9c9da; }
  .category-filter[aria-pressed="true"]:hover { background: var(--blue-light); }
  .point-card:hover { background: #f4f8fb; }
  .point-card[aria-pressed="true"]:hover { background: var(--blue-light); }
  .detail-peers button:hover { background: var(--blue-light); border-color: #a7c9dc; }
  .map-marker:hover .map-marker__label { display: block; }
}

/* Larger type stays local: it does not add a new map or re-query addresses. */
body.large-text .sidebar { width: 400px; }
body.large-text .category-filter, body.large-text .button { font-size: 18px; }
body.large-text .category-filter { min-height: 58px; }
body.large-text .point-card__name { font-size: 21px; }
body.large-text .point-card__address, body.large-text .detail-address-block p { font-size: 19px; }
body.large-text .point-card__meta, body.large-text .list-heading p { font-size: 15px; }
body.large-text .point-list>li { contain-intrinsic-size: auto 168px; }
body.large-text .point-list>li:focus-within, body.large-text .point-list>li:has(.point-card[aria-pressed="true"]) { contain-intrinsic-size: none; }
body.large-text .detail-panel { width: 380px; }
body.large-text .detail-panel h2 { font-size: 26px; }
body.large-text .detail-category, body.large-text .detail-footnote, body.large-text .sidebar-foot { font-size: 14px; }

@media (min-width: 1600px) {
  .sidebar { width: 398px; }
  .sidebar-top, .list-heading { padding-inline: 25px; }
  .point-list { padding-inline: 17px; }
}

@media (max-width: 1250px) and (min-width: 761px) {
  .sidebar { width: 338px; }
  .sidebar-top { padding: 20px 15px 18px; }
  .category-filter { padding-inline: 9px; font-size: 15px; }
  .filter-label { gap: 6px; }
  .header-context { display: none; }
  .map-status-panel { top: 82px; max-width: calc(100% - 40px); }
  .map-toolbar { gap: 6px; }
  .map-view-buttons { gap: 6px; }
  .map-toolbar .button { padding-inline: 10px; font-size: 14px; }
  .detail-panel { width: 325px; }
  body.large-text .sidebar { width: 380px; }
  body.large-text .map-toolbar .button { font-size: 15px; }
  body.large-text .map-view-buttons .icon { display: none; }
}

@media (max-width: 1000px) and (min-width: 761px) {
  .map-canvas-wrap:has(.detail-panel:not([hidden])) .map-legend { display: none; }
  .site-header { padding-inline: 20px; }
  .brand-name { font-size: 22px; }
}

@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  /* Leave controls clear of the notch and home indicator on real phones. */
  :root { --header-height: calc(74px + env(safe-area-inset-top, 0px)); --phone-left: max(12px, env(safe-area-inset-left, 0px)); --phone-right: max(12px, env(safe-area-inset-right, 0px)); }
  .site-header { padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); gap: 10px; }
  .skip-link { left: var(--phone-left); }
  .skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
  .brand { gap: 10px; }
  .brand-mark { width: 53px; height: 48px; }
  .brand-copy { gap: 3px; }
  .brand-name { font-size: 20px; letter-spacing: 0; }
  .brand-caption { font-size: 12px; letter-spacing: .025em; }
  .header-context { display: none; }
  .header-actions { gap: 0; }
  .header-actions .button { min-height: 44px; padding: 8px 9px; font-size: 14px; font-weight: 500; }
  .header-actions .button>.icon { display: none; }
  .workspace { position: relative; }
  .sidebar { position: absolute; left: var(--phone-left); right: var(--phone-right); bottom: calc(54px + env(safe-area-inset-bottom, 0px)); width: auto; height: min(80%, 680px); max-height: calc(100% - 102px - env(safe-area-inset-bottom, 0px)); overflow: hidden; border: 1px solid #d1e1eb; border-radius: 20px; box-shadow: 0 8px 32px rgb(29 66 88 / 18%); transform: translateY(calc(100% + 40px)); transition: transform 220ms var(--ease-drawer), visibility 0s 220ms; visibility: hidden; pointer-events: none; z-index: 30; }
  .sidebar-open .sidebar { transform: translateY(0); visibility: visible; pointer-events: auto; transition: transform 220ms var(--ease-drawer); }
  .sidebar::before { content: ""; width: 36px; height: 4px; margin: 9px auto 0; background: #cfdee6; border-radius: 3px; flex: none; }
  .sidebar-top { padding: 12px 16px 15px; }
  .section-heading { margin-bottom: 15px; min-height: 44px; }
  .section-eyebrow { margin-bottom: 3px; font-size: 12px; }
  .section-heading h1 { font-size: 22px; }
  .sidebar-close { display: grid; }
  .filter-heading { margin-bottom: 9px; }
  .filter-heading>span { font-size: 12px; }
  .category-filters { gap: 7px; }
  .category-filter { min-height: 48px; padding: 9px; font-size: 16px; }
  .filter-label { gap: 6px; }
  .list-heading { padding: 13px 17px 11px; }
  .point-list { padding-inline: 9px; }
  .point-card { padding: 13px 10px; }
  .sidebar-foot { padding: 11px 17px; }
  .sidebar-foot p br { display: none; }
  .sidebar-foot>.icon { width: 19px; height: 19px; }
  .map-toolbar { top: 12px; left: var(--phone-left); right: var(--phone-right); justify-content: space-between; gap: 6px; }
  .map-toolbar .button { min-height: 44px; padding: 8px 9px; font-size: 14px; gap: 5px; border-radius: 9px; }
  .map-toolbar .icon { width: 18px; height: 18px; }
  .sidebar-toggle { display: inline-flex; background: var(--blue); border-color: var(--blue); color: #fff; }
  .sidebar-toggle[aria-expanded="true"] { background: var(--blue-dark); }
  .map-view-buttons { gap: 6px; }
  .map-view-buttons .icon { display: none; }
  #back-to-town span { font-size: 0; }
  #back-to-town span::after { content: "奉城镇"; font-size: 14px; }
  #locate-me { width: 44px; padding: 8px; }
  #locate-me span { display: none; }
  .map-status-panel { top: 70px; left: var(--phone-left); right: var(--phone-right); max-width: calc(100% - var(--phone-left) - var(--phone-right)); padding: 7px 10px; font-size: 12px; gap: 3px 6px; border-radius: 8px; }
  .map-legend { left: var(--phone-left); bottom: calc(32px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
  .map-legend summary { min-height: 44px; padding-inline: 11px; }
  .map-legend__items { font-size: 12px; gap: 12px 15px; }
  .sidebar-open .map-legend, .map-canvas-wrap:has(.detail-panel:not([hidden])) .map-legend { display: none; }
  .map-fallback { padding: 100px 22px 110px; }
  .map-fallback h2 { font-size: 23px; }
  .map-fallback #map-fallback-description { font-size: 16px; max-width: 280px; }
  .detail-panel { left: var(--phone-left); right: var(--phone-right); bottom: calc(54px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; max-height: min(52%, 440px); padding: 18px 20px 19px; border-radius: 18px; z-index: 30; }
  .detail-panel h2 { font-size: 22px; }
  .detail-address-block { margin-top: 15px; }
  .detail-actions { margin-top: 18px; }
  .detail-footnote { margin-top: 13px; padding-top: 11px; }
  .map-marker__label { max-width: 200px; font-size: 13px; }
  .toast { left: var(--phone-left); right: var(--phone-right); margin-inline: auto; transform: none; bottom: calc(35px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - var(--phone-left) - var(--phone-right)); font-size: 14px; }
  body.large-text .sidebar { width: auto; overflow-y: auto; overscroll-behavior: contain; }
  body.large-text .point-list-scroll { flex: 0 0 auto; min-height: 170px; overflow: visible; }
  body.large-text .category-filter { font-size: 17px; min-height: 54px; }
  body.large-text .map-toolbar .button, body.large-text .header-actions .button { font-size: 14px; }
  body.large-text .detail-panel { width: auto; }
  body.large-text .detail-panel h2 { font-size: 25px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 17px; }
  .brand-caption { font-size: 11px; }
  .header-actions .button { padding-inline: 8px; font-size: 13px; }
  .map-toolbar { left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); gap: 4px; }
  .map-toolbar .button { padding-inline: 8px; font-size: 13px; }
  .map-view-buttons { gap: 4px; }
  #back-to-town span::after { font-size: 13px; }
  .map-toolbar .sidebar-toggle { gap: 4px; padding-inline: 7px; }
  .category-filter { font-size: 15px; padding-inline: 7px; gap: 5px; }
  .filter-label { gap: 5px; }
  .filter-label>.icon { width: 18px; height: 18px; }
  .filter-heading>span { font-size: 11px; }
  body.large-text .category-filter { font-size: 16px; }
}

@media (max-width: 760px) and (max-height: 800px), (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  .sidebar { height: calc(100% - 102px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .point-list-scroll { flex: 0 0 auto; min-height: 150px; overflow: visible; }
}

@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  /* Fit recovery controls below the toolbar/status, with local scrolling for
     long provider errors; decoration must not push the retry off the canvas. */
  .map-fallback { padding: 112px var(--phone-right) calc(20px + env(safe-area-inset-bottom, 0px)) var(--phone-left); overflow-y: auto; overscroll-behavior: contain; align-items: start; scroll-padding-block: 112px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .map-fallback__content { width: 100%; max-width: 560px; }
  .map-fallback__icon, .map-fallback__eyebrow { display: none; }
  .map-fallback h2 { font-size: 21px; line-height: 1.4; }
  .map-fallback #map-fallback-description { max-width: 560px; margin-top: 8px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
  .map-fallback .button { min-height: 44px; margin-top: 12px; }
  /* Keep space for a selected marker; the card scrolls to its own actions. */
  .detail-panel, body.large-text .detail-panel { left: auto; right: var(--phone-right); width: min(356px, 48%); max-height: calc(100% - 112px); padding: 12px 18px 14px; scroll-padding-block: 12px; }
  .detail-topline { margin-bottom: 5px; }
  .detail-address-block { margin-top: 10px; }
  .detail-actions { flex-direction: column; margin-top: 12px; }
  .detail-footnote { margin-top: 10px; padding-top: 9px; }
}

/* Keyboard actions and reduced-motion preferences skip positional animation. */
body.keyboard-input .button, body.keyboard-input .icon-button, body.keyboard-input .category-filter, body.keyboard-input .sidebar { transition: none; }
body.keyboard-input .button:active, body.keyboard-input .icon-button:active, body.keyboard-input .category-filter:active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .button, .icon-button, .category-filter, .sidebar, .sidebar-open .sidebar { transition: none; }
  .button:active, .icon-button:active, .category-filter:active { transform: none; }
}

/* MapLibre applies coordinates directly to the semantic button element. */
.maplibregl-marker.map-marker { position: absolute; }
.maplibregl-canvas:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.maplibregl-ctrl-attrib { max-width: calc(100% - 12px); font-family: inherit; font-size: 12px; line-height: 1.6; }
.maplibregl-ctrl-bottom-right { z-index: 8; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 8px 2px 0; }
.map-marker--user { z-index: 250; }
