.safari-route-map {
    position: relative;
    isolation: isolate;
    height: 460px;
    height: clamp(380px, 46vw, 480px);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #dbe9e1;
    background: #eef4f0;
    box-shadow: 0 8px 24px rgba(15, 81, 50, .08);
}

.safari-route-map__canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.safari-route-map__canvas .leaflet-container {
    width: 100%;
    height: 100%;
    background: #e8f0eb;
    font-family: 'Montserrat', Arial, sans-serif;
}

.safari-route-map .leaflet-tile-pane {
    filter: saturate(.9) contrast(.96);
}

.safari-route-map__fallback {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(23, 102, 64, .08), rgba(23, 102, 64, 0) 55%),
        repeating-linear-gradient(90deg, rgba(23, 102, 64, .035) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(0deg, rgba(23, 102, 64, .035) 0 1px, transparent 1px 34px),
        #f4f9f6;
    color: #355a49;
    transition: opacity .3s ease, visibility .3s ease;
}

.safari-route-map__fallback-title {
    margin: 0;
    color: #176640;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.safari-route-map__fallback p {
    max-width: 540px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.safari-route-map__fallback a {
    color: #176640;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
}

.safari-route-map.is-ready .safari-route-map__fallback {
    opacity: 0;
    visibility: hidden;
}

.safari-route-map__hud {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 80px);
    padding: 7px 8px 7px 12px;
    border: 1px solid rgba(23, 102, 64, .13);
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 24px rgba(15, 81, 50, .14);
    line-height: 1.2;
    opacity: 0;
    transform: translateY(-7px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}

.safari-route-map.is-ready .safari-route-map__hud {
    opacity: 1;
    transform: none;
}

.safari-route-map__kicker {
    display: block;
    color: #7c8e84;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.safari-route-map__distance {
    color: #3f5b4c;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.safari-route-map__replay {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: #176640;
    color: #fff;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: background .2s ease, transform .2s ease;
}

.safari-route-map__replay:hover {
    background: #0f5132;
}

.safari-route-map__replay:active {
    transform: scale(.97);
}

.safari-route-map__replay:focus-visible {
    outline: 2px solid #f2a33a;
    outline-offset: 2px;
}

.safari-route-map__replay svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}

