/* =========================================================
   Safety Hub layout
   ========================================================= */

.safetyApp {
    position: relative;
    z-index: 1;
    width: 100%;
    isolation: isolate;
}

.safetyTopbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 20px 16px;
}

.safetyTopbar__eyebrow {
    margin: 0 0 4px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.safetyTopbar h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.safetyButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 11px 18px;

    border-radius: 999px;

    font-weight: 700;
    text-decoration: none;
}

.safetyButton--primary {
    background: #111827;
    color: #ffffff;
}

/* =========================================================
   Category filters
   ========================================================= */

.safetyToolbar {
    padding: 0 20px 14px;
}

.safetyFilters {

    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 10px;

    width: 100%;

}

.safetyFilter {

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;

    min-height: 46px;

    padding: 10px 14px;

    border: 1px solid #d6dbe3;
    border-radius: 14px;

    background: #ffffff;
    color: #344054;

    font: inherit;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.safetyFilter__dot {

    flex: 0 0 auto;

}

.safetyFilters::-webkit-scrollbar {
    display: none;
}

.safetyFilter:hover {
    border-color: #94a3b8;
}

.safetyFilter:active {
    transform: translateY(1px);
}

.safetyFilter:focus-visible {
    outline: 3px solid rgba(95, 141, 255, 0.3);
    outline-offset: 2px;
}

/* =========================================================
   Search
   ========================================================= */

.safetySearch {
    position: relative;
    z-index: 20;

    padding: 20px;

    border-bottom: 1px solid rgba(148, 163, 184, 0.18);

    background: rgba(15, 23, 42, 0.72);
}

.safetySearch__label {
    display: block;
    margin-bottom: 8px;

    color: #e2e8f0;

    font-size: 0.875rem;
    font-weight: 700;
}

.safetySearch__control {
    position: relative;

    display: flex;
    align-items: center;
}

.safetySearch__icon {
    position: absolute;
    left: 16px;
    z-index: 2;

    color: #94a3b8;

    pointer-events: none;
}

.safetySearch__input {
    width: 100%;
    min-height: 52px;

    padding: 12px 92px 12px 46px;

    border: 1px solid #334155;
    border-radius: 14px;

    background: #0f172a;
    color: #f8fafc;

    font: inherit;
    outline: none;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}

.safetySearch__input::placeholder {
    color: #94a3b8;
}

.safetySearch__input:focus {
    border-color: #9cc0ff;

    background: #111c30;

    box-shadow:
        0 0 0 4px rgba(156, 192, 255, 0.16);
}

.safetySearch__clear {
    position: absolute;
    right: 14px;

    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #cbd5e1;

    font-size: 1.4rem;
    line-height: 1;

    cursor: pointer;
}

.safetySearch__clear:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #ffffff;
}

.safetySearch__clear:focus-visible {
    outline: 3px solid rgba(156, 192, 255, 0.55);
    outline-offset: 2px;
}

.safetySearch__spinner {
    position: absolute;
    right: 20px;

    width: 18px;
    height: 18px;

    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: #9cc0ff;
    border-radius: 50%;

    animation: safetySearchSpin 700ms linear infinite;
}

@keyframes safetySearchSpin {
    to {
        transform: rotate(360deg);
    }
}

.safetySearchResults {
    position: absolute;
    top: calc(100% - 12px);
    right: 20px;
    left: 20px;
    z-index: 1200;

    max-height: 330px;

    margin: 0;
    padding: 6px;

    overflow-y: auto;

    list-style: none;

    border: 1px solid #334155;
    border-radius: 14px;

    background: #0f172a;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.34);
}

.safetySearchResults[hidden] {
    display: none;
}

.safetySearchResult {
    display: block;

    width: 100%;
    padding: 12px 14px;

    box-sizing: border-box;
    border-radius: 10px;

    color: #f8fafc;

    cursor: pointer;
}

