.map-page-body { overflow: hidden; }
.tourcir-map-shell { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; height: 100svh; padding-top: 66px; background: #e8eef3; }
.map-controls { z-index: 3; overflow-y: auto; padding: 24px; border-right: 1px solid var(--border); background: rgba(255,255,255,.97); box-shadow: 14px 0 42px rgba(0,43,91,.08); }
.map-title-row,.map-panel-heading,.poi-dialog-heading,.poi-form-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.map-title-row h1 { margin: 2px 0 0; color:var(--navy); font-size:clamp(28px,3vw,38px); line-height:1.1; }
.map-eyebrow { margin:0; color:#0f766e; font-size:12px; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
.map-intro { margin:12px 0 20px; color:var(--subtle); font-size:14px; line-height:1.6; }
.map-icon-button { display:grid; width:42px; height:42px; flex:0 0 42px; place-items:center; border:1px solid var(--border); border-radius:50%; background:#fff; color:var(--navy); font:700 22px/1 inherit; cursor:pointer; }
.restaurant-service-filters { margin:0 0 16px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:8px; }
.restaurant-service-filters legend { font-size:14px; color:#334155; }
.restaurant-service-filters label { display:flex; align-items:center; gap:8px; min-height:44px; font-size:14px; cursor:pointer; }
.restaurant-service-filters input { width:18px; height:18px; accent-color:#002b5b; }
.map-field { display:grid; gap:6px; margin-bottom:13px; color:#334155; font-size:14px; font-weight:750; }
.map-field[hidden] { display:none!important; }
.map-field input,.map-field select,.map-field textarea { width:100%; min-height:44px; border:1px solid #cbd5e1; border-radius:9px; padding:9px 11px; outline:0; background:#fff; color:#0f172a; font:inherit; font-weight:500; }
.map-field textarea { resize:vertical; }
.map-field input:focus,.map-field select:focus,.map-field textarea:focus { border-color:#0f766e; box-shadow:0 0 0 3px rgba(15,118,110,.12); }
.map-result-summary { margin:18px 0 10px; color:#64748b; font-size:13px; font-weight:750; }
.map-list { display:grid; gap:8px; min-width:0; }
.map-field small { color:#64748b; font-size:12px; font-weight:500; line-height:1.5; }
.map-list-item { width:100%; padding:12px; border:1px solid var(--border); border-radius:10px; background:#fff; text-align:left; cursor:pointer; transition:border-color .16s,transform .16s,box-shadow .16s; }
.map-list-item:hover,.map-list-item.is-active { border-color:rgba(15,118,110,.48); box-shadow:0 8px 22px rgba(15,118,110,.10); transform:translateY(-1px); }
.map-list-item strong { display:block; color:#0f172a; font-size:14px; }
.map-list-item span { display:block; margin-top:3px; color:#64748b; font-size:12px; }
.map-stage { position:relative; min-width:0; }
.map-canvas { position:absolute; inset:0; touch-action:none; -webkit-touch-callout:none; }
.map-gesture-hint { position:absolute; left:50%; top:14px; z-index:4; padding:8px 12px; border:1px solid rgba(15,23,42,.12); border-radius:999px; background:rgba(255,255,255,.92); color:#334155; font-size:12px; font-weight:800; box-shadow:0 8px 24px rgba(15,23,42,.12); transform:translateX(-50%); pointer-events:none; }
.map-long-press-indicator { position:absolute; z-index:7; width:54px; height:54px; border-radius:50%; background:rgba(15,118,110,.16); transform:translate(-50%,-50%); pointer-events:none; }
.map-long-press-indicator::before { content:""; position:absolute; inset:7px; border:3px solid rgba(15,118,110,.24); border-top-color:#0f766e; border-radius:50%; }
.map-long-press-indicator.is-pressing::before { animation:map-long-press 3s linear forwards; }
.map-long-press-indicator span { position:absolute; inset:20px; border-radius:50%; background:#0f766e; }
.map-long-press-indicator::after { content:"按住 3 秒"; position:absolute; left:50%; top:60px; width:max-content; padding:5px 8px; border-radius:999px; background:#0f172a; color:#fff; font-size:11px; font-weight:800; transform:translateX(-50%); }
@keyframes map-long-press { to { transform:rotate(1080deg); border-color:#0f766e; } }
.map-toast { position:absolute; left:50%; bottom:24px; z-index:8; width:max-content; max-width:calc(100% - 32px); padding:11px 15px; border-radius:10px; background:#0f172a; color:#fff; font-size:13px; font-weight:750; box-shadow:0 18px 48px rgba(2,8,23,.3); transform:translateX(-50%); }
.map-toast a { color:#67e8f9; font-weight:900; }
.map-loading,.map-empty { position:absolute; left:50%; top:50%; z-index:4; padding:12px 18px; border:1px solid var(--border); border-radius:999px; background:rgba(255,255,255,.94); color:var(--navy); font-size:14px; font-weight:800; box-shadow:var(--shadow); transform:translate(-50%,-50%); }
.map-detail-card { position:absolute; right:22px; bottom:22px; z-index:5; width:min(360px,calc(100% - 44px)); max-height:70vh; overflow:auto; padding:20px; border:1px solid rgba(148,163,184,.34); border-radius:14px; background:rgba(255,255,255,.97); box-shadow:0 24px 70px rgba(2,8,23,.22); backdrop-filter:blur(16px); }
.map-detail-card h2 { margin:3px 34px 5px 0; font-size:24px; }
.map-detail-card p { margin:8px 0; color:#475569; font-size:14px; line-height:1.6; }
.map-detail-category { color:#0f766e!important; font-size:12px!important; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.map-detail-location,.map-detail-contributor { color:#64748b!important; font-size:13px!important; }
.map-detail-card img { width:100%; max-height:190px; margin:10px 0 4px; border-radius:10px; object-fit:cover; }
.map-detail-notes { margin-top:12px; padding:12px; border:1px solid rgba(15,118,110,.18); border-radius:9px; background:rgba(15,118,110,.06); color:#334155; font-size:13px; line-height:1.6; }
.map-detail-close { position:absolute; top:13px; right:13px; border:0; background:transparent; color:#64748b; font-size:25px; cursor:pointer; }
.maplibregl-popup-content { max-height:min(60svh,440px); overflow-y:auto; padding-top:42px; border-radius:12px; box-shadow:0 14px 42px rgba(2,8,23,.22); }
.tourcir-marker-popup { display:grid; gap:9px; min-width:210px; padding:3px 4px; color:#0f172a; }
.tourcir-marker-popup strong { padding-right:18px; font-size:15px; line-height:1.35; }
.tourcir-marker-popup-tags { display:flex; flex-wrap:wrap; gap:5px; }
.tourcir-marker-popup-tags span { padding:4px 7px; border-radius:999px; background:#ecfdf5; color:#0f766e; font-size:11px; font-weight:800; }
.tourcir-marker-popup-contributor { display:flex; align-items:center; gap:7px; color:#64748b; font-size:12px; font-weight:700; }
.tourcir-marker-popup-contributor img { width:26px; height:26px; border-radius:50%; object-fit:cover; }
.tourcir-marker-popup-navigate { display:flex; width:100%; min-height:38px; align-items:center; justify-content:center; border:0; border-radius:9px; background:#0f766e; color:#fff; font:850 13px/1.2 inherit; text-decoration:none; cursor:pointer; }
.tourcir-marker-popup-navigate:hover { background:#115e59; color:#fff; }
.map-contributor-panel,.map-review-panel { margin-top:18px; padding-top:14px; border-top:1px solid var(--border); }
.map-collapsible-panel > summary { list-style:none; }
.map-collapsible-panel > summary::-webkit-details-marker { display:none; }
.map-panel-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; cursor:pointer; user-select:none; }
.map-panel-summary h2 { margin:2px 0 0; font-size:20px; }
.map-panel-toggle { flex:0 0 auto; padding:5px 9px; border:1px solid #cbd5e1; border-radius:999px; background:#fff; color:#475569; font-size:12px; font-weight:800; }
.map-collapsible-panel[open] .map-panel-toggle { font-size:0; }
.map-collapsible-panel[open] .map-panel-toggle::before { content:"收起"; font-size:12px; }
.map-panel-body { padding-top:10px; }
.map-panel-actions { display:flex; justify-content:flex-end; margin-bottom:8px; }
.map-small-button { min-height:38px; border:1px solid #cbd5e1; border-radius:8px; padding:7px 12px; background:#fff; color:var(--navy); font:750 13px/1.2 inherit; cursor:pointer; }
.map-small-button.primary { border-color:var(--navy); background:var(--navy); color:#fff; }
.poi-row { display:grid; gap:7px; margin-top:10px; padding:11px; border:1px solid var(--border); border-radius:9px; background:#f8fafc; }
.poi-row-heading { display:flex; align-items:start; justify-content:space-between; gap:10px; }
.poi-row strong { font-size:14px; }
.poi-status { padding:2px 7px; border-radius:999px; background:#e2e8f0; color:#475569; font-size:11px; font-weight:850; text-transform:uppercase; }
.poi-row-actions { display:flex; flex-wrap:wrap; gap:6px; }
.poi-dialog { width:min(760px,calc(100% - 24px)); max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; padding:0; border:0; border-radius:16px; box-shadow:0 30px 100px rgba(2,8,23,.35); }
.poi-dialog::backdrop { background:rgba(2,8,23,.62); backdrop-filter:blur(4px); }
.poi-dialog-card { padding:24px; }
.poi-dialog-heading h2 { margin:2px 0 0; font-size:28px; }
.poi-form-help { color:#64748b; font-size:13px; }
.poi-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.poi-form-grid .wide { grid-column:1/-1; }
.poi-form-status { min-height:22px; margin:3px 0; color:#b91c1c; font-size:13px; font-weight:700; }
.poi-coordinate-help { margin:-4px 0 12px; color:#64748b; font-size:12px; }
.poi-quick-categories { display:flex; flex-wrap:wrap; gap:7px; }
.poi-category-chip { min-height:34px; padding:6px 10px; border:1px solid #cbd5e1; border-radius:999px; background:#fff; color:#334155; font:750 12px/1.2 inherit; cursor:pointer; }
.poi-category-chip.is-active { border-color:#0f766e; background:#ecfdf5; color:#0f766e; box-shadow:0 0 0 2px rgba(15,118,110,.1); }
@media (max-width: 900px) {
  .map-page-body { overflow:auto; }
  .tourcir-map-shell { grid-template-columns:1fr; grid-template-rows:auto clamp(320px,65svh,760px); height:auto; padding-top:66px; }
  .map-controls { overflow:visible; padding:18px; border-right:0; border-bottom:1px solid var(--border); }
  .map-list { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:clamp(120px,28svh,260px); overflow-y:auto; overscroll-behavior:contain; padding:2px; }
  .map-detail-card { right:10px; bottom:10px; width:calc(100% - 20px); max-height:48vh; }
}
@media (max-width: 620px) {
  .tourcir-map-shell { padding-top:64px; grid-template-rows:auto clamp(280px,60svh,640px); }
  .map-controls { padding:14px; }
  .map-intro { margin-bottom:14px; }
  .map-list { grid-template-columns:1fr; }
  .map-list-item { min-width:0; overflow-wrap:anywhere; }
  .poi-form-grid { grid-template-columns:1fr; }
  .poi-form-grid .wide { grid-column:auto; }
  .poi-dialog-card { padding:18px; }
  .map-gesture-hint { top:10px; max-width:calc(100% - 90px); text-align:center; white-space:normal; }
}


.poi-share-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; }
.poi-share-actions a { font-size:13px; color:#0f766e; }
[data-detail-actions] { display:flex; flex-wrap:wrap; gap:8px; }
[data-detail-stats] { font-size:13px; color:#64748b; }
.place-page { max-width:760px; margin:0 auto; padding:24px 18px 40px; }
.place-page h1 { line-height:1.3; }
.place-page .place-card { background:white; padding:24px; border-radius:20px; box-shadow:0 8px 30px #0f172a0d; }
.place-page .place-photo { max-width:100%; border-radius:12px; max-height:360px; object-fit:cover; }
.place-page .place-map { height:320px; margin:20px 0; border-radius:16px; }
.place-page .place-notes { white-space:pre-wrap; background:#f0fdfa; padding:16px; border-radius:12px; }
.place-page .place-tags { display:flex; flex-wrap:wrap; gap:8px; }
.place-page .place-tags span { background:#e6f4f1; color:#0f766e; padding:5px 10px; border-radius:20px; }
.place-page .place-description { white-space:pre-wrap; }
.place-page button, .place-page .place-nav { min-height:44px; }
.place-page .place-nav { display:inline-flex; align-items:center; background:#0f766e; color:white; padding:8px 16px; border-radius:10px; }
@media(max-width:600px) { .place-page { padding:16px 12px 32px; } .place-page .place-card { padding:18px; } }

.poi-useful { margin-top:12px; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.poi-useful-count { margin:4px 0; flex-basis:100%; font-size:13px; color:#0f766e; font-weight:650; }
.poi-useful-button { min-height:44px; }
.poi-useful-button[aria-pressed="true"] { background:#e6f4f1; border-color:#0f766e; }
.poi-useful-button:disabled { cursor:default; }
.poi-useful a { font-size:13px; color:#0f766e; }

.maplibregl-popup-close-button { top:3px; right:3px; width:44px; height:44px; border-radius:8px; color:#334155; background:#f1f5f9; font-size:28px; line-height:1; }
.tourcir-marker-popup p { margin:0; color:#475569; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.tourcir-marker-popup-notes { white-space:pre-wrap; }
@media (max-width:900px) { .map-stage { scroll-margin-top:76px; } }

.map-search-form { margin-bottom:13px; }
.map-search-form .map-field { margin-bottom:6px; }
.map-search-row { display:flex; gap:8px; }
.map-search-row input { min-width:0; width:100%; min-height:44px; border:1px solid #cbd5e1; border-radius:9px; padding:9px 11px; background:#fff; font:inherit; font-size:16px; }
.map-search-row button { flex-shrink:0; min-height:44px; }
.map-search-status { margin:6px 0 0; color:#64748b; font-size:13px; line-height:1.5; }
.map-search-status:empty { display:none; }
.map-geocode-results { display:grid; gap:8px; max-height:28svh; overflow-y:auto; margin-bottom:14px; }
.map-geocode-results[hidden] { display:none; }
.map-geocode-results > a { color:#64748b; font-size:12px; }

/* Keep place popups above map overlays; long content remains touch-scrollable. */
.maplibregl-popup { z-index:6; }
.maplibregl-popup-content { overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }

.poi-navigation-dialog { width:min(440px,calc(100% - 24px)); }
.poi-navigation-options { display:grid; gap:10px; margin:16px 0; }
.poi-navigation-options a { display:flex; align-items:center; justify-content:center; min-height:44px; text-decoration:none; }
.poi-navigation-options button { min-height:44px; }

/* Zoom the popup content without replacing MapLibre's geographic transform. */
.tourcir-zoom-popup .maplibregl-popup-content { transform:scale(var(--poi-popup-scale,1)); transform-origin:50% 0; will-change:transform; }
.tourcir-zoom-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-content,
.tourcir-zoom-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content,
.tourcir-zoom-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content { transform-origin:50% 100%; }
.tourcir-zoom-popup .maplibregl-popup-close-button,
.tourcir-zoom-popup .tourcir-marker-popup-navigate,
.tourcir-zoom-popup button { min-height:48px; }
.tourcir-zoom-popup .maplibregl-popup-close-button { width:48px; }
.tourcir-zoom-popup .maplibregl-popup-content { max-height:min(50svh,400px); }