.safari-route-map__legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 500;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(23, 102, 64, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 14px rgba(15, 81, 50, .1);
    color: #455e51;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}

.safari-route-map.is-ready .safari-route-map__legend {
    opacity: 1;
}

.safari-route-map__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.safari-legend-line {
    display: inline-block;
    width: 25px;
    border-top: 3px dotted #176640;
}

.safari-legend-arrow {
    color: #176640;
    font-size: 16px;
    line-height: .7;
}

.safari-legend-stop {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f2a33a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.safari-legend-stop--finish {
    background: #0f5132;
}

.safari-route-map .leaflet-control-container {
    opacity: 0;
    transition: opacity .3s ease;
}

.safari-route-map.is-ready .leaflet-control-container {
    opacity: 1;
}

.safari-route-map .leaflet-control-zoom {
    border: 1px solid #dbe9e1;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 81, 50, .12);
}

.safari-route-map .leaflet-control-zoom a {
    width: 30px;
    height: 30px;
    line-height: 30px;
    color: #176640;
    background: rgba(255, 255, 255, .96);
    border-color: #e3efe7;
    font-size: 18px;
}

.safari-route-map .leaflet-control-zoom a:hover {
    background: #eef7f1;
    color: #0f5132;
}

.safari-route-map .leaflet-control-attribution {
    padding: 1px 6px;
    background: rgba(255, 255, 255, .82);
    color: #66796e;
    font-size: 8.5px;
}

.safari-route-map .leaflet-control-attribution a {
    color: #176640;
}

.safari-route-map .leaflet-control-scale-line {
    border-color: #176640;
    border-top: 0;
    background: rgba(255, 255, 255, .78);
    color: #3c5b4c;
    font-size: 9px;
}

.safari-route-halo {
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.safari-route-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.safari-route-map.is-ready .safari-route-line {
    animation: safari-route-dash 1.25s linear infinite;
}

@keyframes safari-route-dash {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -12;
    }
}

.safari-route-stop-wrap,
.safari-route-arrow-wrap,
.safari-route-mover-wrap {
    border: 0 !important;
    background: transparent !important;
}

.safari-route-stop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    margin: 4px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #176640;
    color: #fff;
    box-shadow: 0 4px 12px rgba(12, 61, 38, .32);
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

.safari-route-stop--start {
    width: 34px;
    height: 34px;
    margin: 2px;
    background: #f2a33a;
    color: #173d2b;
    font-size: 11px;
    box-shadow: 0 4px 14px rgba(145, 89, 13, .34);
}

.safari-route-stop--finish {
    width: 34px;
    height: 34px;
    margin: 2px;
    background: #0f5132;
    color: #fff;
    font-size: 11px;
    box-shadow: 0 4px 14px rgba(12, 61, 38, .38);
}

.safari-route-stop--finish::after {
    content: "";
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(15, 81, 50, .35);
    border-radius: 50%;
}

.map-section .route-stop-finish {
    border-color: #cfe4d8;
    background: #eef7f1;
}

.map-section .route-stop-finish .route-stop-num {
    background: #0f5132;
}

.safari-route-stop--start::before,
.safari-route-stop--start::after {
    content: "";
    position: absolute;
    inset: -7px;
    border: 2px solid rgba(242, 163, 58, .65);
    border-radius: 50%;
    animation: safari-route-pulse 2.2s ease-out infinite;
}

.safari-route-stop--start::after {
    animation-delay: 1.1s;
}

.safari-route-map.is-zoomed-out .safari-route-stop--start::before,
.safari-route-map.is-zoomed-out .safari-route-stop--start::after {
    display: none;
}

@keyframes safari-route-pulse {
    0% {
        opacity: .75;
        transform: scale(.75);
    }

    80%,
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

.leaflet-tooltip.safari-route-label {
    padding: 6px 9px;
    border: 1px solid #d8e8de;
    border-radius: 9px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 4px 12px rgba(15, 81, 50, .14);
    color: #173d2b;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.leaflet-tooltip.safari-route-label::before {
    display: none;
}

.safari-route-map.is-zoomed-out .leaflet-tooltip.safari-route-label--permanent {
    display: none;
}

.safari-route-label small {
    display: block;
    margin-top: 1px;
    color: #708277;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.safari-route-arrow-wrap {
    z-index: 450 !important;
}

.safari-route-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 2px;
    border: 1.5px solid #176640;
    border-radius: 50%;
    background: #fff;
    color: #176640;
    box-shadow: 0 2px 7px rgba(15, 81, 50, .22);
    opacity: .92;
    transform: rotate(var(--safari-arrow-heading, 0deg));
}

.safari-route-arrow svg {
    display: block;
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.safari-route-mover-wrap {
    z-index: 800 !important;
}

.safari-route-mover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 2px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #e0962a;
    color: #fff;
    box-shadow: 0 6px 18px rgba(96, 58, 6, .34);
}

.safari-route-mover::before {
    content: "";
    position: absolute;
    inset: -9px;
    border: 2px solid rgba(224, 150, 42, .45);
    border-radius: 50%;
    animation: safari-route-mover-pulse 1.8s ease-out infinite;
}

.safari-route-mover__arrow {
    display: flex;
    transform: rotate(0deg);
    transform-origin: center;
    will-change: transform;
}

.safari-route-mover__arrow svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: currentColor;
}

@keyframes safari-route-mover-pulse {
    0% {
        opacity: .7;
        transform: scale(.7);
    }

    75%,
    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

.safari-route-map.is-reduced-motion .safari-route-mover-wrap,
.safari-route-map.is-reduced-motion .safari-route-map__replay {
    display: none;
}

@media (max-width: 768px) {
    .safari-route-map {
        height: 400px;
        border-radius: 12px;
    }

    .safari-route-map__hud {
        top: 10px;
        left: 10px;
        gap: 7px;
        max-width: calc(100% - 16px);
        padding: 6px 7px 6px 10px;
    }

    .safari-route-map__kicker {
        font-size: 8.5px;
    }

    .safari-route-map__distance {
        font-size: 9px;
    }

    .safari-route-map__replay {
        padding: 5px 8px;
        font-size: 9px;
    }

    .safari-route-map__legend {
        bottom: 10px;
        left: 10px;
        gap: 9px;
        padding: 7px 10px;
        font-size: 9.5px;
    }

    .leaflet-tooltip.safari-route-label {
        padding: 5px 7px;
        font-size: 9.5px;
    }

    .leaflet-tooltip.safari-route-label small {
        display: none;
    }
}

@media (max-width: 420px) {
    .safari-route-map {
        height: 370px;
    }

    .safari-route-map__kicker {
        display: none;
    }

    .safari-route-map__hud {
        padding: 5px 6px 5px 9px;
    }

    .safari-route-map__distance {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .safari-route-map.is-ready .safari-route-line,
    .safari-route-stop--start::before,
    .safari-route-stop--start::after,
    .safari-route-mover::before {
        animation: none !important;
    }

    .safari-route-map__hud,
    .safari-route-map__legend,
    .safari-route-map .leaflet-control-container,
    .safari-route-map__fallback {
        transition: none;
    }
}

.route-map-replay {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 18px;
    border: 1px solid #176640;
    border-radius: 8px;
    background: #fff;
    color: #176640;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.route-map-replay:hover {
    background: #176640;
    color: #fff;
}

.route-map-replay:active {
    transform: scale(.98);
}

.route-map-replay:focus-visible {
    outline: 2px solid #f2a33a;
    outline-offset: 2px;
}

.route-map-replay svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.route-map-replay[hidden] {
    display: none;
}