.safetySearchResult:hover,
.safetySearchResult.is-active,
.safetySearchResult[aria-selected="true"] {
    background: rgba(156, 192, 255, 0.14);
}

.safetySearchResult__name {
    display: block;

    font-weight: 700;
    line-height: 1.35;
}

.safetySearchResult__details {
    display: block;

    margin-top: 4px;

    color: #94a3b8;

    font-size: 0.84rem;
    line-height: 1.4;
}

.safetySearchMessage {
    padding: 14px;

    color: #cbd5e1;

    font-size: 0.9rem;
}

/* =========================================================
   Map
   ========================================================= */

.safetyMapShell {
    position: relative;
    z-index: 1;
    isolation: isolate;

    width: 100%;

    overflow: hidden;
}

#safety-map {
    width: 100%;
    height: clamp(480px, 66vh, 720px);
}

/*
 * Keep all Leaflet panes and controls inside the Safety Hub
 * stacking context. The global navigation should still use a
 * higher z-index, such as 5000.
 */
.safetyMapShell .leaflet-pane {
    z-index: 1;
}

.safetyMapShell .leaflet-tile-pane {
    z-index: 2;
}

.safetyMapShell .leaflet-overlay-pane {
    z-index: 3;
}

.safetyMapShell .leaflet-shadow-pane {
    z-index: 4;
}

.safetyMapShell .leaflet-marker-pane {
    z-index: 5;
}

.safetyMapShell .leaflet-tooltip-pane {
    z-index: 6;
}

.safetyMapShell .leaflet-popup-pane {
    z-index: 7;
}

.safetyMapShell .leaflet-top,
.safetyMapShell .leaflet-bottom {
    z-index: 10;
}

/* =========================================================
   Locate control
   ========================================================= */

.safetyLocate {
    position: absolute;
    right: 18px;
    bottom: 24px;
    z-index: 30;

    width: 52px;
    height: 52px;

    border: 1px solid #d6dbe3;
    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.18);

    font-size: 1.7rem;

    cursor: pointer;
}

.safetyLocate:hover {
    background: #f8fafc;
}

.safetyLocate:focus-visible {
    outline: 3px solid rgba(95, 141, 255, 0.35);
    outline-offset: 3px;
}

.safetyLocate.is-loading {
    cursor: wait;
    opacity: 0.7;
}

.safetyLocate:disabled {
    pointer-events: none;
}

/* =========================================================
   Map status
   ========================================================= */

.safetyMapStatus {
    position: absolute;
    right: 16px;
    bottom: 18px;
    left: 16px;
    z-index: 40;

    max-width: 520px;

    margin-inline: auto;
    padding: 10px 14px;

    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 11px;

    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;

    font-size: 0.87rem;
    line-height: 1.4;

    opacity: 0;
    pointer-events: none;

    transform: translateY(8px);

    transition:
        opacity 150ms ease,
        transform 150ms ease;
}

.safetyMapStatus:empty {
    display: none;
}

.safetyMapStatus.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.safetyMapStatus[data-state="error"] {
    border-color: rgba(248, 113, 113, 0.65);
}

.safetyMapStatus[data-state="success"] {
    border-color: rgba(74, 222, 128, 0.55);
}

.safetyMapStatus[data-state="loading"] {
    border-color: rgba(156, 192, 255, 0.55);
}

/* =========================================================
   Category markers
   ========================================================= */

.safetyMarkerWrapper,
.safetySearchMarkerWrapper {
    border: 0;
    background: transparent;
}

