/* Home observation cards use the existing app palette in both themes. */
.map-section .bs-observation-popup .maplibregl-popup-content {
  width:min(370px, calc(100vw - 32px)); min-width:0; max-width:calc(100vw - 32px);
  padding:16px; border-radius:20px; border:1px solid var(--border);
  background:var(--card); color:var(--fg); font-family:inherit;
  max-height:calc(100svh - 100px); overflow-y:auto;
}
.map-section .bs-observation-popup .maplibregl-popup-close-button {
  top:0; right:0; width:44px; height:44px; color:var(--muted); border-radius:12px;
}
.map-section .bs-observation-popup .maplibregl-popup-close-button:is(:hover,:focus-visible) {
  background:var(--border); color:var(--fg);
}
.map-section .bs-observation-popup .popup-card { color:var(--fg); }
.bs-observation-popup .popup-scientific,
.bs-observation-popup .popup-group-meta { color:var(--muted); }
.bs-observation-popup .popup-group-item { border-color:var(--border); }
.bs-observation-popup .popup-group-title { white-space:normal; overflow-wrap:anywhere; }
.bs-observation-popup .popup-card--observation .popup-header {
  align-items:flex-start; gap:12px; margin:2px 0 18px; padding-right:22px;
}
.popup-card--observation .popup-title-wrap { flex:1; min-width:0; }
.popup-card--observation .popup-title { font-size:.94rem; font-weight:800; line-height:1.35; overflow-wrap:anywhere; }
.bs-observation-popup .popup-card--observation .popup-scientific { font-size:.84rem; line-height:1.4; margin-top:5px; }
.popup-card--observation .popup-emoji { width:36px; height:36px; flex:0 0 36px; margin:4px; background-size:26px 26px; }
.popup-card--observation .popup-emoji span { font-size:16px; }
.popup-signals { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.popup-event, .popup-behavior { padding:4px 8px; border:1px solid var(--border); border-radius:8px; font-size:.76rem; line-height:1.4; overflow-wrap:anywhere; }
.popup-event { font-weight:700; color:var(--muted); }
.popup-event[data-policy="observacion_segura"] { color:#006477; border-color:#25cce9; background:rgba(37,204,233,.12); }
.popup-event[data-policy="sensible"], .popup-event[data-policy="no_molestar"] { color:#92400e; border-color:#f59e0b; background:rgba(245,158,11,.12); }
.popup-event[data-policy="en_peligro"] { color:#9f1239; border-color:#ef4444; background:rgba(239,68,68,.12); }
[data-theme="dark"] .popup-event[data-policy="observacion_segura"] { color:#a5f3fc; }
[data-theme="dark"] .popup-event[data-policy="sensible"], [data-theme="dark"] .popup-event[data-policy="no_molestar"] { color:#fde68a; }
[data-theme="dark"] .popup-event[data-policy="en_peligro"] { color:#fda4af; }
.popup-behavior { background:var(--border); color:var(--fg); }
.popup-group-main .popup-behavior { display:inline-block; max-width:100%; box-sizing:border-box; margin:4px 0; vertical-align:top; }
.popup-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 18px; margin:0; padding:20px 0; border-block:1px solid var(--border); }
.popup-data-field { min-width:0; }
.popup-data-field dt { margin:0 0 5px; color:var(--muted); font-size:.65rem; line-height:1.3; text-transform:uppercase; font-weight:700; }
.popup-data-field dd { margin:0; color:var(--fg); font-size:.85rem; line-height:1.4; font-weight:700; overflow-wrap:anywhere; }
.popup-card--observation .popup-actions { display:flex; flex-wrap:nowrap; gap:8px; margin-top:20px; padding:0; }
.bs-observation-popup .popup-detail { min-height:44px; padding:10px; border-radius:12px; background:var(--brand); box-shadow:none; font-size:.85rem; font-weight:700; gap:8px; }
.bs-observation-popup .popup-group-detail { min-width:68px; }
.popup-card--observation .popup-actions .popup-detail { flex:1; min-width:0; min-height:48px; }
.popup-card--observation .popup-actions .popup-share { flex:0 0 44px; min-width:44px; min-height:48px; padding:0; border-radius:12px; background:var(--border); color:var(--fg) !important; border:1px solid var(--border); box-shadow:none; }
.popup-card--observation .popup-actions a:hover,
.bs-observation-popup .popup-group-detail:hover { filter:brightness(1.12); }
.bs-observation-popup :is(a,button):focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.popup-external-icon, .popup-share-icon { display:inline-block; flex-shrink:0; width:18px; height:18px; background:currentColor; mask-repeat:no-repeat; mask-position:center; mask-size:contain; }
.popup-external-icon { mask-image:url("../../icons/arrow-up-right-outline.4cb080935672.svg"); }
.popup-share-icon { mask-image:url("../../icons/share-outline.aee7ace2f62c.svg"); }
.map-section .bs-observation-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.map-section .bs-observation-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.map-section .bs-observation-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color:var(--card); }
.map-section .bs-observation-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.map-section .bs-observation-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.map-section .bs-observation-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color:var(--card); }
@media (prefers-reduced-motion:reduce) { .popup-card--observation .popup-actions a { transition:none; } }
