.map-page { min-width:0; }
.map-page .map-layout { align-items:start; }
.map-page .map-panel { position:relative; min-height:560px; overflow:hidden; border:1px solid var(--border); border-radius:20px; background:#27180f; isolation:isolate; }
.map-page .map-panel #rear-map { height:560px; min-height:480px; }
.map-page .map-status { position:absolute; z-index:4; top:12px; left:12px; max-width:min(390px,calc(100% - 24px)); padding:8px 10px; border:1px solid rgba(241,218,193,.16); border-radius:9px; color:var(--muted); background:rgba(26,15,8,.88); box-shadow:0 7px 18px rgba(12,6,2,.16); font-size:9px; line-height:1.35; pointer-events:none; }
.map-page .map-status[data-state="ready"] { color:#dcefdc; border-color:rgba(82,166,108,.36); }
.map-page .map-status[data-state="partial"],.map-page .map-status[data-state="unavailable"] { color:#ffe0bd; border-color:rgba(242,166,90,.38); }
.map-page .map-status[data-state="empty"] { color:var(--muted); }
.map-page .map-status-actions { position:absolute; z-index:5; top:52px; left:12px; }
.map-page .map-status-actions .button { min-height:32px; padding:0 10px; font-size:8px; }
.map-page .map-attribution { position:absolute; z-index:3; right:10px; bottom:8px; margin:0; padding:4px 6px; border-radius:5px; color:#ddc9b7; background:rgba(20,12,8,.78); font-size:8px; }
.map-page .map-attribution a,.map-page .map-state a,.map-page .map-list-empty a { color:var(--accent); }
.map-page .map-markers { display:none; }
.map-page .map-state { position:absolute; z-index:3; inset:50% auto auto 50%; width:min(360px,calc(100% - 32px)); display:flex; flex-direction:column; gap:7px; padding:15px 16px; border:1px solid rgba(242,166,90,.3); border-radius:12px; color:var(--text); background:rgba(39,24,15,.95); box-shadow:var(--shadow); font-size:10px; line-height:1.5; transform:translate(-50%,-50%); }
.map-page .map-state strong { font-size:12px; }
.map-page .map-sample-note { position:absolute; z-index:3; right:10px; bottom:34px; max-width:265px; margin:0; padding:4px 6px; border-radius:5px; color:var(--muted); background:rgba(20,12,8,.8); font-size:7px; line-height:1.35; text-align:right; }
.map-page .map-list { max-height:560px; overflow:auto; background:rgba(40,27,19,.96); backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px); }
.map-page .map-sheet-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.map-page .map-sheet-heading .eyebrow { margin:0; }
.map-page .map-count { color:var(--muted); font-size:8px; }
.map-page .map-sheet-handle { display:none; }
.map-page [data-map-sheet-content] { min-height:0; margin:10px 0 0; padding:0; list-style:none; }
.map-page [data-map-studio] { border-top:1px solid var(--border); }
.map-page .map-studio-link { display:flex; align-items:center; gap:9px; min-width:0; padding:11px 0; color:inherit; text-decoration:none; }
.map-page .map-studio-link:hover strong { color:var(--accent); }
.map-page .map-studio-copy { min-width:0; display:flex; flex-direction:column; gap:3px; }
.map-page .map-studio-copy strong { overflow:hidden; color:var(--text); font-size:10px; line-height:1.15; text-overflow:ellipsis; white-space:nowrap; }
.map-page .map-studio-copy small { overflow:hidden; color:var(--muted); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.map-page .map-studio-meta { display:flex; align-items:center; flex-wrap:wrap; gap:6px; color:var(--dim); font-size:7px; }
.map-page .map-sample-badge,.map-page .map-verified { display:inline-flex; width:max-content; padding:3px 5px; border-radius:99px; font-size:7px; font-weight:800; letter-spacing:.04em; }
.map-page .map-sample-badge { color:#ffe1c0; background:rgba(242,166,90,.18); }
.map-page .map-verified { margin-left:4px; color:#d9f1dc; background:rgba(82,166,108,.2); font-size:6px; text-transform:uppercase; vertical-align:middle; }
.map-page .map-list-empty { display:flex; flex-direction:column; gap:5px; padding:17px 0; color:var(--muted); font-size:9px; line-height:1.45; }
.map-page .map-list-empty strong { color:var(--text); font-size:11px; }
.map-page .map-list[data-map-sheet] { background:rgba(40,27,19,.96); }
.map-page .leaflet-container { z-index:0; font-family:inherit; background:#27180f; }
.map-page .leaflet-tile-pane { filter:grayscale(1) invert(1) sepia(1) saturate(.6) hue-rotate(345deg) brightness(.7) contrast(.8); }
.map-page .leaflet-control-zoom a { border-color:var(--border)!important; color:var(--text)!important; background:#281b13!important; }
.map-page .leaflet-popup-content-wrapper,.map-page .leaflet-popup-tip { color:var(--text); background:#281b13; }
.map-page .leaflet-popup-content a { color:var(--accent); font-weight:700; }
.map-page .leaflet-control-attribution { color:var(--muted)!important; background:rgba(26,15,8,.85)!important; }
.map-page .leaflet-control-attribution a { color:var(--accent)!important; }
.map-page .rear-map-marker { border:0; background:none; }
.map-page .rear-map-pin { width:32px; height:32px; box-sizing:border-box; display:grid; place-items:center; border:2px solid rgba(255,239,218,.78); border-radius:50% 50% 50% 5px; color:#261407; background:var(--accent); box-shadow:0 0 0 5px rgba(242,166,90,.18),0 7px 18px rgba(0,0,0,.38); transform:rotate(-45deg); transform-origin:50% 50%; }
.map-page .rear-map-pin span { position:relative; z-index:1; font-size:9px; font-weight:800; transform:rotate(45deg); }
.map-page .map-popup { display:flex; flex-direction:column; gap:4px; min-width:125px; }
.map-page .map-popup-label,.map-page .map-popup-note { color:var(--muted); font-size:8px; }
.map-page .map-popup-note { color:#ffe0bd; }
.map-page .map-popup a,.map-page .map-popup strong { font-size:11px; }

/* A failed or slow provider never turns the complete directory into a floating overlay. */
.map-page.map-list-primary .map-layout { display:flex; flex-direction:column; gap:16px; }
.map-page.map-list-primary .map-list { order:-1; max-height:none; overflow:visible; }
.map-page.map-list-primary .map-list [data-map-sheet-content] { overflow:visible; }
.map-page.map-list-primary .map-panel { order:1; min-height:280px; }
.map-page.map-list-primary .map-panel #rear-map { height:280px; min-height:220px; }
.map-page.map-list-primary .map-status { max-width:min(430px,calc(100% - 24px)); }

@media (max-width:700px) {
  .map-page .map-panel { min-height:0; border-radius:16px; overflow:hidden; }
  .map-page .map-panel #rear-map { height:clamp(420px,calc(100dvh - 169px),760px); min-height:0; }
  .map-page .map-list[data-map-sheet] { position:fixed; z-index:25; right:50%; bottom:calc(max(77px,calc(60px + env(safe-area-inset-bottom))) + var(--map-preview-bottom-inset,0px)); width:calc(100vw - 22px); max-height:40dvh; margin:0; padding:0 13px 10px; overflow:hidden; border-radius:19px; transform:translateX(50%); transition:transform .34s cubic-bezier(.22,1,.36,1); touch-action:pan-y; }
  .map-page .map-list[data-map-sheet].is-dragging { transition:none; }
  .map-page .map-list[data-map-sheet].is-collapsed { transform:translate(50%,calc(100% - 42px)); }
  .map-page .map-sheet-handle { width:100%; height:32px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:0; border:0; color:var(--muted); background:transparent; cursor:grab; touch-action:none; }
  .map-page .map-sheet-handle > span:first-child { width:38px; height:4px; border-radius:99px; background:color-mix(in srgb,var(--muted) 53%,transparent); }
  .map-page .map-handle-label { font-size:6px; font-weight:800; letter-spacing:.16em; }
  .map-page .map-list[data-map-sheet] [data-map-sheet-content] { max-height:calc(40dvh - 84px); overflow:auto; }
  .map-page .map-list[data-map-sheet].is-collapsed [data-map-sheet-content] { overflow:hidden; }
  .map-page .map-sample-note { right:8px; bottom:9px; max-width:210px; font-size:6px; }
  .map-page.map-list-primary .map-layout { gap:11px; }
  .map-page.map-list-primary .map-list[data-map-sheet] { position:relative; right:auto; bottom:auto; width:auto; max-height:none; margin:0; padding:18px; overflow:visible; border-radius:16px; transform:none; order:-1; }
  .map-page.map-list-primary .map-list[data-map-sheet] [data-map-sheet-content] { max-height:none; overflow:visible; }
  .map-page.map-list-primary .map-sheet-handle { display:none; }
  .map-page.map-list-primary .map-panel #rear-map { height:280px; min-height:220px; }
}