.safetyMarker {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #f2f4f7;

    box-shadow:
        0 4px 12px rgba(20, 35, 65, 0.3),
        0 1px 3px rgba(20, 35, 65, 0.22);

    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.safetyMarkerWrapper:hover .safetyMarker {
    transform: translateY(-2px) scale(1.08);

    box-shadow:
        0 8px 18px rgba(20, 35, 65, 0.34),
        0 2px 5px rgba(20, 35, 65, 0.24);
}

.safetyMarker__center {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    font-size: 25px;
    line-height: 1;

    user-select: none;
}

.safetyMarker--scam {
    background: #fee4e2;
}

.safetyMarker--alert {
    background: #fef0c7;
}

.safetyMarker--medical {
    background: #d1fadf;
}

.safetyMarker--transport {
    background: #dbeafe;
}

.safetyMarker--police {
    background: #e0e7ff;
}

.safetyMarker--useful {
    background: #f2f4f7;
}

.safetyMarker--stay {
    background: #f3e8ff;
}

/* =========================================================
   Search result marker
   ========================================================= */

.safetySearchMarker {
    position: relative;

    display: block;

    width: 34px;
    height: 34px;

    border: 4px solid #ffffff;
    border-radius: 50% 50% 50% 0;

    background: #0f172a;

    box-shadow:
        0 6px 18px rgba(15, 23, 42, 0.4);

    transform: rotate(-45deg);
}

.safetySearchMarker::after {
    position: absolute;
    inset: 8px;

    border-radius: 50%;

    background: #9cc0ff;

    content: "";
}

/* =========================================================
   Leaflet popup
   ========================================================= */

.safetyPopup {
    min-width: 220px;
    max-width: 290px;
}

.safetyPopup .leaflet-popup-content-wrapper {
    border-radius: 15px;

    background: #ffffff;
    color: #0f172a;

    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.24);
}

.safetyPopup .leaflet-popup-content {
    margin: 17px 18px;
}

.safetyPopup__content {
    min-width: 0;
}

.safetyPopup__category {
    display: inline-block;

    margin: 0 0 5px;

    color: #475569;

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.safetyPopup__title {
    margin: 0;

    color: #0f172a;

    font-size: 1.05rem;
    line-height: 1.3;
}

.safetyPopup__description,
.safetyPopup__text {
    margin: 10px 0 0;

    color: #334155;

    line-height: 1.5;
}

.safetyPopup__tips {
    margin-top: 12px;
    margin-bottom: 0;
    padding: 11px 12px;

    border-radius: 10px;

    background: #f1f5f9;
}

.safetyPopup__tips strong {
    display: block;
    margin-bottom: 4px;
}

.safetyPopup__tips p {
    margin: 0;

    color: #334155;

    line-height: 1.45;
}

.safetyPopup__reviewed,
.safetyPopup__meta {
    display: block;

    margin: 11px 0 0;

    color: #64748b;

    font-size: 0.78rem;
}

.safetyPopup__link {
    display: inline-flex;

    margin-top: 12px;

    color: #1d4ed8;

    font-weight: 750;
    text-decoration: none;
}

.safetyPopup__link:hover {
    text-decoration: underline;
}

.safetyPopup__link:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
}

.safetyPopup__simple {
    margin: 0;
    font-weight: 700;
}

/* =========================================================
   Search-location popup
   ========================================================= */

.safety-search-popup {
    display: grid;
    gap: 9px;
}

.safety-search-popup__title {
    display: block;

    color: #0f172a;

    font-size: 1rem;
    line-height: 1.35;
}

.safety-search-popup__address {
    margin: 0;

    color: #64748b;

    font-size: 0.85rem;
    line-height: 1.45;
}

.safety-search-popup__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    margin-top: 3px;
    padding: 8px 13px;

    border-radius: 999px;

    background: #111827;
    color: #ffffff;

    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.safety-search-popup__action:hover {
    background: #1f2937;
}

/* =========================================================
   User location
   ========================================================= */

.safetyUserLocation {
    stroke: #ffffff;
    fill: #2563eb;
}

.safetyUserAccuracy {
    stroke: #2563eb;
    fill: #60a5fa;
}

/* =========================================================
   Disclaimer
   ========================================================= */

