/* One shared UI. Logical layout flips controls without mirroring map geometry. */
.bb-maps-app{--bb-ink:#172033;--bb-muted:#526174;--bb-card:rgba(252,252,255,.91);--bb-border:rgba(148,163,184,.45);--bb-accent:#1d4ed8;position:relative;isolation:isolate;min-height:360px;height:var(--bb-map-height,calc(100svh - 90px));max-height:1400px;color:var(--bb-ink);font:400 12px/1.45 "BB Text",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;box-sizing:border-box}
.bb-maps-app *{box-sizing:border-box}
.bb-maps-app [hidden]{display:none!important}
.bb-maps-app .bb-map{width:100%;height:100%;min-height:360px;border-radius:16px;background:#e8eef2;direction:ltr}
.bb-maps-app button,.bb-maps-app textarea{font:inherit}
.bb-maps-app button{cursor:pointer}
.bb-maps-app button:focus-visible,.bb-maps-app summary:focus-visible,.bb-maps-app a:focus-visible,.bb-maps-app textarea:focus-visible{outline:3px solid #3b82f6;outline-offset:3px}
.bb-maps-app .ew-overlay{position:absolute;z-index:777;top:10px;inset-inline-start:10px;width:min(360px,calc(100% - 82px));max-height:calc(100% - 80px);overflow:auto;overscroll-behavior:contain;border-radius:12px;color:var(--bb-ink)}
.bb-maps-app .ew-card,.bb-maps-app .leaflet-bar,.bb-maps-app .bb-manual-pin-button{background:var(--bb-card);border:1px solid var(--bb-border);box-shadow:0 8px 30px rgba(0,0,0,.08);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);border-radius:12px}
.bb-maps-app .ew-card{padding:11px}
.bb-maps-app .ew-headline{display:flex;align-items:center;gap:8px;width:100%;padding:0;color:var(--bb-ink);background:transparent;border:0;text-align:start;min-height:24px;line-height:1.4}
.bb-maps-app .ew-headline-text{flex:1;min-width:0;font-size:13px;font-weight:650;overflow-wrap:anywhere}
.bb-maps-app .ew-pulse{flex:none;width:7px;height:7px;border-radius:100%;background:var(--bb-accent)}
.bb-maps-app[data-phase="locating"] .ew-pulse,.bb-maps-app[data-phase="tracking"] .ew-pulse{box-shadow:0 0 0 4px rgba(29,78,216,.1)}
.bb-maps-app[data-source="network"] .ew-pulse{background:#a16207}
.bb-maps-app .ew-chevron{flex:none;font-size:15px;color:var(--bb-muted);transition:transform .15s}
.bb-maps-app .ew-overlay.is-collapsed .ew-chevron{transform:rotate(180deg)}
.bb-maps-app .ew-overlay.is-collapsed .ew-headline-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bb-maps-app .ew-source{font-size:11px;font-weight:600;color:var(--bb-accent);margin:7px 0 4px}
.bb-maps-app .ew-breadcrumbs{color:var(--bb-ink);margin:4px 0;overflow-wrap:anywhere;white-space:pre-line;text-align:start}
.bb-maps-app .ew-status{font-size:11px;line-height:1.5;color:var(--bb-muted);margin:6px 0}
.bb-maps-app .ew-actions{display:flex;gap:6px;flex-wrap:wrap;margin:9px 0 7px}
.bb-maps-app .ew-location-btn,.bb-maps-app .ew-secondary{padding:7px 10px;min-height:32px;border-radius:7px;border:1px solid var(--bb-border);color:var(--bb-ink);background:transparent;line-height:1.4;white-space:normal;text-align:center}
.bb-maps-app .ew-location-btn{background:var(--bb-accent);border-color:var(--bb-accent);color:white;font-weight:600}
.bb-maps-app .ew-location-btn:disabled,.bb-maps-app .ew-secondary:disabled{opacity:.65;cursor:default}
.bb-maps-app .ew-sharing small{display:block;color:var(--bb-muted);font-size:10px;line-height:1.5;margin:5px 0}
.bb-maps-app summary{cursor:pointer;color:var(--bb-muted);padding:4px 0;list-style-position:inside}
.bb-maps-app .ew-address-entry label{display:block;margin-top:5px}
.bb-maps-app textarea{display:block;width:100%;resize:vertical;min-height:64px;max-height:180px;border-radius:6px;padding:7px;background:var(--bb-card);color:var(--bb-ink);border:1px solid var(--bb-border);margin:5px 0}
.bb-maps-app .ew-address-entry [role="status"]{display:block;font-size:11px;margin-top:4px}
.bb-maps-app .ew-location-details{margin-top:5px;border-top:1px solid var(--bb-border);padding-top:3px;font-size:10px}
.bb-maps-app .ew-location-details dl{display:grid;grid-template-columns:auto 1fr;gap:3px 10px;margin:5px 0;overflow-wrap:anywhere}
.bb-maps-app .ew-location-details dt{font-weight:600}
.bb-maps-app .ew-location-details dd{margin:0;text-align:end;unicode-bidi:plaintext}
.bb-maps-app .leaflet-control-zoom{border:0;background:transparent;box-shadow:none}
.bb-maps-app .ew-zoom-pill{border:1px solid var(--bb-border);background:var(--bb-card);border-radius:22px;overflow:hidden;box-shadow:0 3px 15px #0001}
.bb-maps-app .leaflet-bar a{width:36px;height:36px;line-height:36px;background:transparent;color:var(--bb-ink);border-color:var(--bb-border);border-radius:0;font-weight:400}
.bb-maps-app .leaflet-bar a:hover{background:var(--bb-card)}
.bb-maps-app .ew-map-locate-btn{margin-top:9px;border:1px solid var(--bb-border)!important;border-radius:100%!important;background:var(--bb-card)!important;display:flex!important;align-items:center;justify-content:center}
.bb-maps-app .ew-map-locate-btn svg{fill:var(--bb-accent);width:17px;height:17px;display:block}
.bb-maps-app .bb-manual-pin-button{position:absolute;z-index:778;bottom:26px;inset-inline-start:50%;transform:translateX(-50%);max-width:calc(100% - 26px);padding:9px 13px;color:var(--bb-ink);white-space:normal;text-align:center}
.bb-maps-app[dir="rtl"] .bb-manual-pin-button{transform:translateX(50%)}
.bb-maps-app .bb-manual-pin-button[aria-pressed="true"]{background:var(--bb-accent);color:white;border-color:var(--bb-accent)}
.bb-maps-app .bb-map.bb-selecting,.bb-maps-app .bb-map.bb-selecting .leaflet-grab{cursor:crosshair}
:is(.bb-maps-app,.bbm-history-map) .bb-dot{display:block;width:16px;height:16px;border:3px solid white;border-radius:50%;background:#2563eb;box-shadow:0 1px 8px #0005}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-network{background:#a16207;border-style:dashed;width:20px;height:20px}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-manual{background:#7c3aed}
.bb-maps-app .leaflet-control-attribution{font:9px/1.5 system-ui,sans-serif;max-width:90%;background:rgba(255,255,255,.9);color:#334155;white-space:normal}
.bb-maps-app .leaflet-control-attribution a{color:#1d4ed8}
.bb-maps-app[dir="rtl"] .ew-overlay{font-family:"BB Text","Noto Sans Arabic",Tahoma,Arial,sans-serif;letter-spacing:normal;text-align:right}
.bb-maps-app .ew-details{animation:bbm-in .12s ease}
@keyframes bbm-in{from{opacity:.5}to{opacity:1}}
@media(max-width:440px){.bb-maps-app .ew-overlay{width:calc(100% - 76px)}.bb-maps-app .ew-card{padding:9px}.bb-maps-app .ew-source{font-size:10px}.bb-maps-app .ew-headline-text{font-size:12px}}
@media(prefers-reduced-motion:reduce){.bb-maps-app *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.bb-maps-app[data-theme="dark"]{--bb-ink:#eff4fb;--bb-muted:#bfccdb;--bb-card:rgba(29,35,44,.95);--bb-border:#536276;--bb-accent:#79adff;color-scheme:dark}
.bb-maps-app[data-theme="dark"] .ew-location-btn,.bb-maps-app[data-theme="dark"] .bb-manual-pin-button[aria-pressed="true"]{color:#0b1b35}
.bb-maps-app[data-theme="dark"] .bb-map{background:#17212f}
.bb-maps-app[data-theme="dark"] .leaflet-tile-pane{filter:invert(1) hue-rotate(180deg) brightness(.82) contrast(.9)}
.bb-maps-app[data-theme="dark"] .leaflet-control-attribution{background:#1e293b;color:#dbeafe}
.bb-maps-app[data-theme="dark"] .leaflet-control-attribution a{color:#a5ccff}

/* Reference PHP presentation, scoped to each modular map. */
.bb-maps-app{--bb-ink:#1d1d1f;--bb-muted:#0009;--bb-card:rgba(252,252,255,.7);--bb-border:rgba(255,255,255,.95);font:400 12px/1.3334 "BB Text",Arial,sans-serif;letter-spacing:-.01em}
.bb-maps-app .bb-map{background:#f1f5f9}
.bb-maps-app .ew-overlay{width:min(360px,calc(100% - 124px));max-width:min(360px,calc(100% - 124px));border-radius:10px;overflow:hidden;cursor:pointer;transform:translateZ(0)}
.bb-maps-app .ew-overlay.is-collapsed{width:max-content}
.bb-maps-app .ew-card{padding:8px;border-radius:10px;box-shadow:0 8px 30px #0000000d;backdrop-filter:blur(20px) saturate(280%);-webkit-backdrop-filter:blur(20px) saturate(280%)}
.bb-maps-app .ew-headline{display:block;min-height:18px;line-height:1.28572}
.bb-maps-app .ew-pulse,.bb-maps-app .ew-chevron{display:none}
.bb-maps-app .ew-headline-text{position:relative;display:block;padding-inline:16px 20px;font-size:14px;font-weight:400;letter-spacing:-.016em;overflow-wrap:break-word}
.bb-maps-app .ew-headline-text::before{content:"";position:absolute;inset-inline-start:0;top:4px;width:10px;height:10px;background:currentColor;border-radius:50%}
.bb-maps-app[data-source="browser"] .ew-headline-text::before{background:#0b0}
.bb-maps-app[data-source="network"] .ew-headline-text::before{background:#f62}
.bb-maps-app .ew-headline-text::after{content:"";position:absolute;inset-inline-end:2px;top:8px;width:9px;height:9px;border:solid currentColor;border-width:0 2px 2px 0;transform:translate(2px,-50%) rotate(-135deg);transition:transform 450ms ease-in-out}
.bb-maps-app .ew-overlay.is-collapsed .ew-headline-text::after{transform:translate(0,-50%) rotate(45deg)}
.bb-maps-app .ew-details{animation:none;cursor:default}
.bb-maps-app .ew-overlay:not(.is-collapsed) .ew-details{animation:bb-reference-reveal .5s ease .15s both}
@keyframes bb-reference-reveal{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
.bb-maps-app .ew-source,.bb-maps-app .ew-status{font-size:12px;font-weight:400;margin:4px 0;color:inherit}
.bb-maps-app .ew-actions{margin:8px 0 4px}
.bb-maps-app .ew-location-btn{width:100%;min-height:24px;padding:4px 16px;border:0;border-radius:10px;background:#f46;color:#fff;font-weight:400;line-height:1.2;animation:bb-reference-button 2.9s infinite}
@keyframes bb-reference-button{0%{box-shadow:0 0 0 0 #ff446680}70%,100%{box-shadow:0 0 0 10px #ff446600}}
.bb-maps-app .ew-secondary{min-height:24px;padding:4px 10px;border-radius:10px}
.bb-maps-app .leaflet-control-zoom{border:0;box-shadow:none;background:transparent}
.bb-maps-app .ew-zoom-pill{border-radius:10px;box-shadow:0 10px 30px #00000026;backdrop-filter:blur(20px) saturate(280%)}
.bb-maps-app .ew-zoom-pill a{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;color:var(--bb-muted);background:transparent}
.bb-maps-app .ew-zoom-pill a:hover{color:var(--bb-ink)}
.bb-maps-app .ew-map-locate-btn{width:36px;height:36px;margin-top:8px;box-shadow:0 10px 30px #00000026;backdrop-filter:blur(20px) saturate(280%);transition:transform .5s ease}
.bb-maps-app .ew-map-locate-btn:hover{transform:scale(1.04)}
.bb-maps-app .ew-map-locate-btn svg{width:16px;height:16px;transform:rotate(30deg);fill:transparent;stroke:var(--bb-muted);stroke-width:2.2px;stroke-linejoin:round}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-browser{position:relative;width:56px;height:56px;border:1px solid #0088ff99;background:transparent;box-shadow:none}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-browser::before,:is(.bb-maps-app,.bbm-history-map) .bb-dot-browser::after{content:"";position:absolute;border-radius:50%}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-browser::before{inset:0;background:#2563ebcc;animation:bb-reference-ring 2.9s infinite}
:is(.bb-maps-app,.bbm-history-map) .bb-dot-browser::after{left:50%;top:50%;width:16px;height:16px;background:#08f;transform:translate(-50%,-50%);animation:bb-reference-core 5s ease-in-out infinite alternate}
@keyframes bb-reference-ring{0%{transform:scale(.2);opacity:.75}70%{transform:scale(1);opacity:0}100%{transform:scale(.55);opacity:0}}
@keyframes bb-reference-core{from{box-shadow:0 0 0 5px white,0 4px 14px #2563eb73;transform:translate(-50%,-50%) scale(1)}to{box-shadow:0 0 0 2px white,0 4px 14px #2563eb73;transform:translate(-50%,-50%) scale(.9)}}
.bb-maps-app .leaflet-control-attribution{background:transparent;color:#64748b;opacity:.85}
.bb-maps-app[data-theme="dark"]{--bb-ink:#f4f6fa;--bb-muted:#b2bfd0;--bb-card:rgba(29,35,44,.96);--bb-border:#546071}
.bb-maps-app[data-theme="dark"] .bb-map{background:#171d24}
.bb-maps-app[data-theme="dark"] .ew-location-btn{background:#a12649;color:white}
@media(max-width:767px){.bb-maps-app{height:var(--bb-map-height,calc(100dvh - 80px))}}

/* Keep the painted card and its content in the transition, not a transparent wrapper. */
.bb-maps-app .ew-overlay{width:min(360px,calc(100% - 124px));overflow:visible}
.bb-maps-app .ew-overlay.is-collapsed{width:min(360px,calc(100% - 124px));pointer-events:none}
.bb-maps-app .ew-card{width:100%;overflow:hidden;pointer-events:auto;box-sizing:border-box;max-height:calc(100% - 10px)}
.bb-maps-app .ew-overlay.is-collapsed .ew-card{width:max-content;max-width:100%}
.bb-maps-app .ew-overlay.is-collapsed .ew-headline{width:max-content;max-width:100%}
.bb-maps-app .ew-headline-text{transition:padding 450ms ease,transform 450ms ease}
.bb-maps-app .ew-overlay.is-collapsed .ew-headline-text{max-width:min(342px,calc(100vw - 142px));padding-inline-end:18px}
.bb-maps-app .ew-overlay .ew-headline-text::after{transition:transform 450ms ease-in-out !important}
.bb-maps-app .ew-overlay .ew-details{animation:none;display:grid;grid-template-rows:1fr;opacity:1;transform:translateY(0);transition:opacity 450ms ease 100ms,transform 450ms ease;}
.bb-maps-app .ew-overlay.is-collapsed .ew-details{height:0;min-height:0;overflow:hidden;opacity:0;transform:translateY(-8px);pointer-events:none;visibility:hidden;transition:opacity 200ms ease,transform 450ms ease,visibility 0s 450ms}
.bb-maps-app .ew-overlay.is-collapsed .ew-details{display:block;width:0;}
.bb-maps-app .ew-overlay:not(.is-collapsed) .ew-details{display:block;max-height:calc(100svh - 180px);overflow:auto}
@media(prefers-reduced-motion:reduce){.bb-maps-app .ew-overlay .ew-headline-text::after{transition:none!important}}
.bb-maps-app .ew-address-entry select{max-width:100%;width:100%;min-height:36px;border:1px solid #b7c8c9;border-radius:6px;padding:4px 8px;background:#fff;color:#183a3e;font:inherit}
.bb-maps-app [data-role=address-source]:not([hidden]){display:inline-block;color:#085d6f;text-decoration:underline;margin:3px 0 6px}
.bb-maps-app .ew-map-sources:not([hidden]){display:flex;gap:4px 10px;flex-wrap:wrap;margin:4px 0;font-size:11px}.bb-maps-app .ew-map-sources a{color:#07616e;text-decoration:underline;text-underline-offset:2px}

.leaflet-tooltip.bb-place-preview{white-space:normal;width:max-content;max-width:min(230px,48vw);overflow-wrap:anywhere;padding:8px 11px;border-radius:8px;line-height:1.45;color:#193e43}

.bbm-history-map .bb-dot{box-sizing:border-box}
@media(prefers-reduced-motion:reduce){.bbm-history-map .bb-dot::before,.bbm-history-map .bb-dot::after{animation:none}}
