/* Modern Dark Mode Fixes and Improved Styling */

/* Ensure dark mode actually looks dark */
.dark {
    color-scheme: dark;
}

/* Glass morphism effects with proper dark mode */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(17, 24, 39, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.glass-dark {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode background fixes */
.dark body {
    background: #0f172a !important;
    background-image: linear-gradient(to bottom right, #0f172a, #1e293b) !important;
}

.dark .bg-white {
    background-color: rgb(30 41 59) !important;
}

.dark .bg-gray-50 {
    background-color: rgb(30 41 59) !important;
}

.dark .bg-gray-100 {
    background-color: rgb(51 65 85) !important;
}

.dark .bg-gray-200 {
    background-color: rgb(71 85 105) !important;
}

/* Dark mode text colors */
.dark .text-gray-900 {
    color: rgb(241 245 249) !important;
}

.dark .text-gray-800 {
    color: rgb(226 232 240) !important;
}

.dark .text-gray-700 {
    color: rgb(203 213 225) !important;
}

.dark .text-gray-600 {
    color: rgb(148 163 184) !important;
}

.dark .text-gray-500 {
    color: rgb(100 116 139) !important;
}

/* Dark mode borders */
.dark .border-gray-200 {
    border-color: rgb(51 65 85 / 0.3) !important;
}

.dark .border-gray-300 {
    border-color: rgb(71 85 105 / 0.3) !important;
}

/* Input fields in dark mode */
.dark input[type="text"],
.dark input[type="search"],
.dark select,
.dark textarea {
    background-color: rgb(30 41 59) !important;
    border-color: rgb(51 65 85) !important;
    color: rgb(226 232 240) !important;
}

.dark input[type="text"]:focus,
.dark input[type="search"]:focus,
.dark select:focus,
.dark textarea:focus {
    background-color: rgb(15 23 42) !important;
    border-color: rgb(13 148 136) !important; /* teal-600 */
}

.dark input::placeholder {
    color: rgb(100 116 139) !important;
}

/* Dark mode cards and panels */
.dark .bg-white.rounded-xl,
.dark .bg-white.rounded-2xl,
.dark .bg-white.rounded-lg {
    background-color: rgb(30 41 59) !important;
    border: 1px solid rgb(51 65 85 / 0.5);
}

/* Hover states in dark mode */
.dark .hover\:bg-gray-50:hover {
    background-color: rgb(51 65 85) !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: rgb(71 85 105) !important;
}

.dark .hover\:bg-gray-200:hover {
    background-color: rgb(100 116 139) !important;
}

/* Map popup styles for dark mode */
.dark .leaflet-popup-content-wrapper {
    background-color: rgb(30 41 59) !important;
    color: rgb(226 232 240) !important;
    border: 1px solid rgb(51 65 85);
}

.dark .leaflet-popup-tip {
    background-color: rgb(30 41 59) !important;
    border-color: rgb(51 65 85) !important;
}

.dark .leaflet-popup-close-button {
    color: rgb(148 163 184) !important;
}

.dark .leaflet-popup-close-button:hover {
    color: rgb(226 232 240) !important;
}

.ff-mobile-remove-ads-cta {
    display: none;
}

.ff-mobile-footer-ad-backdrop {
    display: none;
}

body.ff-publift-ad-free #inScreen.st-placement,
body.ff-publift-ad-free .st-placement.inScreen,
body.ff-publift-ad-free .st-adunit-inscreen,
body.ff-publift-ad-free .st-adunit-ad[data-testid="adunit-ad"] {
    display: none !important;
}

body.ff-account-modal-open .ff-mobile-footer-ad-backdrop,
body.ff-account-modal-open::after,
body.ff-account-modal-open [id^="publift-widget-"],
body.ff-account-modal-open [class*="publift-widget-"],
body.ff-account-modal-open .google-auto-placed,
body.ff-account-modal-open [data-google-container-id],
body.ff-account-modal-open [id*="google_ads_iframe"][id$="__container__"],
body.ff-account-modal-open #inScreen.st-placement,
body.ff-account-modal-open .st-placement.inScreen,
body.ff-account-modal-open .st-adunit-inscreen,
body.ff-account-modal-open .st-adunit-ad[data-testid="adunit-ad"] {
    z-index: 9000 !important;
    pointer-events: none !important;
}

/* The mobile account sheet already reserves the measured footer height plus a
   12px gap. Keep only the sticky footer above that sheet; other page-level ad
   surfaces remain behind the modal backdrop. */
@media (max-width: 1023px) {
    body.ff-mobile-footer-ad-space.ff-account-modal-open [id*="Sticky_Footer"],
    body.ff-mobile-footer-ad-space.ff-account-modal-open [class*="publift-widget-Sticky_Footer"],
    body.ff-mobile-footer-ad-space.ff-account-modal-open #inScreen.st-placement,
    body.ff-mobile-footer-ad-space.ff-account-modal-open .st-placement.inScreen,
    body.ff-mobile-footer-ad-space.ff-account-modal-open .st-adunit-inscreen,
    body.ff-mobile-footer-ad-space.ff-account-modal-open .st-adunit-inscreen .st-adunit-ad {
        z-index: 10090 !important;
        pointer-events: auto !important;
    }

    body.ff-mobile-footer-ad-space.ff-account-modal-open [id*="Sticky_Footer"] *,
    body.ff-mobile-footer-ad-space.ff-account-modal-open [class*="publift-widget-Sticky_Footer"] *,
    body.ff-mobile-footer-ad-space.ff-account-modal-open #inScreen.st-placement *,
    body.ff-mobile-footer-ad-space.ff-account-modal-open .st-placement.inScreen *,
    body.ff-mobile-footer-ad-space.ff-account-modal-open .st-adunit-inscreen * {
        pointer-events: auto !important;
    }
}

@media (max-width: 1023px) {
    /* Treat the fuel choices as tabs belonging to the floating search panel,
       rather than a second row of disconnected pills. */
    .ff-mobile-search-cluster {
        --ff-mobile-search-surface: rgb(255 255 255);
        --ff-mobile-fuel-motion-duration: 150ms;
        --ff-mobile-fuel-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
        filter: drop-shadow(0 10px 16px rgb(15 23 42 / 0.16));
    }

    html.dark .ff-mobile-search-cluster {
        --ff-mobile-search-surface: rgb(30 41 59);
        filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.34));
    }

    .ff-mobile-search-cluster .ff-mobile-search-panel {
        position: relative;
        z-index: 2;
        background: var(--ff-mobile-search-surface) !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    html.dark .ff-mobile-search-cluster .ff-mobile-search-panel {
        background: var(--ff-mobile-search-surface) !important;
        border: 0 !important;
    }

    .ff-mobile-fuel-tabs {
        z-index: 1;
        margin: -1px 0.75rem 0;
    }

    .ff-mobile-fuel-tabs__grid {
        gap: 0.25rem !important;
    }

    .ff-mobile-fuel-tab {
        min-height: 2.375rem;
        border: 0 !important;
        border-radius: 0 0 0.75rem 0.75rem !important;
        box-shadow: none !important;
        transform-origin: top center;
        transition-property: color, background-color, border-color, border-radius, transform;
        transition-duration: var(--ff-mobile-fuel-motion-duration);
        transition-timing-function: var(--ff-mobile-fuel-motion-ease);
    }

    .ff-mobile-fuel-option {
        border: 0 !important;
        box-shadow: none !important;
        transition-property: color, background-color, border-color, box-shadow, transform;
        transition-duration: var(--ff-mobile-fuel-motion-duration);
        transition-timing-function: var(--ff-mobile-fuel-motion-ease);
    }

    .ff-mobile-fuel-tab:active,
    .ff-mobile-fuel-option:active {
        transform: scale(0.98) !important;
    }

    .ff-mobile-fuel-tab[aria-pressed="false"] {
        background: var(--ff-mobile-search-surface) !important;
    }

    .ff-mobile-fuel-tab:focus {
        outline: none;
        box-shadow: none !important;
    }

    .ff-mobile-fuel-tab:focus-visible {
        outline: 2px solid rgb(45 212 191);
        outline-offset: 2px;
    }

    .ff-mobile-more-fuels-tab[aria-expanded="true"]:focus-visible {
        outline: none;
    }

    .ff-mobile-more-fuels-tab[aria-expanded="true"] {
        border-bottom-color: transparent !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .ff-mobile-more-fuels-chevron {
        transition-duration: var(--ff-mobile-fuel-motion-duration) !important;
        transition-timing-function: var(--ff-mobile-fuel-motion-ease) !important;
    }

    .ff-mobile-more-fuels-tab::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -0.5625rem;
        height: 0.625rem;
        z-index: 1;
        background-color: inherit;
        pointer-events: none;
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top center;
        transition: opacity var(--ff-mobile-fuel-motion-duration) var(--ff-mobile-fuel-motion-ease),
                    transform var(--ff-mobile-fuel-motion-duration) var(--ff-mobile-fuel-motion-ease);
    }

    .ff-mobile-more-fuels-tab[aria-expanded="true"]::after {
        opacity: 1;
        transform: scaleY(1);
    }

    .ff-mobile-search-cluster .ff-mobile-more-fuels-menu {
        background: var(--ff-mobile-search-surface) !important;
        border: 0 !important;
        transition-duration: var(--ff-mobile-fuel-motion-duration) !important;
        transition-timing-function: var(--ff-mobile-fuel-motion-ease) !important;
    }

    /* Publift can place a 320x100 creative inside a nominal 320x50 shell.
       Follow the creative's native height and scale the complete provider
       surface only when the visual viewport is narrower than the slot. */
    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted {
        width: var(--ff-sticky-footer-shell-width) !important;
        height: var(--ff-sticky-footer-shell-height) !important;
        max-width: none !important;
        max-height: none !important;
        transform: translateX(-50%) scale(var(--ff-sticky-footer-fit-scale, 1)) !important;
        transform-origin: center bottom !important;
        overflow: visible !important;
    }

    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted > [class~="publift-widget-Sticky_Footer"],
    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted [data-fuse="Sticky_Footer"],
    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted .fuse-slot-sticky,
    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted .fuse-slot,
    [class~="publift-widget-Sticky_Footer-container"].ff-sticky-footer-shell-fitted [id*="google_ads_iframe"][id$="__container__"] {
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        box-sizing: border-box;
    }

    body.ff-mobile-footer-ad-space {
        --ff-mobile-footer-ad-height: 50px;
        --ff-mobile-footer-ad-gap: 0.75rem;
        --ff-mobile-footer-ad-occupied: var(--ff-sticky-footer-measured-occupied, calc(var(--ff-mobile-footer-ad-height) + env(safe-area-inset-bottom, 0px)));
        --ff-mobile-footer-ad-clearance: calc(var(--ff-mobile-footer-ad-occupied) + var(--ff-mobile-footer-ad-gap));
        --ff-mobile-footer-floating-bottom: var(--ff-mobile-footer-ad-clearance);
        --ff-mobile-footer-ad-surface: rgb(255 255 255);
    }

    html.dark body.ff-mobile-footer-ad-space {
        --ff-mobile-footer-ad-surface: rgb(30 41 59);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-footer-ad-backdrop,
    body.ff-mobile-footer-ad-space::after {
        content: "";
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--ff-mobile-footer-ad-clearance);
        background: var(--ff-mobile-footer-ad-surface);
        pointer-events: none;
        z-index: 8990;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-remove-ads-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        min-height: 2.5rem;
        padding: 0 0.75rem 0 0.55rem;
        border: 1px solid rgb(229 231 235 / 0.9);
        border-radius: 1rem;
        background: rgb(255 255 255 / 0.96);
        color: rgb(55 65 81);
        box-shadow: 0 10px 24px rgb(15 23 42 / 0.18);
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        transition: transform 150ms ease, box-shadow 150ms ease;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-remove-ads-cta:active {
        transform: scale(0.96);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-remove-ads-cta__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1rem;
        height: 1rem;
        color: rgb(5 150 105);
        flex-shrink: 0;
    }

    html.dark body.ff-mobile-footer-ad-space .ff-mobile-remove-ads-cta {
        border-color: rgb(55 65 81 / 0.9);
        background: rgb(17 24 39 / 0.96);
        color: rgb(229 231 235);
        box-shadow: 0 6px 18px rgb(0 0 0 / 0.35);
    }

    html.dark body.ff-mobile-footer-ad-space .ff-mobile-remove-ads-cta__icon {
        color: rgb(167 243 208);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-floating,
    body.ff-mobile-footer-ad-space .ff-mobile-ad-bottom-sheet {
        --ff-mobile-footer-hidden-translate: calc(100% + var(--ff-mobile-footer-ad-clearance));
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-floating {
        bottom: var(--ff-mobile-footer-floating-bottom) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-map-buttons {
        bottom: var(--ff-mobile-footer-ad-occupied) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-footer-tab {
        border-bottom-color: transparent !important;
        border-radius: 1rem 1rem 0 0 !important;
        transform-origin: bottom center;
    }

    .ff-mobile-footer-tab-dock--stations {
        background: rgb(13 148 136);
        border-radius: 1rem 1rem 0 0;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-footer-tab__content {
        transform: translateY(-2px);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-footer-tab--stations .ff-mobile-footer-tab__content {
        transform: translateY(-4px);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-left-map-actions .ff-mobile-remove-ads-cta {
        margin-bottom: var(--ff-mobile-footer-ad-gap);
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-floating.translate-y-full,
    body.ff-mobile-footer-ad-space .ff-mobile-ad-bottom-sheet.translate-y-full {
        transform: translateY(var(--ff-mobile-footer-hidden-translate)) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-bottom-sheet {
        bottom: var(--ff-mobile-footer-ad-clearance) !important;
        max-height: min(85dvh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--ff-mobile-footer-ad-clearance))) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-filter-sheet {
        margin-bottom: var(--ff-mobile-footer-ad-clearance) !important;
        max-height: min(85dvh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--ff-mobile-footer-ad-clearance))) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-scroll {
        max-height: min(80dvh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--ff-mobile-footer-ad-clearance) - 4rem)) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-filter-scroll {
        max-height: min(80dvh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--ff-mobile-footer-ad-clearance) - 4rem)) !important;
    }

    /* Keep vertical station-list swipes owned by the sheet when they begin on
       an inline ad. Taps still reach the creative; only the pan axis is
       reserved for the nearest scrolling ancestor. */
    [data-ff-station-list-scroll] {
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    [data-ff-station-list-scroll] .ff-station-ad-slot,
    [data-ff-station-list-scroll] .ff-station-ad-slot [data-fuse],
    [data-ff-station-list-scroll] .ff-station-ad-slot [id^="fuse-slot-"],
    [data-ff-station-list-scroll] .ff-station-ad-slot [id*="google_ads_iframe"],
    [data-ff-station-list-scroll] .ff-station-ad-slot iframe {
        touch-action: pan-y !important;
    }

    body.ff-mobile-footer-ad-space .auth-modal-container,
    body.ff-mobile-footer-ad-space .ff-mobile-modal-container {
        --ff-mobile-modal-surface: rgb(255 255 255);
        background: linear-gradient(
            to top,
            var(--ff-mobile-modal-surface) 0 var(--ff-mobile-footer-ad-clearance),
            transparent var(--ff-mobile-footer-ad-clearance)
        ) !important;
        min-height: 100dvh !important;
        padding-bottom: var(--ff-mobile-footer-ad-clearance) !important;
    }

    .dark body.ff-mobile-footer-ad-space .auth-modal-container,
    .dark body.ff-mobile-footer-ad-space .ff-mobile-modal-container {
        --ff-mobile-modal-surface: rgb(31 41 55);
    }

    body.ff-mobile-footer-ad-space .auth-modal-card,
    body.ff-mobile-footer-ad-space .ff-mobile-modal-card {
        max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--ff-mobile-footer-ad-clearance) - 1rem)) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-filter-footer {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-overlay {
        bottom: var(--ff-mobile-footer-ad-clearance) !important;
    }

    body.ff-mobile-footer-ad-space .ff-mobile-ad-hint {
        bottom: max(5rem, var(--ff-mobile-footer-floating-bottom)) !important;
    }

    body.ff-mobile-footer-ad-space .leaflet-control-attribution.leaflet-control {
        bottom: calc(var(--ff-mobile-footer-floating-bottom) - 0.25rem) !important;
    }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
    .ff-mobile-fuel-tab,
    .ff-mobile-fuel-option,
    .ff-mobile-more-fuels-chevron,
    .ff-mobile-more-fuels-menu,
    .ff-mobile-more-fuels-tab::after {
        transition-duration: 0.01ms !important;
    }

    .ff-mobile-fuel-tab:active,
    .ff-mobile-fuel-option:active {
        transform: none !important;
    }
}

/* Map controls in dark mode */
.dark .leaflet-control-zoom a {
    background-color: rgb(30 41 59) !important;
    color: rgb(226 232 240) !important;
    border-color: rgb(51 65 85) !important;
}

.dark .leaflet-control-zoom a:hover {
    background-color: rgb(51 65 85) !important;
}

.dark .leaflet-control-attribution {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: rgb(148 163 184) !important;
}

/* Fix for Leaflet div icons - ensure transparent background and no border */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/*
 * Critical fix for custom div icon markers:
 * Leaflet applies margins based on iconAnchor via inline styles.
 * We must NOT override these with fixed values or markers will drift on zoom/pan.
 * Only reset width/height to auto so iconSize works correctly.
 */
.leaflet-marker-icon.custom-div-icon,
.leaflet-marker-icon.user-location-div-icon {
    /* Let Leaflet's inline margin styles from iconAnchor take precedence */
    width: auto !important;
    height: auto !important;
}

/* User location marker - disable pointer events so clicks pass through */
.leaflet-marker-icon.user-location-div-icon {
    pointer-events: none !important;
}

.ff-station-stack-marker {
    transform: translateZ(0);
}

.ff-station-stack-marker--hint {
    animation: ff-stack-marker-highlight 1.6s ease-out 2;
}

.ff-stack-hint {
    --hint-arrow-x: 50%;
    position: absolute;
    z-index: 40;
    width: 218px;
    min-height: 64px;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: #0f172a;
    color: #ffffff;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 8px 24px rgba(15, 23, 42, 0.34),
        0 2px 6px rgba(15, 23, 42, 0.18);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    opacity: 1;
    filter: blur(0);
    animation: ff-stack-hint-enter 260ms cubic-bezier(0.2, 0, 0, 1) both;
    transition-property: opacity, filter, scale;
    transition-duration: 160ms;
    transition-timing-function: ease-out;
}

.ff-stack-hint::after {
    content: '';
    position: absolute;
    left: var(--hint-arrow-x);
    margin-left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.ff-stack-hint--above {
    bottom: calc(100% + 9px);
}

.ff-stack-hint--above::after {
    bottom: -7px;
    border-top: 7px solid #0f172a;
}

.ff-stack-hint--below {
    top: calc(100% + 7px);
}

.ff-stack-hint--below::after {
    top: -7px;
    border-bottom: 7px solid #0f172a;
}

.ff-stack-hint--align-center {
    left: 50%;
    transform: translateX(-50%);
}

.ff-stack-hint--align-start {
    --hint-arrow-x: 42px;
    left: 0;
}

.ff-stack-hint--align-end {
    --hint-arrow-x: calc(100% - 42px);
    right: 0;
}

.ff-stack-hint__title,
.ff-stack-hint__copy {
    display: block;
}

.ff-stack-hint__title {
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.ff-stack-hint__copy {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    text-wrap: pretty;
}

.ff-stack-hint:hover {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 10px 28px rgba(15, 23, 42, 0.38),
        0 2px 6px rgba(15, 23, 42, 0.2);
}

.ff-stack-hint:focus-visible {
    outline: 3px solid #facc15;
    outline-offset: 3px;
}

.ff-stack-hint:active {
    scale: 0.96;
}

.ff-stack-hint--leaving {
    opacity: 0;
    filter: blur(4px);
}

.ff-station-stack-row {
    font-variant-numeric: tabular-nums;
}

@keyframes ff-stack-hint-enter {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes ff-stack-marker-highlight {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0)); }
    45% { filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.78)); }
}

.ff-station-stack-row {
    font-family: inherit;
    transition: filter 140ms ease, transform 140ms ease;
}

.ff-station-stack-row:hover {
    filter: brightness(1.08);
    position: relative;
    z-index: 2;
}

.ff-station-stack-row:focus-visible {
    outline: 3px solid #facc15;
    outline-offset: -3px;
    position: relative;
    z-index: 3;
}

.ff-station-stack-row:active {
    filter: brightness(0.94);
}

@media (prefers-reduced-motion: reduce) {
    .ff-station-stack-row,
    .ff-stack-hint {
        transition: none;
    }

    .ff-station-stack-marker--hint,
    .ff-stack-hint {
        animation: none;
    }
}

.leaflet-marker-icon.ev-charging-marker {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
}

.ff-ev-marker {
    position: relative;
    width: 56px;
    height: 70px;
    transform: translateZ(0);
}

.ff-ev-marker__glow {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translateX(-50%);
    border-radius: 16px;
    background: var(--ff-ev-glow, rgba(56, 189, 248, 0.32));
    filter: blur(8px);
    opacity: 0.9;
}

.ff-ev-marker__body {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translateX(-50%);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 45%),
        var(--ff-ev-bg, #0f766e);
    border: 2px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 18px -10px rgba(15, 23, 42, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.ff-ev-marker__glyph {
    width: 19px;
    height: 19px;
    display: block;
}

.ff-ev-marker__tail {
    position: absolute;
    top: 48px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 14px solid var(--ff-ev-tail, #0f766e);
    filter: drop-shadow(0 7px 8px rgba(15, 23, 42, 0.28));
}

.ff-ev-marker__power {
    position: absolute;
    top: 0;
    right: -1px;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    min-width: 26px;
    padding: 3px 5px 2px;
    border-radius: 999px;
    background: var(--ff-ev-chip-bg, #e0f2fe);
    color: var(--ff-ev-chip-text, #075985);
    box-shadow: 0 6px 12px -8px rgba(15, 23, 42, 0.7);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.ff-ev-marker__power-unit {
    font-size: 8px;
    font-weight: 700;
    opacity: 0.75;
}

.ff-ev-marker__connector {
    position: absolute;
    bottom: 22px;
    left: 3px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.84);
    color: #ffffff;
    font-size: 8px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 8px -6px rgba(15, 23, 42, 0.8);
}

.ff-ev-marker__points {
    position: absolute;
    right: 3px;
    bottom: 22px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ff-ev-bg, #0f766e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 4px 10px -7px rgba(15, 23, 42, 0.9);
}

.ff-ev-marker__status {
    position: absolute;
    top: 12px;
    left: 7px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.94);
}

.ff-ev-marker__stop {
    position: absolute;
    top: 4px;
    left: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 6px 12px -8px rgba(15, 23, 42, 0.85);
}

.ff-ev-marker--route {
    width: 62px;
    height: 78px;
}

.ff-ev-marker--route .ff-ev-marker__glow {
    top: 12px;
    width: 44px;
    height: 44px;
}

.ff-ev-marker--route .ff-ev-marker__body {
    top: 12px;
    width: 44px;
    height: 44px;
    border-radius: 18px;
}

.ff-ev-marker--route .ff-ev-marker__tail {
    top: 54px;
    border-left-width: 9px;
    border-right-width: 9px;
    border-top-width: 16px;
}

.ff-ev-marker--route .ff-ev-marker__connector {
    bottom: 24px;
}

.ff-ev-marker--route .ff-ev-marker__points {
    bottom: 24px;
}

.ff-ev-marker--offline .ff-ev-marker__glow {
    opacity: 0.4;
}

.ff-ev-marker--offline .ff-ev-marker__body {
    filter: saturate(0.75) brightness(0.92);
}

.ff-ev-marker--offline .ff-ev-marker__status {
    background: #ef4444;
}

/*
 * Marker children positioning:
 * The container div inside each marker already has position:relative set
 * via inline styles in createPriceRangeIcon(). Do NOT override with
 * position !important here — it interferes with Leaflet's transform-based
 * repositioning during zoom/pan animations, causing markers to drift.
 */

/* Solid color backgrounds in dark mode - no gradients */
.dark .gradient-primary {
    background: #0F766E !important; /* teal-700 */
}

.dark .gradient-accent {
    background: #EA580C !important; /* orange-600 */
}

.dark .gradient-success {
    background: #059669 !important; /* emerald-600 */
}

.dark .gradient-warning {
    background: #D97706 !important; /* amber-600 */
}

.dark .gradient-danger {
    background: #DC2626 !important; /* red-600 */
}

.dark .gradient-ev {
    background: #2563EB !important; /* blue-600 */
}

/* Fix modal backgrounds in dark mode */
.dark .fixed.inset-0.bg-black\/50 {
    background-color: rgba(0, 0, 0, 0.75) !important;
}

/* Scrollbar in dark mode */
.dark ::-webkit-scrollbar-track {
    background: rgb(30 41 59);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgb(71 85 105);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(100 116 139);
}

/* Toast notifications in dark mode */
.dark .gradient-primary,
.dark .gradient-success,
.dark .gradient-warning,
.dark .gradient-danger {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Station cards in dark mode */
.dark .group:hover {
    background-color: rgb(30 41 59) !important;
    border-color: rgb(13 148 136 / 0.5) !important; /* teal-600 */
}

/* Loading overlay in dark mode */
.dark .glass.rounded-2xl {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
}

/* Mobile sheet in dark mode */
.dark .fixed.bottom-0.glass {
    background: rgba(30, 41, 59, 0.95) !important;
    border-top: 1px solid rgba(71, 85, 105, 0.5) !important;
}

/* Settings modal in dark mode */
.dark .relative.glass.rounded-3xl {
    background: rgba(30, 41, 59, 0.98) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
}

/* ========================================
   Auth Modal - Desktop vs Mobile Responsive
   ======================================== */

/* Pro modal container and cards - Mobile only */
@media (max-width: 639px) {
    .pro-modal-shell {
        padding: 0.75rem;
    }

    .pro-modal-sheet {
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        border-radius: 2rem !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pro-mobile-card {
        border-radius: 1.75rem !important;
        border-color: transparent !important;
        overflow: hidden;
    }

    .pro-mobile-panel {
        border-radius: 1.375rem !important;
        border-color: transparent !important;
    }
}

/* Pro modal desktop difference section: force stable dark contrast */
.dark .pro-difference-section {
    background: #111827 !important;
    background-image: none !important;
    border-color: rgba(55, 65, 81, 0.95) !important;
}

.dark .pro-difference-heading {
    color: #f3f4f6 !important;
}

.dark .pro-difference-item {
    background: #1f2937 !important;
    background-image: none !important;
    border-color: rgba(55, 65, 81, 0.95) !important;
    box-shadow: none !important;
}

.dark .pro-difference-text {
    color: #f9fafb !important;
}

/* Mobile Pro CTA: force readable label and stable button surface */
.pro-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
}

.pro-mobile-cta-label {
    display: block !important;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #ffffff !important;
}

.dark .pro-mobile-cta {
    background: #0f766e !important;
}

.dark .pro-mobile-cta-label {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Auth modal container - Mobile: bottom sheet alignment */
.auth-modal-container {
    align-items: flex-end;
}

/* Auth modal card - Mobile: bottom sheet style */
.auth-modal-card {
    border-radius: 1.5rem 1.5rem 0 0; /* rounded-t-3xl */
    width: min(100%, 100vw);
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
    border: 1px solid rgba(229, 231, 235, 0.6);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.16);
}

/* Desktop styles (768px and up) */
@media (min-width: 768px) {
    .auth-modal-container {
        /* Center the modal on desktop */
        align-items: center;
        padding: 1.5rem;
    }

    .auth-modal-card {
        /* Desktop: centered card - override w-full */
        width: 28rem !important; /* 448px - good width for forms */
        max-width: 28rem !important;
        border-radius: 1rem; /* rounded-2xl */
        max-height: 85vh;
    }

    /* Hide mobile drag handle on desktop */
    .auth-modal-drag-handle {
        display: none;
    }
}

/* Large desktop (1024px and up) */
@media (min-width: 1024px) {
    .auth-modal-container {
        padding: 2rem;
    }

    .auth-modal-card {
        width: 32rem !important; /* 512px for larger screens */
        max-width: 32rem !important;
    }
}

/* Station map popup: layout and readability improvements */
.station-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgb(229 231 235);
    box-shadow: 0 14px 28px rgb(15 23 42 / 0.2);
}

.station-popup .leaflet-popup-content {
    margin: 0;
    width: 328px !important;
}

.station-popup .station-popup-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.station-popup .popup-header {
    text-align: center;
    border-bottom: 1px solid rgb(243 244 246);
    padding-bottom: 10px;
}

.station-popup .popup-price {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.station-popup .popup-price-known {
    color: rgb(5 150 105);
}

.station-popup .popup-price-closed {
    color: rgb(146 64 14);
}

.station-popup .popup-price-missing {
    color: rgb(107 114 128);
}

.station-popup .popup-fuel-label {
    margin-top: 4px;
    font-size: 11px;
    color: rgb(107 114 128);
}

.station-popup .popup-station-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.station-popup .popup-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: rgb(17 24 39);
}

.station-popup .popup-address {
    margin: 4px 0 0;
    color: rgb(75 85 99);
    font-size: 13px;
}

.station-popup .popup-status-pill {
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.station-popup .popup-status-open {
    background: rgb(220 252 231);
    color: rgb(22 101 52);
}

.station-popup .popup-status-closed {
    background: rgb(254 249 195);
    color: rgb(113 63 18);
    border-color: rgb(253 224 71);
}

.station-popup .popup-status-unknown {
    background: rgb(243 244 246);
    color: rgb(55 65 81);
}

.station-popup .popup-hours-line {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: rgb(75 85 99);
}

.station-popup .popup-hours-label {
    color: rgb(107 114 128);
    font-weight: 600;
}

.station-popup .popup-chip-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.station-popup .popup-chip {
    border-radius: 999px;
    border: 1px solid rgb(229 231 235);
    background: rgb(249 250 251);
    color: rgb(55 65 81);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.station-popup .popup-location-meta {
    margin: 8px 0 0;
    font-size: 11px;
    color: rgb(107 114 128);
}

.station-popup .popup-location-meta-fresh {
    color: rgb(5 150 105);
    font-weight: 600;
}

.station-popup .popup-location-meta-aging {
    color: rgb(217 119 6);
    font-weight: 600;
}

.station-popup .popup-location-meta-stale {
    color: rgb(220 38 38);
    font-weight: 700;
}

.station-popup .popup-location-meta-unknown {
    color: rgb(107 114 128);
}

.station-popup .popup-rating-wrap {
    margin-top: 8px;
}

.station-popup .popup-ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 50px;
    min-height: 50px;
    margin: 0 auto;
    overflow: hidden;
}

.station-popup .popup-ad-slot [data-fuse] {
    width: 300px;
    height: 50px;
    min-width: 300px;
    min-height: 50px;
    max-width: 300px;
    max-height: 50px;
    overflow: hidden;
}

.station-popup .popup-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.station-popup .popup-rating-star {
    color: rgb(245 158 11);
}

.station-popup .popup-rating-score {
    font-weight: 700;
    color: rgb(31 41 55);
}

.station-popup .popup-rating-count {
    color: rgb(107 114 128);
}

.station-popup .popup-inline-action {
    border: 0;
    background: transparent;
    color: rgb(147 51 234);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.station-popup .popup-inline-action:hover {
    text-decoration: underline;
}

.station-popup .popup-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.station-popup .popup-note {
    border-radius: 10px;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 600;
}

.station-popup .popup-note-good {
    background: rgb(240 253 244);
    color: rgb(21 128 61);
}

.station-popup .popup-note-warn {
    background: rgb(255 251 235);
    color: rgb(146 64 14);
}

.station-popup .popup-note-closed {
    background: rgb(255 251 235);
    color: rgb(120 53 15);
    border: 1px solid rgb(253 230 138);
}

.station-popup .popup-note-out-fuel {
    background: rgb(255 241 242);
    color: rgb(159 18 57);
}

.station-popup .popup-note-rank {
    background: rgb(239 246 255);
    color: rgb(30 64 175);
}

.station-popup .popup-out-fuel-panel {
    border-radius: 10px;
    border: 1px solid rgb(254 205 211);
    background: rgb(255 241 242);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.station-popup .popup-out-fuel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.station-popup .popup-out-fuel-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.station-popup .popup-out-fuel-label {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgb(190 24 93);
}

.station-popup .popup-out-fuel-count {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: rgb(159 18 57);
}

.station-popup .popup-out-fuel-meta {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: rgb(190 24 93);
}

.station-popup .popup-confidence-pill {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.station-popup .popup-confidence-none {
    background: rgb(229 231 235);
    color: rgb(55 65 81);
}

.station-popup .popup-confidence-unverified {
    background: rgb(254 215 170);
    color: rgb(154 52 18);
}

.station-popup .popup-confidence-likely {
    background: rgb(254 202 202);
    color: rgb(153 27 27);
}

.station-popup .popup-freshness-panel-fresh {
    border-color: rgb(110 231 183);
    background: rgb(255 255 255);
    box-shadow: inset 3px 0 0 rgb(5 150 105);
}

.station-popup .popup-freshness-panel-aging {
    border-color: rgb(252 211 77);
    background: rgb(255 255 255);
    box-shadow: inset 3px 0 0 rgb(217 119 6);
}

.station-popup .popup-freshness-panel-stale {
    border-color: rgb(252 165 165);
    background: rgb(255 255 255);
    box-shadow: inset 3px 0 0 rgb(220 38 38);
}

.station-popup .popup-freshness-panel-unknown {
    border-color: rgb(203 213 225);
    background: rgb(255 255 255);
    box-shadow: inset 3px 0 0 rgb(100 116 139);
}

.station-popup .popup-freshness-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgb(15 23 42);
}

.station-popup .popup-freshness-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.station-popup .popup-freshness-dot-fresh {
    background: rgb(5 150 105);
}

.station-popup .popup-freshness-dot-aging {
    background: rgb(217 119 6);
}

.station-popup .popup-freshness-dot-stale {
    background: rgb(220 38 38);
}

.station-popup .popup-freshness-dot-unknown {
    background: rgb(100 116 139);
}

.station-popup .popup-freshness-panel .popup-out-fuel-count {
    color: rgb(15 23 42);
}

.station-popup .popup-freshness-meta {
    color: rgb(51 65 85);
}

.station-popup .popup-freshness-pill-fresh {
    background: rgb(4 120 87);
    color: rgb(255 255 255);
}

.station-popup .popup-freshness-pill-aging {
    background: rgb(180 83 9);
    color: rgb(255 255 255);
}

.station-popup .popup-freshness-pill-stale {
    background: rgb(185 28 28);
    color: rgb(255 255 255);
}

.station-popup .popup-freshness-pill-unknown {
    background: rgb(71 85 105);
    color: rgb(255 255 255);
}

.station-popup .popup-out-fuel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.station-popup .popup-fuel-variant-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.station-popup .popup-fuel-variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.station-popup .popup-fuel-variant-details {
    border-top: 1px solid rgb(254 205 211);
    padding-top: 6px;
}

.station-popup .popup-fuel-variant-summary {
    font-size: 11px;
    font-weight: 700;
    color: rgb(136 19 55);
    cursor: pointer;
    list-style: none;
}

.station-popup .popup-fuel-variant-summary::-webkit-details-marker {
    display: none;
}

.station-popup .popup-fuel-variant-summary::after {
    content: ' +';
}

.station-popup .popup-fuel-variant-details[open] .popup-fuel-variant-summary::after {
    content: ' -';
}

.station-popup .popup-fuel-variant-details[open] .popup-fuel-variant-panel {
    margin-top: 6px;
}

.station-popup .popup-fuel-variant-btn {
    border: 1px solid rgb(251 113 133);
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    background: rgb(255 228 230);
    color: rgb(159 18 57);
}

.station-popup .popup-fuel-variant-btn:hover {
    background: rgb(254 205 211);
}

.station-popup .popup-out-fuel-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: rgb(225 29 72);
    color: #fff;
}

.station-popup .popup-out-fuel-btn:hover {
    background: rgb(190 24 93);
}

.station-popup .popup-out-fuel-btn:disabled,
.station-popup .popup-out-fuel-btn-reported {
    background: rgb(251 113 133);
    color: rgb(255 241 242);
    cursor: not-allowed;
}

.station-popup .popup-fuel-ok-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: rgb(5 150 105);
    color: #fff;
}

.station-popup .popup-fuel-ok-btn:hover {
    background: rgb(4 120 87);
}

.station-popup .popup-fuel-ok-btn:disabled,
.station-popup .popup-fuel-ok-btn-reported {
    background: rgb(52 211 153);
    color: rgb(236 253 245);
    cursor: not-allowed;
}

.station-popup .popup-primary-action {
    border: 0;
    border-radius: 11px;
    padding: 10px 12px;
    background: linear-gradient(90deg, rgb(16 185 129) 0%, rgb(5 150 105) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.station-popup .popup-primary-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.station-popup .popup-share-panel {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid rgb(226 232 240);
    border-radius: 12px;
    background: rgb(248 250 252);
}

.station-popup .popup-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.station-popup .popup-share-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: rgb(51 65 85);
}

.station-popup .popup-share-native-btn {
    border: 0;
    border-radius: 9999px;
    padding: 6px 10px;
    background: rgb(209 250 229);
    color: rgb(6 95 70);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.station-popup .popup-share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.station-popup .popup-share-btn {
    border: 0;
    border-radius: 9px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.station-popup .popup-share-whatsapp {
    background: rgb(37 211 102);
    color: #fff;
}

.station-popup .popup-share-facebook {
    background: rgb(37 99 235);
    color: #fff;
}

.station-popup .popup-share-x {
    background: rgb(15 23 42);
    color: #fff;
}

.station-popup .popup-share-copy {
    background: rgb(255 255 255);
    color: rgb(51 65 85);
    border: 1px solid rgb(226 232 240);
}

.station-popup .popup-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.station-popup .popup-action-btn {
    border: 0;
    border-radius: 9px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.station-popup .popup-action-report {
    background: rgb(254 242 242);
    color: rgb(185 28 28);
}

.station-popup .popup-action-rate {
    background: rgb(245 243 255);
    color: rgb(109 40 217);
}

.station-popup .popup-action-alert {
    background: rgb(255 251 235);
    color: rgb(180 83 9);
}

.dark .station-popup .leaflet-popup-content-wrapper {
    border-color: rgb(71 85 105);
    box-shadow: 0 14px 28px rgb(2 6 23 / 0.45);
}

.dark .station-popup .popup-header {
    border-bottom-color: rgb(51 65 85);
}

.dark .station-popup .popup-share-panel {
    border-color: rgb(51 65 85);
    background: rgb(15 23 42 / 0.78);
}

.dark .station-popup .popup-share-title {
    color: rgb(226 232 240);
}

.dark .station-popup .popup-share-native-btn {
    background: rgb(6 78 59);
    color: rgb(209 250 229);
}

.dark .station-popup .popup-share-copy {
    background: rgb(30 41 59);
    color: rgb(226 232 240);
    border-color: rgb(71 85 105);
}

.dark .station-popup .popup-price-missing {
    color: rgb(156 163 175);
}

.dark .station-popup .popup-price-closed {
    color: rgb(253 224 71);
}

.dark .station-popup .popup-fuel-label,
.dark .station-popup .popup-location-meta,
.dark .station-popup .popup-rating-count {
    color: rgb(148 163 184);
}

.dark .station-popup .popup-location-meta-fresh {
    color: rgb(52 211 153);
}

.dark .station-popup .popup-location-meta-aging {
    color: rgb(251 191 36);
}

.dark .station-popup .popup-location-meta-stale {
    color: rgb(252 165 165);
}

.dark .station-popup .popup-location-meta-unknown {
    color: rgb(148 163 184);
}

.dark .station-popup .popup-title {
    color: rgb(241 245 249);
}

.dark .station-popup .popup-address,
.dark .station-popup .popup-hours-line,
.dark .station-popup .popup-rating-score {
    color: rgb(203 213 225);
}

.dark .station-popup .popup-status-unknown {
    background: rgb(51 65 85);
    color: rgb(226 232 240);
}

.dark .station-popup .popup-status-closed {
    background: rgb(180 83 9 / 0.28);
    color: rgb(254 240 138);
    border-color: rgb(252 211 77 / 0.35);
}

.dark .station-popup .popup-chip {
    border-color: rgb(71 85 105);
    background: rgb(51 65 85);
    color: rgb(226 232 240);
}

.dark .station-popup .popup-note-rank {
    background: rgb(30 58 138 / 0.4);
    color: rgb(191 219 254);
}

.dark .station-popup .popup-note-good {
    background: rgb(20 83 45 / 0.45);
    color: rgb(187 247 208);
}

.dark .station-popup .popup-note-warn {
    background: rgb(120 53 15 / 0.4);
    color: rgb(254 215 170);
}

.dark .station-popup .popup-note-closed {
    background: rgb(180 83 9 / 0.22);
    color: rgb(254 215 170);
    border-color: rgb(251 191 36 / 0.28);
}

.ff-closure-pill-temporary {
    background: #fef3c7;
    color: #3b2f00;
    border: 1px solid #f59e0b;
}

.ff-closure-pill-permanent {
    background: #ffe4e6;
    color: #4c0519;
    border: 1px solid #fb7185;
}

.ff-closure-pill-generic {
    background: #e5e7eb;
    color: #111827;
    border: 1px solid #cbd5e1;
}

.ff-closure-banner-temporary {
    background: #fffbeb;
    color: #3b2f00;
    border-color: #fbbf24;
}

.ff-closure-banner-permanent {
    background: #fff1f2;
    color: #4c0519;
    border-color: #fb7185;
}

.ff-closure-banner-generic {
    background: #f8fafc;
    color: #111827;
    border-color: #cbd5e1;
}

.ff-closure-card-temporary {
    border-color: #fbbf24 !important;
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.52), rgba(255, 255, 255, 0));
}

.ff-closure-card-permanent {
    border-color: #fb7185 !important;
    background: linear-gradient(180deg, rgba(255, 228, 230, 0.5), rgba(255, 255, 255, 0));
}

.ff-closure-card-generic {
    border-color: #fca5a5 !important;
}

.ff-closure-price-temporary {
    color: #92400e;
}

.ff-closure-price-permanent {
    color: #be123c;
}

.ff-closure-price-generic {
    color: #b91c1c;
}

.ff-closure-hint-temporary {
    color: #78350f;
}

.ff-closure-hint-permanent {
    color: #881337;
}

.ff-closure-hint-generic {
    color: #991b1b;
}

.ff-closure-subtle-temporary {
    color: rgba(120, 53, 15, 0.82);
}

.ff-closure-subtle-permanent {
    color: rgba(136, 19, 55, 0.82);
}

.ff-closure-subtle-generic {
    color: rgba(153, 27, 27, 0.82);
}

.dark .ff-closure-pill-temporary {
    background: rgba(245, 158, 11, 0.28);
    color: #fffbeb;
    border-color: rgba(253, 186, 116, 0.6);
}

.dark .ff-closure-pill-permanent {
    background: rgba(225, 29, 72, 0.26);
    color: #fff1f2;
    border-color: rgba(251, 113, 133, 0.5);
}

.dark .ff-closure-pill-generic {
    background: rgba(71, 85, 105, 0.45);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.35);
}

.dark .ff-closure-banner-temporary {
    background: rgba(245, 158, 11, 0.16);
    color: #fffbeb;
    border-color: rgba(253, 186, 116, 0.45);
}

.dark .ff-closure-banner-permanent {
    background: rgba(225, 29, 72, 0.15);
    color: #fff1f2;
    border-color: rgba(251, 113, 133, 0.38);
}

.dark .ff-closure-banner-generic {
    background: rgba(71, 85, 105, 0.18);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.28);
}

.dark .ff-closure-card-temporary {
    border-color: rgba(253, 186, 116, 0.42) !important;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0));
}

.dark .ff-closure-card-permanent {
    border-color: rgba(251, 113, 133, 0.36) !important;
    background: linear-gradient(180deg, rgba(225, 29, 72, 0.11), rgba(15, 23, 42, 0));
}

.dark .ff-closure-card-generic {
    border-color: rgba(248, 113, 113, 0.3) !important;
}

.dark .ff-closure-price-temporary {
    color: #fcd34d;
}

.dark .ff-closure-price-permanent {
    color: #fda4af;
}

.dark .ff-closure-price-generic {
    color: #fca5a5;
}

.dark .ff-closure-hint-temporary {
    color: #ffedd5;
}

.dark .ff-closure-hint-permanent {
    color: #ffe4e6;
}

.dark .ff-closure-hint-generic {
    color: #fee2e2;
}

.dark .ff-closure-subtle-temporary {
    color: rgba(255, 237, 213, 0.88);
}

.dark .ff-closure-subtle-permanent {
    color: rgba(255, 228, 230, 0.88);
}

.dark .ff-closure-subtle-generic {
    color: rgba(254, 226, 226, 0.86);
}

.dark .station-popup .popup-note-out-fuel {
    background: rgb(136 19 55 / 0.4);
    color: rgb(251 207 232);
}

.dark .station-popup .popup-inline-action {
    color: rgb(196 181 253);
}

.dark .station-popup .popup-out-fuel-panel {
    border-color: rgb(159 18 57 / 0.7);
    background: rgb(136 19 55 / 0.3);
}

.dark .station-popup .popup-out-fuel-count {
    color: rgb(251 207 232);
}

.dark .station-popup .popup-out-fuel-meta {
    color: rgb(249 168 212);
}

.dark .station-popup .popup-fuel-variant-btn {
    border-color: rgb(244 63 94 / 0.7);
    background: rgb(136 19 55 / 0.35);
    color: rgb(254 205 211);
}

.dark .station-popup .popup-fuel-variant-btn:hover {
    background: rgb(159 18 57 / 0.55);
}

.dark .station-popup .popup-out-fuel-label {
    color: rgb(249 168 212);
}

.dark .station-popup .popup-fuel-variant-details {
    border-top-color: rgb(190 24 93 / 0.45);
}

.dark .station-popup .popup-fuel-variant-summary {
    color: rgb(251 207 232);
}

.dark .station-popup .popup-out-fuel-btn {
    background: rgb(244 63 94);
    color: rgb(255 241 242);
}

.dark .station-popup .popup-out-fuel-btn:hover {
    background: rgb(225 29 72);
}

.dark .station-popup .popup-out-fuel-btn:disabled,
.dark .station-popup .popup-out-fuel-btn-reported {
    background: rgb(159 18 57 / 0.6);
    color: rgb(254 205 211);
}

.dark .station-popup .popup-confidence-none {
    background: rgb(51 65 85);
    color: rgb(203 213 225);
}

.dark .station-popup .popup-freshness-panel-fresh {
    border-color: rgb(16 185 129 / 0.6);
    background: rgb(15 23 42 / 0.96);
    box-shadow: inset 3px 0 0 rgb(16 185 129);
}

.dark .station-popup .popup-freshness-panel-aging {
    border-color: rgb(245 158 11 / 0.6);
    background: rgb(15 23 42 / 0.96);
    box-shadow: inset 3px 0 0 rgb(245 158 11);
}

.dark .station-popup .popup-freshness-panel-stale {
    border-color: rgb(239 68 68 / 0.7);
    background: rgb(15 23 42 / 0.96);
    box-shadow: inset 3px 0 0 rgb(239 68 68);
}

.dark .station-popup .popup-freshness-panel-unknown {
    border-color: rgb(71 85 105 / 0.8);
    background: rgb(15 23 42 / 0.96);
    box-shadow: inset 3px 0 0 rgb(100 116 139);
}

.dark .station-popup .popup-freshness-label,
.dark .station-popup .popup-freshness-panel .popup-out-fuel-count {
    color: rgb(248 250 252);
}

.dark .station-popup .popup-freshness-dot-fresh {
    background: rgb(52 211 153);
}

.dark .station-popup .popup-freshness-dot-aging {
    background: rgb(251 191 36);
}

.dark .station-popup .popup-freshness-dot-stale {
    background: rgb(248 113 113);
}

.dark .station-popup .popup-freshness-dot-unknown {
    background: rgb(148 163 184);
}

.dark .station-popup .popup-freshness-meta {
    color: rgb(226 232 240);
}

.dark .station-popup .popup-freshness-pill-fresh {
    background: rgb(16 185 129);
    color: rgb(6 18 24);
}

.dark .station-popup .popup-freshness-pill-aging {
    background: rgb(245 158 11);
    color: rgb(6 18 24);
}

.dark .station-popup .popup-freshness-pill-stale {
    background: rgb(239 68 68);
    color: rgb(255 255 255);
}

.dark .station-popup .popup-freshness-pill-unknown {
    background: rgb(100 116 139);
    color: rgb(255 255 255);
}

.dark .station-popup .popup-confidence-unverified {
    background: rgb(154 52 18 / 0.45);
    color: rgb(254 215 170);
}

.dark .station-popup .popup-confidence-likely {
    background: rgb(127 29 29 / 0.5);
    color: rgb(254 202 202);
}

.dark .station-popup .popup-fuel-ok-btn {
    background: rgb(16 185 129);
    color: rgb(236 253 245);
}

.dark .station-popup .popup-fuel-ok-btn:hover {
    background: rgb(5 150 105);
}

.dark .station-popup .popup-fuel-ok-btn:disabled,
.dark .station-popup .popup-fuel-ok-btn-reported {
    background: rgb(4 120 87 / 0.65);
    color: rgb(167 243 208);
}

.dark .station-popup .popup-action-report {
    background: rgb(127 29 29 / 0.35);
    color: rgb(252 165 165);
}

.dark .station-popup .popup-action-rate {
    background: rgb(76 29 149 / 0.35);
    color: rgb(221 214 254);
}

.dark .station-popup .popup-action-alert {
    background: rgb(120 53 15 / 0.35);
    color: rgb(253 186 116);
}

@media (max-width: 640px) {
    .station-popup .leaflet-popup-content {
        width: 292px !important;
    }

    .station-popup .station-popup-content {
        gap: 9px;
        padding: 12px;
    }

    .station-popup .popup-header {
        padding-bottom: 8px;
    }

    .station-popup .popup-price {
        font-size: 1.8rem;
    }

    .station-popup .popup-station-head {
        flex-direction: column;
        gap: 4px;
    }

    .station-popup .popup-status-pill {
        align-self: flex-start;
    }

    .station-popup .popup-out-fuel-panel {
        padding: 7px;
        gap: 6px;
    }

    .station-popup .popup-out-fuel-header {
        flex-direction: column;
        gap: 5px;
    }

    .station-popup .popup-confidence-pill {
        align-self: flex-start;
    }

    .station-popup .popup-out-fuel-actions {
        grid-template-columns: 1fr;
    }

    .station-popup .popup-out-fuel-btn,
    .station-popup .popup-fuel-ok-btn {
        min-height: 40px;
        padding: 9px 10px;
    }

    .station-popup .popup-fuel-variant-details {
        padding-top: 5px;
    }

    .station-popup .popup-fuel-variant-summary {
        display: block;
        min-height: 32px;
        padding: 2px 0;
    }

    .station-popup .popup-fuel-variant-list {
        flex-direction: column;
    }

    .station-popup .popup-fuel-variant-btn {
        width: 100%;
        min-height: 36px;
        text-align: left;
    }
}

/* Keep a conservative pre-render fallback for the standard Publift slot.
   publift.js replaces it with the visible occupied height for both the normal
   footer and independently injected provider surfaces such as Seedtag. */
@media (min-width: 728px) and (max-width: 1023px) {
    body.ff-mobile-footer-ad-space {
        /* Override the inline phone fallback before a live height is measured. */
        --ff-mobile-footer-ad-height: 90px !important;
    }
}

.ff-station-detail-browse-content {
    transition:
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ff-station-detail-browse-content[data-browse-direction="-1"] {
    opacity: 0.72;
    transform: translate3d(-14px, 0, 0);
}

.ff-station-detail-browse-content[data-browse-direction="1"] {
    opacity: 0.72;
    transform: translate3d(14px, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
    .ff-station-detail-browse-content {
        transition: none;
    }

    .ff-station-detail-browse-content[data-browse-direction] {
        opacity: 1;
        transform: none;
    }
}