.safetyDisclaimer {
    padding: 15px 20px 30px;

    color: #667085;

    font-size: 0.85rem;
    line-height: 1.5;
}

/* =========================================================
   Screen-reader utility
   ========================================================= */

.sr-only {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}

.safetyPopup{
    width:min(290px, 72vw);
}

.safetyPopup__title{
    margin:0;
    font-size:18px;
    line-height:1.25;
    letter-spacing:-.02em;
}

.safetyPopup__description{
    margin:9px 0 0;
    color:#5f6878;
    font-size:13px;
    line-height:1.55;
}

.safetyPopup__instructions{
    margin-top:14px;
    padding:12px;
    border-radius:14px;
    background:rgba(95,141,255,.08);
    border:1px solid rgba(95,141,255,.14);
}

.safetyPopup__instructions strong{
    display:block;
    font-size:12px;
}

.safetyPopup__instructions p{
    margin:5px 0 0;
    font-size:13px;
    line-height:1.5;
}

.safetyPopupActions{
    display:grid;
    gap:9px;
    margin-top:16px;
}

.safetyPopupAction{
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 13px;
    border:0;
    border-radius:999px;
    color:white;
    background:linear-gradient(
        135deg,
        var(--accent),
        var(--accent2)
    );
    text-decoration:none;
    font:inherit;
    font-size:13px;
    font-weight:900;
    cursor:pointer;
}

.safetyPopupAction--secondary{
    color:var(--text);
    background:rgba(95,141,255,.08);
    border:1px solid rgba(95,141,255,.14);
}

.safetyFilter--pickup .safetyFilter__dot {
    background: #8b5cf6;
}

.safetyMarker--rideshare-taxi-pickup {
    background: #8b5cf6;
}

/* Outer Leaflet popup container */
.safetyPopupShell .leaflet-popup-content-wrapper {
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
}

.safetyPopupShell .leaflet-popup-content {
    width: auto !important;
    min-width: 280px;
    max-width: 360px;
    margin: 0;
}

/* Inner popup content */
.safetyPopup {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 22px;
    overflow-wrap: anywhere;
    word-break: normal;
}

.safetyPopup__title {
    margin: 0 28px 12px 0;
    text-align: center;
    line-height: 1.25;
}

.safetyPopup__description {
    margin: 0 0 16px;
    max-width: 100%;
    line-height: 1.55;
    text-align: left;
    overflow-wrap: anywhere;
}

.safetyPopup__instructions {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
}

.safetyPopup__instructions strong {
    display: block;
    margin-bottom: 6px;
    text-align: left;
}

.safetyPopup__instructions p {
    margin: 0;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Action layout */
.safetyPopupActions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
}

.safetyPopupAction {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 14px;

    border: 0;
    border-radius: 12px;

    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.safetyPopupAction > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.safetyPopupAction > span:first-child {
    flex: 0 0 auto;
}

.safetyPopupAction > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.safetyPopupAction--secondary {
    appearance: none;
    -webkit-appearance: none;
}

/* ==========================================
   Popup action button variants
   ========================================== */

.safetyPopupAction--google {
    background: #34A853;
    color: #ffffff;
}

.safetyPopupAction--google:hover {
    background: #2c9449;
}

.safetyPopupAction--uber {
    background: #111827;
    color: #ffffff;
}

.safetyPopupAction--uber:hover {
    background: #000000;
}

.safetyPopupAction--secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
}

.safetyPopupAction--secondary:hover {
    background: #e5e7eb;
}

/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 768px) {
    #safety-map {
        height: min(72vh, 620px);
        min-height: 430px;
    }
}

@media (max-width: 700px) {
    .safetyTopbar {
        align-items: flex-start;
    }

    .safetyTopbar__eyebrow {
        display: none;
    }

    .safetyTopbar h1 {
        font-size: 1.45rem;
    }

    .safetyButton {
        min-height: 42px;
        padding: 9px 13px;

        font-size: 0.85rem;
    }

    /* .safetyMapShell {
        height: calc(100dvh - 138px);
        min-height: 500px;
    } */

    .safetyDisclaimer {
        display: none;
    }
}

@media (max-width: 640px) {
    .safetySearch {
        padding: 14px;
    }

    .safetySearchResults {
        right: 14px;
        left: 14px;
    }

    .safetySearch__input {
        min-height: 48px;

        font-size: 16px;
    }

    .safetyMapStatus {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .leaflet-control-zoom a {
        width: 38px;
        height: 38px;

        line-height: 38px;
    }
}

@media (max-width: 480px) {
    #safety-map {
        height: 68vh;
        min-height: 380px;
    }

    .safetyLocate {
        right: 14px;
        bottom: 18px;

        width: 48px;
        height: 48px;

        font-size: 1.5rem;
    }
}

@media (min-width: 640px) {
    .safetyPopupActions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .safetyPopupAction--secondary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {

    .safetyFilters {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

    }

}

@media (max-width: 640px) {

    .safetyToolbar {

        padding: 0 14px 14px;

    }

    .safetyFilters {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;

    }

    .safetyFilter {

        min-height: 48px;

        padding: 10px;

        font-size: .88rem;

        border-radius: 12px;

        text-align: center;

        white-space: normal;

    }

}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .safetyMapStatus,
    .safetyMarker,
    .safetyFilter {
        transition: none;
    }
}

/* =========================================================
   Final responsive filter-grid override
   Keep this at the end of safety.css
   ========================================================= */

/* .safetyToolbar {
    width: 100%;
    padding: 0 20px 16px;
    box-sizing: border-box;
}

.safetyFilters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
    padding: 0;

    overflow: visible;
    box-sizing: border-box;
}

.safetyFilter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: 100%;
    min-width: 0;
    min-height: 46px;

    padding: 10px 12px;

    white-space: normal;
    text-align: center;
    line-height: 1.25;

    flex: initial;
    box-sizing: border-box;
}

.safetyFilter__dot {
    flex: 0 0 auto;
} */

/* =========================================================
   Safety filter cards
   ========================================================= */

.safetyToolbar {
    width: 100%;
    padding: 0 20px 16px;
    box-sizing: border-box;
}

.safetyFilters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
    padding: 0;

    overflow: visible;
    box-sizing: border-box;
}

.safetyFilter {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: 100%;
    min-width: 0;
    min-height: 94px;
    padding: 12px 8px;

    border: 1px solid #dbe1ea;
    border-radius: 16px;

    background: #ffffff;
    color: #344054;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 5px 14px rgba(15, 23, 42, 0.05);

    font: inherit;
    cursor: pointer;

    flex: initial;

    transition:
        border-color 150ms ease,
        background-color 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.safetyFilter:hover {
    border-color: #aab5c5;

    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.06),
        0 8px 18px rgba(15, 23, 42, 0.08);

    transform: translateY(-1px);
}

.safetyFilter:active {
    transform: translateY(1px);
}

.safetyFilter:focus-visible {
    outline: 3px solid rgba(95, 141, 255, 0.35);
    outline-offset: 3px;
}

.safetyFilter__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 13px;

    background: #f1f5f9;

    font-size: 1.35rem;
    line-height: 1;
}

.safetyFilter__label {
    display: block;

    max-width: 100%;

    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;

    overflow-wrap: anywhere;
}


/* Inactive state */

.safetyFilter:not(.is-active) {
    background: #f8fafc;
    color: #8490a2;
    box-shadow: none;
}

.safetyFilter:not(.is-active) .safetyFilter__icon {
    filter: grayscale(0.85);
    opacity: 0.65;
}

/* Individual icon backgrounds */

.safetyFilter--scam .safetyFilter__icon {
    background: #fee4e2;
}

.safetyFilter--alert .safetyFilter__icon {
    background: #fef0c7;
}

.safetyFilter--medical .safetyFilter__icon {
    background: #d1fadf;
}

.safetyFilter--transport .safetyFilter__icon {
    background: #dbeafe;
}

.safetyFilter--pickup .safetyFilter__icon {
    background: #ede9fe;
}

.safetyFilter--police .safetyFilter__icon {
    background: #e0e7ff;
}

.safetyFilter--useful .safetyFilter__icon {
    background: #f1f5f9;
}

.safetyFilter--stay .safetyFilter__icon {
    background: #f3e8ff;
}

.safetyFilter.is-active {
    border-color: #5f8dff;
    background: #eef4ff;
    color: #172033;

    box-shadow:
        0 0 0 2px rgba(95, 141, 255, 0.18),
        0 8px 20px rgba(36, 64, 110, 0.1);
}

.safetyFilter.is-active .safetyFilter__icon {
    transform: scale(1.06);
}

.safetyFilter:not(.is-active) {
    background: #f8fafc;
    color: #8490a2;
    box-shadow: none;
}

.safetyFilter:not(.is-active) .safetyFilter__icon {
    filter: grayscale(0.85);
    opacity: 0.6;
}

.popupActions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.popupButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 44px;
    box-sizing: border-box;

    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid transparent;

    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background-color .16s ease,
        border-color .16s ease;
}

.popupButton:hover {
    transform: translateY(-1px);
}

.popupButton:focus-visible {
    outline: 3px solid rgba(95, 141, 255, .28);
    outline-offset: 2px;
}

.popupButton--google {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #4285f4,
        #2f6fe4
    );
    box-shadow:
        0 8px 18px rgba(66, 133, 244, .24);
}

.popupButton--google:hover {
    box-shadow:
        0 11px 24px rgba(66, 133, 244, .32);
}

.popupButton--uber {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #171717,
        #000000
    );
    box-shadow:
        0 8px 18px rgba(0, 0, 0, .2);
}

.popupButton--uber:hover {
    box-shadow:
        0 11px 24px rgba(0, 0, 0, .28);
}

.popupButton--secondary {
    color: #26344d;
    background: #f5f7fb;
    border-color: rgba(40, 70, 120, .14);
}

.popupButton--secondary:hover {
    background: #edf2fa;
    border-color: rgba(40, 70, 120, .22);
}

.pickupInfo {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;

    border-radius: 16px;
    border: 1px solid rgba(40, 70, 120, .12);
    background: #f7f9fd;
}

.pickupInfo__details {
    display: grid;
    gap: 12px;
}

.pickupInfo__item {
    display: grid;
    gap: 4px;
}

.pickupInfo__item strong {
    color: #1f2d44;
    font-size: 13px;
    font-weight: 850;
}

.pickupInfo__item p {
    margin: 0;
    color: #59677d;
    font-size: 13px;
    line-height: 1.5;
}

.pickupInfo__badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pickupInfo__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 7px 9px;
    border-radius: 999px;

    color: #32415a;
    background: #ffffff;
    border: 1px solid rgba(40, 70, 120, .12);

    font-size: 12px;
    font-weight: 800;
}

.mapControlButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 10px 14px;

    border: 1px solid rgba(40, 70, 120, .16);
    border-radius: 14px;

    color: #24324a;
    background: #ffffff;

    font: inherit;
    font-size: 14px;
    font-weight: 800;

    box-shadow:
        0 5px 14px rgba(31, 50, 84, .12);

    cursor: pointer;
}

.mapControlButton:hover {
    background: #f6f8fc;
}

.mapControlButton:disabled {
    opacity: .65;
    cursor: wait;
}

.mapControlSpinner {
    width: 15px;
    height: 15px;

    border: 2px solid rgba(38, 56, 86, .24);
    border-top-color: #263856;
    border-radius: 50%;

    animation:
        mapControlSpin .7s linear infinite;
}

@keyframes mapControlSpin {
    to {
        transform: rotate(360deg);
    }
}

.userLocationMarker {
    position: relative;

    display: grid;
    place-items: center;

    width: 28px;
    height: 28px;
}

.userLocationMarker__pulse {
    position: absolute;

    width: 28px;
    height: 28px;

    border-radius: 50%;
    background: rgba(66, 133, 244, .25);

    animation:
        userLocationPulse 1.8s ease-out infinite;
}

.userLocationMarker__dot {
    position: relative;

    width: 14px;
    height: 14px;

    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #4285f4;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, .28);
}

@keyframes userLocationPulse {

    0% {
        transform: scale(.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.7);
        opacity: 0;
    }

}

.userLocationPopup p {
    margin: 5px 0 0;
    max-width: 210px;

    color: #5c687b;
    font-size: 13px;
    line-height: 1.45;
}

.safetyMapShell {
    position: relative;
}

.safetyLocate {
    position: absolute;

    top: 16px;
    left: 16px;

    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border: none;
    border-radius: 50%;

    background: #ffffff;
    color: #1f2937;

    font-size: 22px;
    cursor: pointer;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.safetyLocate:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.28);
}

.safetyLocate:active {
    transform: scale(0.96);
}

.safetyLocate:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.safetySearch {
    position: relative;
}

.safetySearchResults {
    position: absolute;
    z-index: 30;

    top: calc(100% + 8px);
    left: 0;
    right: 0;

    max-height: 360px;
    overflow-y: auto;

    border: 1px solid rgba(31, 50, 84, .14);
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 18px 42px rgba(31, 50, 84, .18);
}

.safetySearchResults__section +
.safetySearchResults__section {
    border-top: 1px solid #e9edf4;
}

.safetySearchResults__heading {
    padding: 10px 14px 6px;

    color: #68758a;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.safetySearchResult {
    display: flex;
    align-items: center;
    gap: 11px;

    width: 100%;
    padding: 11px 14px;

    border: 0;
    background: transparent;

    color: #1f2937;
    text-align: left;
    cursor: pointer;
}

.safetySearchResult:hover,
.safetySearchResult.is-active {
    background: #f2f6ff;
}

.safetySearchResult__icon {
    flex: 0 0 auto;
    font-size: 20px;
}

.safetySearchResult__content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.safetySearchResult__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
}

.safetySearchResult__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #6b7688;
    font-size: 12px;
}

.safetySearchResults__empty {
    padding: 18px 14px;

    color: #69758a;
    font-size: 13px;
    text-align: center;
}

.safetyContributionOptions {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.safetyContributionCard {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;

    color: inherit;
    text-decoration: none;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease,
        background .15s ease;
}

.safetyContributionCard:hover {
    background: #f8fafc;
    border-color: #0f766e;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.safetyContributionCard__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border-radius: 12px;
    background: #eef8f6;

    font-size: 1.3rem;
}

.safetyContributionCard__content {
    flex: 1;
}

.safetyContributionCard__content strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: .95rem;
}

.safetyContributionCard__content span {
    display: block;
    color: #6b7280;
    font-size: .82rem;
    line-height: 1.4;
}

.safetyContributionCard__arrow {
    color: #9ca3af;
    font-size: 1.2rem;
}

.safetyLocationList {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

/* =========================================================
   Neighborhood sections
   ========================================================= */

.safetyNeighborhood {
    min-width: 0;
}

.safetyNeighborhood + .safetyNeighborhood {
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.safetyNeighborhood__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.safetyNeighborhood__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.safetyNeighborhood__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    background: #eef8f6;
    border-radius: 10px;

    font-size: 1rem;
}

.safetyNeighborhood__title {
    margin: 0;

    color: #111827;
    font-size: 1.2rem;
    line-height: 1.25;
}

.safetyNeighborhood__count {
    flex-shrink: 0;

    padding: 5px 9px;

    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;

    font-size: .74rem;
    font-weight: 700;
}

.safetyNeighborhood__list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Reduce space between the map and Safety Locations */
.safetyMapCard {
    margin-bottom: 24px;
}

.safetyLocations {
    margin-top: 0;
}

@media (max-width: 900px) {
    .safetyFilters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .safetyNeighborhood__list {
        grid-template-columns: 1fr;
    }

    .safetyNeighborhood + .safetyNeighborhood {
        padding-top: 24px;
    }

    .safetyNeighborhood__header {
        align-items: flex-start;
    }

    .safetyNeighborhood__title {
        font-size: 1.08rem;
    }
}

@media (max-width: 640px) {
    .safetyToolbar {
        padding-right: 14px;
        padding-left: 14px;
    }

    .safetyFilters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .safetyFilter {
        min-height: 50px;
        padding: 9px 8px;
        border-radius: 12px;
        font-size: 0.84rem;
    }

    .safetyNeighborhood__list {
        grid-template-columns: 1fr;
    }

    .safetyNeighborhood + .safetyNeighborhood {
        padding-top: 24px;
    }

    .safetyNeighborhood__header {
        align-items: flex-start;
    }

    .safetyNeighborhood__title {
        font-size: 1.08rem;
    }
}

@media (max-width: 900px) {
    .safetyFilters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .safetyToolbar {
        padding-right: 14px;
        padding-left: 14px;
    }

    .safetyFilters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 7px;
    }

    .safetyFilter {
        min-height: 84px;
        padding: 9px 4px;
        border-radius: 13px;
    }

    .safetyFilter__icon {
        width: 36px;
        height: 36px;

        border-radius: 11px;

        font-size: 1.15rem;
    }

    .safetyFilter__label {
        font-size: 0.68rem;
        line-height: 1.12;
    }

    .safetyNeighborhood__list {
        grid-template-columns: 1fr;
    }

    .safetyNeighborhood + .safetyNeighborhood {
        padding-top: 24px;
    }

    .safetyNeighborhood__header {
        align-items: flex-start;
    }

    .safetyNeighborhood__title {
        font-size: 1.08rem;
    }
}

@media (max-width: 390px) {
    .safetyFilters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .safetyFilter {
        min-height: 82px;
    }

    .safetyFilter__label {
        font-size: 0.78rem;
    }

    .safetyNeighborhood__list {
        grid-template-columns: 1fr;
    }

    .safetyNeighborhood + .safetyNeighborhood {
        padding-top: 24px;
    }

    .safetyNeighborhood__header {
        align-items: flex-start;
    }

    .safetyNeighborhood__title {
        font-size: 1.08rem;
    }
}

.safetyFilter__label--mobile {
    display: none;
}

@media (max-width: 640px) {
    .safetyFilter__label--desktop {
        display: none;
    }

    .safetyFilter__label--mobile {
        display: block;
    }

    .safetyNeighborhood__list {
        grid-template-columns: 1fr;
    }

    .safetyNeighborhood + .safetyNeighborhood {
        padding-top: 24px;
    }

    .safetyNeighborhood__header {
        align-items: flex-start;
    }

    .safetyNeighborhood__title {
        font-size: 1.08rem;
    }
}

/* =========================================================
   Final map/list spacing fix
   Must remain at the bottom of this file
   ========================================================= */

.safetyMapCard {
    margin-bottom: 0;
    padding-bottom: 0;
}

.safetyMapShell {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#safety-map {
    display: block;
    width: 100%;
    height: clamp(480px, 66vh, 720px);
    margin: 0;
}

.safetyLocations {
    margin-top: 20px;
    padding-top: 0;
}

@media (max-width: 768px) {
    #safety-map {
        height: min(68vh, 620px);
        min-height: 430px;
    }

    .safetyLocations {
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    #safety-map {
        height: 62vh;
        min-height: 380px;
    }
}