/**
 * ANUNAKI Popup Styles v2.0.0
 * Matches React MapPopup.tsx preview exactly
 */

:root {
    --ank-orange: #8b5cf6;
    --ank-amber:  #a78bfa;
    --ank-violet: #8b5cf6;
    --ank-violet-light: #a78bfa;
    --ank-violet-deep:  #7c3aed;
    --ank-violet-50:    #f5f3ff;
    --ank-violet-100:   #ede9fe;
    --ank-violet-200:   #ddd6fe;
    --ank-slate-50: #f8fafc;
    --ank-slate-100: #f1f5f9;
    --ank-slate-200: #e2e8f0;
    --ank-slate-400: #94a3b8;
    --ank-slate-500: #64748b;
    --ank-slate-900: #0f172a;
}

/* Reset for WP themes */
.ank-overlay *, .ank-overlay *::before, .ank-overlay *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══ OVERLAY ═══ */
.ank-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    animation: ankFadeIn 0.25s ease;
    will-change: opacity;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
}
.ank-overlay.ank-closing { animation: ankFadeOut 0.3s ease forwards; }
@keyframes ankFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes ankFadeOut { from { opacity: 1 } to { opacity: 0 } }

.ank-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ═══ CONTAINER ═══ */
.ank-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    max-height: 92vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ankSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}
@keyframes ankSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ HEADER ═══ */
.ank-header {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #ddd6fe;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 1000;
    position: relative;
}

/* Header top row */
.ank-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
}

/* Logo */
.ank-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ank-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139,92,246,0.25);
}
.ank-logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
    fill: none;
    stroke: white;
    stroke-width: 2;
}
.ank-logo-text-wrap {
    display: none;
}
@media (min-width: 640px) {
    .ank-logo-text-wrap { display: block; }
}
.ank-logo-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--ank-slate-900);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.ank-logo-title span { color: var(--ank-orange); }
.ank-logo-subtitle {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ank-slate-400);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ank-logo-subtitle img {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: inline-block;
    vertical-align: middle;
}

/* Search bar in header */
.ank-search-wrap {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 512px;
    margin: 0 auto;
    position: relative;
}
.ank-search-field {
    position: relative;
    flex-grow: 1;
}
.ank-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ank-slate-400);
    pointer-events: none;
}
.ank-search-input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 2px solid var(--ank-slate-200);
    border-radius: 12px;
    background: rgba(248,250,252,0.8);
    font-size: 14px;
    font-weight: 500;
    color: var(--ank-slate-900);
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.ank-search-input::placeholder { color: var(--ank-slate-400); }
.ank-search-input:focus {
    border-color: var(--ank-violet);
    background: #fff;
    box-shadow: 0 4px 12px rgba(139,92,246,0.12);
}
.ank-search-btn {
    height: 40px;
    padding: 0 18px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(139,92,246,0.25);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.ank-search-btn svg { width: 15px; height: 15px; stroke: white; fill: none; flex-shrink: 0; }
.ank-search-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 6px 16px rgba(139,92,246,0.35);
}
.ank-search-btn:active { transform: scale(0.95); }

/* Search results dropdown */
.ank-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 1px solid var(--ank-slate-200);
    overflow: hidden;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    z-index: 1100;
    animation: ankDropdown 0.15s ease;
    display: none;
}
.ank-search-results.active { display: block; }
@keyframes ankDropdown {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ank-search-results-header {
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--ank-slate-50), rgba(237,233,254,0.4));
    border-bottom: 1px solid var(--ank-slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ank-search-results-header span:first-child {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ank-slate-400);
}
.ank-search-results-count {
    font-size: 10px;
    font-weight: 900;
    color: var(--ank-violet);
    background: #f5f3ff;
    padding: 2px 8px;
    border-radius: 999px;
}
/* ── Exact locker ID match — golden pulse (first result when query is a locker ID) ── */
@keyframes ank-locker-pulse {
    0%, 100% {
        background: linear-gradient(90deg, rgba(254,204,1,0.15) 0%, rgba(254,204,1,0.04) 70%);
        box-shadow: inset 3px 0 0 #FECC01, 0 2px 10px rgba(254,204,1,0.18);
    }
    50% {
        background: linear-gradient(90deg, rgba(254,204,1,0.28) 0%, rgba(254,204,1,0.08) 70%);
        box-shadow: inset 3px 0 0 #f59e0b, 0 4px 20px rgba(254,204,1,0.35);
    }
}
.ank-result-locker-match {
    animation: ank-locker-pulse 2s ease-in-out infinite;
    border-radius: 0 10px 10px 0 !important;
    overflow: hidden;
    padding-left: 14px !important;
}
.ank-result-locker-match .ank-result-name {
    color: #78350f !important;
    font-weight: 900;
}

/* ── Checkbox — classic square, LEFT side of result row ── */
@keyframes ank-chk-invite {
    0%   { transform: scale(1.0);  box-shadow: 0 0 0 0 var(--chk-color, #6366f1); }
    50%  { transform: scale(1.15); box-shadow: 0 0 0 4px transparent; }
    100% { transform: scale(1.0);  box-shadow: 0 0 0 0 var(--chk-color, #6366f1); }
}
.ank-result-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--chk-color, #6366f1);
    border-radius: 5px;
    background: transparent;
    color: var(--chk-color, #6366f1);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.ank-result-check:hover {
    background: var(--chk-color, #6366f1);
    color: #fff;
    border-color: var(--chk-stroke, #4f46e5);
    animation: ank-chk-invite 0.55s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.ank-check-icon {
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
}
.ank-result-check:hover .ank-check-icon { opacity: 1; color: #fff; }

/* ── KASAMUKA badge in header logo ── */
.ank-kasamuka-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #7c3aed;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    border-radius: 5px;
    padding: 1px 6px;
    vertical-align: middle;
    text-transform: uppercase;
    position: relative;
    top: -2px;
}


/* ── Ticker bar — seamless scrolling chips between flags and map ── */
.ank-ticker-bar {
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(90deg, #3b0764, #6d28d9 35%, #7c3aed 65%, #3b0764);
    border-top: 1px solid rgba(139,92,246,0.4);
    border-bottom: 1px solid rgba(0,0,0,0.15);
    color: #f0e6ff;
    height: 40px;
    display: flex;
    align-items: center;
    user-select: none;
    flex-shrink: 0;
}
.ank-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: ank-ticker-scroll 100s linear infinite;
}
.ank-ticker-track:hover { animation-play-state: paused; }
/* Each message = one chip: emoji + text, with generous side padding */
.ank-ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 32px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15px;
}
.ank-ticker-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
/* Diamond separator between chips — muted so it doesn't compete with text */
.ank-ticker-sep {
    display: inline-block;
    font-size: 7px;
    color: rgba(255,255,255,0.28);
    flex-shrink: 0;
}
@keyframes ank-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.ank-result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px 12px 15px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--ank-slate-50);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
}
/* Carrier color bar — left edge, rounded right side (pill-style) */
.ank-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--ank-bar-color, #8b5cf6);
    border-radius: 0 4px 4px 0;
    pointer-events: none;
}
.ank-result-item:last-child { border-bottom: none; }
.ank-result-item:hover { background: #f5f3ff; }
.ank-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s;
}
.ank-result-item:hover .ank-result-icon { background: #ddd6fe; }
.ank-result-icon svg { width: 16px; height: 16px; stroke: #7c3aed; fill: none; stroke-width: 2; }
.ank-result-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ank-slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}
.ank-result-item:hover .ank-result-name { color: #6d28d9; }
.ank-result-addr {
    font-size: 12px;
    color: var(--ank-slate-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 1px;
}
.ank-result-city  { font-weight: 600; color: #374151; }
.ank-result-postal { color: #6b7280; font-size: 11px; }
.ank-result-street {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.ank-result-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    opacity: 0.85;
}
.ank-result-carrier-tag {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-top: 1px;
    opacity: 0.75;
}

/* Close button */
.ank-close-btn {
    width: 40px;
    height: 40px;
    background: var(--ank-slate-100);
    border: none;
    border-radius: 12px;
    color: var(--ank-slate-500);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.ank-close-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}
.ank-close-btn:active { transform: scale(0.9); }


/* ═══ FLAGS BAR ═══ */
.ank-flags-container {
    position: relative;
    background: #fff;
}


.ank-flags {
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px 8px;
    background: #fff;
    flex-wrap: wrap;
}

.ank-flag-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--ank-slate-200);
    background: var(--ank-slate-50);
    color: var(--ank-slate-500);
    font-family: inherit;
}
.ank-flag-btn:hover {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}
.ank-flag-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139,92,246,0.25);
    transform: scale(1.05);
}
/* Locked country flag (FREE plan — upgrade to PRO) */
.ank-flag-btn.ank-flag-locked {
    opacity: 0.45;
    filter: grayscale(0.7);
    position: relative;
    cursor: pointer;
}
.ank-flag-btn.ank-flag-locked:hover { opacity: 0.7; filter: grayscale(0.3); }
.ank-flag-lock {
    font-size: 7px;
    font-weight: 800;
    color: #fff;
    background: #7c3aed;
    border-radius: 3px;
    padding: 1px 3px;
    line-height: 1;
    letter-spacing: 0.05em;
}
/* Upgrade toast */
.ps-upgrade-toast {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: opacity 0.4s;
    text-align: center;
    max-width: 340px;
}
.ank-flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.ank-flag-name { display: inline; }

/* ═══ MAP BODY ═══ */
.ank-body {
    flex: 1;
    position: relative;
    min-height: 0;
}
.ank-map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* ═══ CLUSTER ICONS ═══ */
.custom-cluster-icon,
.ank-cluster-icon,
.ps-sun-cluster-icon {
    background: none !important;
    border: none !important;
    overflow: visible !important;
    will-change: transform;
}

/* ═══ SUN CLUSTER — ANIMATIONS ═══ */

/* Shared keyframes */
@keyframes ps-ring-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes ps-center-breathe {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.18)); }
    50%       { transform: scale(1.08); filter: drop-shadow(0 3px 12px rgba(0,0,0,0.28)); }
}

/*
 * Market-share donut ring — slow clockwise rotation gives "live radar" feel.
 * transform-origin matches SVG center: cx=48, cy=48 (sz=96).
 * Proportional colored segments per carrier — each cluster looks unique.
 */
.ps-donut-g {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: ps-ring-spin 7s linear infinite;
}
.ps-sun-cluster-icon:hover .ps-donut-g {
    animation-duration: 1.8s;
}

/*
 * Center bubble — subtle breathing pulse (scale around element center).
 */
.ps-center-bubble {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: ps-center-breathe 3s ease-in-out infinite;
}
.ps-sun-cluster-icon:hover .ps-center-bubble {
    animation-duration: 1.2s;
}

/* Cluster glow on hover — filter on wrapper div is fine.
 * Scale MUST be on inner SVG — Leaflet uses wrapper's transform for positioning,
 * so CSS transform on wrapper conflicts with its inline style. */
.ps-sun-cluster-icon {
    transition: filter 0.3s ease;
}
.ps-sun-cluster-icon:hover {
    filter: drop-shadow(0 0 16px rgba(254,204,1,0.7));
}
/* Scale the ENTIRE wrapper div (SVG + logo overlays together).
 * Previous: only SVG scaled → logos stayed at old positions = "eyes falling out".
 * Now: wrapper div scales → SVG + logos move as one unit. */
.ps-sun-cluster-icon > div {
    transition: transform 0.3s ease-out;
    transform-origin: 50% 50%;
}
.ps-sun-cluster-icon:hover > div {
    transform: scale(1.10);
}

/* Cluster pop on click — burst then fade */
@keyframes ps-cluster-pop {
    0%   { transform: scale(1);    opacity: 1; }
    35%  { transform: scale(1.35); opacity: 0.9; }
    70%  { transform: scale(0.88); opacity: 0.6; }
    100% { transform: scale(1.0);  opacity: 0; }
}
.ps-cluster-clicked {
    pointer-events: none;
}
.ps-cluster-clicked svg {
    animation: ps-cluster-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: 50% 50%;
}

/* ═══ CARRIER MARKER PIN ═══ */
/* Hover/animations → inner wrapper div (contains SVG + logo overlay together).
 * Leaflet puts translate3d on the outer .ps-carrier-pin-icon — we animate the
 * child div so BOTH the teardrop SVG and the logo image move as one unit.
 *
 * ANTI-TREMBLE: pointer-events:none on inner div prevents hover flicker when
 * the pin lifts away from cursor. Hover is detected on the OUTER container
 * (stable position) while the INNER div animates freely without retriggering. */
.ps-carrier-pin-icon {
    background: none !important;
    border: none !important;
    overflow: visible !important;
    /* No padding — prevents overlap with adjacent pins */
}
/* Pin hover: scale from bottom center, NO translateY.
 * translateY moves pin AWAY from cursor → hover toggles on/off = tremble loop.
 * Scale-only keeps pin anchored under cursor = stable hover. */
.ps-carrier-pin-icon > div {
    transform-origin: 50% 100%;
    transition: transform 0.25s ease-out, filter 0.25s ease-out;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.ps-carrier-pin-icon:hover > div {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}

/* ═══ MARKER ICON ═══ */
.locker-marker-icon,
.ank-marker-icon {
    background: none !important;
    border: none !important;
}

/* ═══ STATUS BAR (bottom-left) ═══ */
.ank-status-bar {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    border: 1px solid var(--ank-slate-200);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-size: 13px;
    font-weight: 600;
    color: var(--ank-slate-900);
}
.ank-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.ank-status-dot.loading {
    background: var(--ank-violet);
    animation: ankPulse 1s ease-in-out infinite;
}
@keyframes ankPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ═══ POINT DETAIL PANEL ═══ */
/* Panel grows from small scale → full size, creating "emerges from pin" feeling */
@keyframes ps-panel-emerge {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); }
}
.ank-detail-panel {
    position: absolute;
    bottom: 10px;
    right: 10px;
    left: auto;
    max-width: 380px;
    z-index: 1200;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform-origin: bottom right;
    animation: ps-panel-emerge 0.4s ease-out forwards;
    overflow: hidden;
    animation: ankPanelIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ankPanelIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ank-detail-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}
.ank-detail-header h3 {
    font-size: 18px;
    font-weight: 900;
    margin: 0;
}
.ank-detail-header p {
    font-size: 13px;
    opacity: 0.85;
    margin: 4px 0 0;
    font-weight: 500;
}
.ank-detail-body {
    padding: 12px 20px;
}
.ank-status-row-multi {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    position: relative;
}
.ank-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ank-slate-100);
    font-size: 13px;
    color: var(--ank-slate-900);
}
.ank-detail-row.small {
    border-bottom: none;
    padding: 0;
}
.ank-btn-cancel-inline {
    margin-left: auto;
    background: var(--ank-slate-100);
    color: var(--ank-slate-500);
    border: none;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.ank-btn-cancel-inline:hover { background: var(--ank-slate-200); color: var(--ank-slate-900); }
.ank-detail-row:last-child { border-bottom: none; }
.ank-detail-row .icon { font-size: 16px; flex-shrink: 0; }
.ank-detail-row .name {
    font-weight: 900;
    color: var(--ank-orange);
    font-size: 15px;
}
.ank-detail-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    align-items: center;
}
.ank-btn-confirm {
    flex: 1;
    height: 36px;
    font-size: 13px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(139,92,246,0.3);
}
.ank-btn-confirm:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(139,92,246,0.45), 0 0 0 2px rgba(139,92,246,0.12);
}
.ank-btn-confirm:active { transform: scale(0.93); transition-duration: 0.1s; }

/* Post-dangle button pulse — draws attention after the 550ms pin dangle ends */
@keyframes ank-btn-attract {
    0%   { transform: scale(1);    box-shadow: 0 4px 12px rgba(139,92,246,0.30); }
    15%  { transform: scale(1.06); box-shadow: 0 8px 24px rgba(139,92,246,0.50); }
    50%  { transform: scale(1.08); box-shadow: 0 10px 28px rgba(139,92,246,0.55), 0 0 0 4px rgba(139,92,246,0.10); }
    85%  { transform: scale(1.05); box-shadow: 0 8px 20px rgba(139,92,246,0.45); }
    100% { transform: scale(1);    box-shadow: 0 4px 12px rgba(139,92,246,0.30); }
}
.ank-btn-attract {
    animation: ank-btn-attract 0.9s ease-in-out 2 !important;
    transition: none !important;
}

@keyframes ank-btn-anticipation {
    0%, 100% { box-shadow: 0 10px 28px rgba(139,92,246,0.55), 0 0 0 3px rgba(139,92,246,0.18); }
    50%       { box-shadow: 0 14px 36px rgba(139,92,246,0.75), 0 0 0 7px rgba(139,92,246,0.08); }
}

/* ── Detail panel — carrier badge, copy, selectable text ── */
.ank-detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.ank-carrier-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    margin-top: 2px;
    opacity: 0.92;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
/* Carrier pin in detail panel header — natural pin size (overrides legend scale) */
.ank-detail-pin {
    width: 38px;
    height: 48px;
    flex-shrink: 0;
    margin-top: 2px;
}
.ank-detail-pin .ps-legend-pin-inner {
    transform: scale(1);
    transform-origin: top left;
}

/* Text in detail rows — explicitly selectable & copyable */
.ank-detail-copyable {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    flex: 1;
    word-break: break-word;
}
/* Inline copy icon button (small) */
.ank-copy-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--ank-slate-400);
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.ank-copy-btn:hover { color: var(--ank-orange); }
/* Copy-all button in actions bar */
.ank-copy-all-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 14px;
    background: var(--ank-slate-100);
    color: var(--ank-slate-500);
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ank-copy-all-btn:hover { background: var(--ank-slate-200); color: var(--ank-slate-900); }

/* ── Hover tooltip on pin — białe okienko z pinem spedytora ── */
.ank-tooltip.leaflet-tooltip {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    pointer-events: none;  /* tooltip must not steal hover from pins below */
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
    font-family: system-ui, sans-serif;
    pointer-events: none;
    max-width: 260px;
    min-width: 140px;
    white-space: normal !important;
    word-wrap: break-word;
    word-break: break-word;
}
.ank-tooltip.leaflet-tooltip::before { border-top-color: #ffffff; }
.ank-tooltip.leaflet-tooltip-bottom::before { border-bottom-color: #ffffff; border-top-color: transparent; }
/* Tooltip — nagłówek: mini pin + flaga + nazwa */
.ank-tt-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
}
/* Real carrier branded pin in tooltip — scaled version of buildCarrierPinSVG output */
.ank-tt-pin-wrap {
    width: 24px;
    height: 30px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
}
.ank-tt-pin-inner {
    transform: scale(0.63);
    transform-origin: 0 0;
    pointer-events: none;
}
.ank-tt-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.ank-tt-flag-img {
    width: 18px;
    height: auto;
    border-radius: 2px;
    flex-shrink: 0;
    display: block;
}
/* Tooltip — adres */
.ank-tt-body {
    padding: 6px 12px 9px;
}
.ank-tt-addr {
    font-size: 11px;
    color: #64748b;
    line-height: 1.45;
    white-space: normal;
}
.ank-btn-cancel {
    height: 44px;
    padding: 0 16px;
    background: var(--ank-slate-100);
    color: var(--ank-slate-500);
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.ank-btn-cancel:hover { background: var(--ank-slate-200); color: var(--ank-slate-900); }

/* ═══ PIN SELECTION — orange glow on wrapper + 3× scale pulse on SVG ═══ */
@keyframes ps-pin-glow {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }
    50%       { filter: drop-shadow(0 0 20px rgba(139,92,246,0.9)) drop-shadow(0 0 40px rgba(139,92,246,0.4)); }
}
.ps-pin-selected {
    animation: ps-pin-glow 2.5s ease-in-out infinite !important;
    z-index: 1000 !important;
}
/* Grow-shrink pulse — 1.45× (safe: won't overflow leaflet-container clip). */
@keyframes ps-pin-selected-pulse {
    0%, 100% { transform: scale(1); }
    40%      { transform: scale(1.45); }
    60%      { transform: scale(1.38); }
}
.ps-pin-selected > div {
    transform-origin: 50% 100% !important;
    transition: none !important;                                        /* disable hover transition while animating */
    animation: ps-pin-selected-pulse 2s ease-in-out infinite !important;
}

/* ═══ PIN CLICK — ping-pong wobble on select ═══
 * Pure rotation anchored at pin TIP (50% 100%) — logo stays inside the pin.
 * No translateX: moving the SVG off its map anchor made the logo "uciekać" (fly away).
 */
@keyframes ps-pin-pingpong {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(20deg); }
    35%  { transform: rotate(-15deg); }
    52%  { transform: rotate(10deg); }
    68%  { transform: rotate(-5deg); }
    82%  { transform: rotate(2.5deg); }
    100% { transform: rotate(0deg); }
}
/* Ping-pong briefly overrides pulse (later source order wins among !important rules) */
.ps-pin-jumped > div {
    transform-origin: 50% 100% !important;
    animation: ps-pin-pingpong 0.72s cubic-bezier(0.36,0.07,0.19,0.97) 1 !important;
}

/* ═══ PIN DANGLE — on "Wybierz" confirm (the "Płenta" moment) ═══ */
/* Dramatic pendulum: big first launch → decay → settle. Peak at ~8% = confetti cue. */
@keyframes ps-pin-dangle {
    0%   { transform: rotate(0deg)   scale(1); }
    8%   { transform: rotate(40deg)  scale(1.24); }  /* BIG launch — peak swing */
    22%  { transform: rotate(-32deg) scale(1.14); }
    36%  { transform: rotate(24deg)  scale(1.08); }
    50%  { transform: rotate(-16deg) scale(1.04); }
    62%  { transform: rotate(9deg); }
    73%  { transform: rotate(-5deg); }
    83%  { transform: rotate(2.5deg); }
    91%  { transform: rotate(-1deg); }
    100% { transform: rotate(0deg)   scale(1); }
}
.ps-pin-dangle > div {
    transform-origin: 50% 100% !important;
    transition: none !important;
    animation: ps-pin-dangle 2.1s cubic-bezier(0.36,0.07,0.19,0.97) 1 !important;
}

/* ═══ PIN DANGLE-CLICK — fast 550ms dangle triggered on marker click ═══ */
.ps-pin-dangle-click > div {
    transform-origin: 50% 100% !important;
    transition: none !important;
    animation: ps-pin-dangle 0.55s cubic-bezier(0.36,0.07,0.19,0.97) 1 !important;
}

/* ═══ PIN GROW — after dangle, pin grows smoothly to 1.5× (550-1400ms) ═══
 * Uses highest specificity to override ps-pin-selected pulse animation.
 * The pin MUST visually grow — this is the eye-tracking bridge to the panel. */
@keyframes ps-pin-grow {
    0%   { transform: scale(1); filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }
    100% { transform: scale(1.5); filter: drop-shadow(0 0 24px rgba(139,92,246,0.8)) drop-shadow(0 4px 16px rgba(0,0,0,0.4)); }
}
.ps-pin-growing.ps-pin-selected > div {
    transform-origin: 50% 100% !important;
    transition: none !important;
    animation: ps-pin-grow 0.85s ease-in-out forwards !important;
}
.ps-pin-growing.ps-pin-selected {
    animation: none !important;
    z-index: 2000 !important;
}

/* ═══ DETAIL PANEL PIN — spring bounce entrance ═══ */
@keyframes ps-detail-pin-spring {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.8); opacity: 1; }
    75%  { transform: scale(1.5); }
    90%  { transform: scale(1.65); }
    100% { transform: scale(1.6); }
}
.ps-detail-pin-anim {
    animation: ps-detail-pin-spring 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ═══ PIN CONFIRMED — unmistakable green glow + ripple at pin tip ═══ */
/* Tight green glow: ~1mm (4px) solid → ~2mm (8px) fading → ~3mm (11px) edge.
 * Stacked drop-shadows build up density at the pin edge and fade outward. */
@keyframes ps-pin-confirmed-glow {
    0%, 100% {
        filter: drop-shadow(0 0 1px #22c55e)
                drop-shadow(0 0 3px rgba(34,197,94,0.85))
                drop-shadow(0 0 6px rgba(34,197,94,0.45))
                drop-shadow(0 0 9px rgba(34,197,94,0.15));
    }
    50% {
        filter: drop-shadow(0 0 1px #22c55e)
                drop-shadow(0 0 4px rgba(34,197,94,0.9))
                drop-shadow(0 0 7px rgba(34,197,94,0.5))
                drop-shadow(0 0 11px rgba(34,197,94,0.2));
    }
}
@keyframes ps-pin-ripple {
    0%   { transform: scale(0.4); opacity: 0.85; }
    100% { transform: scale(5.0); opacity: 0; }
}
.ps-pin-confirmed {
    animation: ps-pin-confirmed-glow 2s ease-in-out infinite !important;
    z-index: 1001 !important;
}
/* Ripple rings centered at pin tip (anchor ~23px from left, ~52px from top for 46px icon) */
.ps-pin-confirmed::before,
.ps-pin-confirmed::after {
    content: '';
    position: absolute;
    left: 23px; top: 52px;
    width: 24px; height: 24px;
    margin-left: -12px; margin-top: -12px;
    border-radius: 50%;
    background: rgba(34,197,94,0.65);
    pointer-events: none;
    animation: ps-pin-ripple 2s ease-out infinite;
}
.ps-pin-confirmed::after { animation-delay: 1s; }

/* ═══ PIN FINALE — Elegant WOW celebration on "WYBIERZ" confirm ═══
 * Architecture: .ps-finale-container (inset:0, z-990) wraps:
 *   - .ps-pin-finale-wrap: pin icon, springs to 2.5×, settles to infinite gentle bob
 *   - .ps-finale-ring ×2: thin expanding ring outlines from pin tip (sophisticated)
 *
 * Timeline:
 *   t=0ms    — pin materialises (opacity 0→1, scale 0.3→2.5) spring rise
 *   t≈390ms  — peak 2.5× (synced with confetti burst)
 *   t=1550ms — burst settles, class switch to infinite ps-pin-celebrate loop
 *   t=close  — container removed by _clearDetailPanel or widget close
 */

/* Phase 1 — burst spring rise to 2.5×, elegant multi-swing decay to 1.22× */
@keyframes ps-pin-burst {
    0%   { transform: scale(0.3)  rotate(0deg);    opacity: 0; filter: none; }
    7%   { opacity: 1; }
    26%  { transform: scale(2.5)  rotate(-8deg);   filter: drop-shadow(0 0 16px rgba(34,197,94,.90)) drop-shadow(0 0 36px rgba(34,197,94,.38)); }
    40%  { transform: scale(2.0)  rotate(7deg);    filter: drop-shadow(0 0 12px rgba(34,197,94,.85)); }
    54%  { transform: scale(1.6)  rotate(-5deg);   filter: drop-shadow(0 0 10px rgba(34,197,94,.80)); }
    66%  { transform: scale(1.38) rotate(3deg);    filter: drop-shadow(0 0 10px rgba(34,197,94,.80)); }
    76%  { transform: scale(1.28) rotate(-1.5deg); filter: drop-shadow(0 0 9px  rgba(34,197,94,.78)); }
    86%  { transform: scale(1.23) rotate(0.5deg);  filter: drop-shadow(0 0 9px  rgba(34,197,94,.76)); }
    100% { transform: scale(1.22) rotate(0deg);    filter: drop-shadow(0 0 9px  rgba(34,197,94,.76)); }
}

/* Phase 2 — infinite gentle celebration bob (starts/ends same state = seamless loop) */
@keyframes ps-pin-celebrate {
    0%   { transform: rotate(0deg)  scale(1.22); filter: drop-shadow(0 0 8px  rgba(34,197,94,.72)); }
    22%  { transform: rotate(-5deg) scale(1.30); filter: drop-shadow(0 0 10px rgba(34,197,94,.80)); }
    45%  { transform: rotate(5deg)  scale(1.38); filter: drop-shadow(0 0 14px rgba(34,197,94,.90)) drop-shadow(0 0 28px rgba(34,197,94,.32)); }
    70%  { transform: rotate(-4deg) scale(1.28); filter: drop-shadow(0 0 11px rgba(34,197,94,.82)); }
    100% { transform: rotate(0deg)  scale(1.22); filter: drop-shadow(0 0 8px  rgba(34,197,94,.72)); }
}

/* Ring ripple — thin outline expands from pin tip, two rings staggered */
@keyframes ps-finale-ring-expand {
    0%   { transform: scale(0.2); opacity: 0.80; border-width: 2.5px; }
    55%  { opacity: 0.40; border-width: 1.5px; }
    100% { transform: scale(7);   opacity: 0;    border-width: 0.5px; }
}

.ps-finale-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 990;
    overflow: visible;
}

/* Pin wrapper — transform-origin at pin tip (bottom-centre of 38×48 icon) */
.ps-pin-finale-wrap {
    position: absolute;
    width: 38px;
    height: 48px;
    pointer-events: none;
    transform-origin: 19px 48px;
    animation: ps-pin-burst 1.5s cubic-bezier(0.34, 1.28, 0.64, 1) 1 forwards;
}
.ps-pin-finale-wrap.ps-pin-finale-loop {
    animation: ps-pin-celebrate 1.6s ease-in-out infinite;
}

/* Thin ring outline — positioned at pin tip coordinates set inline by JS */
.ps-finale-ring {
    position: absolute;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border-radius: 50%;
    border: 2.5px solid rgba(34, 197, 94, 0.72);
    background: transparent;
    pointer-events: none;
    animation: ps-finale-ring-expand 2.4s ease-out infinite;
    animation-delay: 0.6s;
}
.ps-finale-ring.ps-finale-ring-2 {
    animation-delay: 1.8s;
}

/* ═══ PIN DROP — co-located pins (multiple carriers same GPS) fall from above ═══
 * Signals to user: "something is hidden underneath this pin".
 * Each co-located pin has --ps-drop-delay set by JS (0ms, 90ms, 180ms…).
 * fill-mode:both hides pin before drop starts (opacity 0 at 0%).
 */
@keyframes ps-pin-drop {
    0%   { transform: translateY(-38px) scale(0.5); opacity: 0; }
    55%  { transform: translateY(5px)   scale(1.07); opacity: 1; }
    78%  { transform: translateY(-3px)  scale(0.97); opacity: 1; }
    100% { transform: translateY(0)     scale(1);    opacity: 1; }
}
.ps-pin-drop > div {
    transform-origin: 50% 50% !important;
    animation-name: ps-pin-drop !important;
    animation-duration: 0.5s !important;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
    animation-delay: var(--ps-drop-delay, 0ms) !important;
    animation-iteration-count: 1 !important;
    animation-fill-mode: both !important;
}

/* ═══ CONFETTI ═══ */
.ank-confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 975;
}
@keyframes ankConfettiBurst {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1.3); opacity: 1; }
    18%  { opacity: 1; }
    55%  { opacity: 0.9; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.1); opacity: 0; }
}
/* Legacy fallback */
@keyframes ankConfettiFall {
    0% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 1; }
    20% { opacity: 1; }
    100% { transform: translateY(400px) translateX(var(--drift, 100px)) rotate(var(--rot, 360deg)) scale(0.3); opacity: 0; }
}

/* ═══ CONFIRMED OVERLAY ═══ */
.ank-confirmed-overlay {
    position: absolute;
    inset: 0;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    background: transparent;
    animation: ankFadeIn 0.3s ease;
    padding: 32px;
    pointer-events: none;
}
@media (max-width: 768px) {
    .ank-confirmed-overlay {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }
}

/* Success card — light glassmorphism green */
.ank-success-card {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(34,197,94,0.25);
    border-radius: 24px;
    padding: 32px 32px 24px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow:
        0 24px 64px rgba(0,0,0,0.12),
        0 0 0 1px rgba(34,197,94,0.08),
        0 8px 32px rgba(34,197,94,0.1);
    animation: ankSuccessCardIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    z-index: 10005;
    pointer-events: auto;
}
/* Spring bounce-in from below: rises UP with overshoot → settles. Like a celebration jump. */
@keyframes ankSuccessCardIn {
    0%   { opacity: 0; transform: translateY(56px) scale(0.82); }
    55%  { opacity: 1; transform: translateY(-12px) scale(1.04); }
    78%  { transform: translateY(6px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.ank-success-check-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.ank-confirmed-check {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(34,197,94,0.35), 0 0 48px rgba(34,197,94,0.15);
    animation: ankBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ankBounceIn {
    from { transform: scale(0) rotate(-20deg); }
    60%  { transform: scale(1.15) rotate(4deg); }
    to   { transform: scale(1) rotate(0deg); }
}
.ank-confirmed-check svg { width: 34px; height: 34px; stroke: white; fill: none; stroke-width: 3; }

.ank-confirmed-title {
    font-size: 26px;
    font-weight: 900;
    color: #14532d;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.ank-confirmed-subtitle {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0;
}
.ank-success-divider {
    height: 1px;
    background: rgba(34,197,94,0.15);
    margin: 16px 0;
}
.ank-success-point-name {
    font-size: 18px;
    font-weight: 900;
    color: #7c3aed;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}
.ank-success-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    align-items: center;
}
.ank-success-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
    text-align: center;
}
.ank-success-row-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Race flags elapsed section */
.ank-success-race {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.1));
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
}
.ank-race-flag {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}
.ank-race-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 2px;
}
.ank-race-label {
    font-size: 9px;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.ank-race-time {
    font-size: 22px;
    font-weight: 900;
    color: #15803d;
    letter-spacing: -0.5px;
    line-height: 1;
}

/* Countdown ring */
.ank-success-countdown {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 8px;
}
.ank-countdown-svg {
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
}
.ank-countdown-track {
    fill: none;
    stroke: rgba(34,197,94,0.15);
    stroke-width: 3;
}
.ank-countdown-progress {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.ank-countdown-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
}
/* ═══ SUCCESS CARD — ZMIEŃ PACZKOMAT BUTTON ═══ */
.ank-success-change-btn {
    display: inline-block;
    margin: 8px auto 0;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    opacity: 0.85;
}
.ank-success-change-btn:hover {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #8b5cf6;
    opacity: 1;
}
/* ═══ SUCCESS CARD — X CLOSE BUTTON ═══ */
.ank-success-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.2s, color 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 10010;
    padding: 0;
    flex-shrink: 0;
}
.ank-success-close-btn:hover {
    background: rgba(0,0,0,0.14);
    color: #1e293b;
    transform: scale(1.15) rotate(90deg);
}

.ank-success-close-hint {
    font-size: 10px;
    color: rgba(15,23,42,0.35);
    letter-spacing: 0.3px;
}

/* ═══ CINEMATIC ZOOM OVERLAY — floating pill, no map darkening ═══ */
.ank-zoom-overlay {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 999px;
    padding: 10px 20px 10px 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(139,92,246,0.12);
    animation: ankFadeIn 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.ank-zoom-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139,92,246,0.4);
    position: relative;
}
.ank-zoom-spinner::before,
.ank-zoom-spinner::after { display: none; }
.ank-zoom-spinner svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2.5; animation: ankSpin 1s linear infinite; }
@keyframes ankSpin { to { transform: rotate(360deg) } }
.ank-zoom-text {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}
.ank-zoom-country {
    font-size: 12px;
    color: #8b5cf6;
    font-weight: 700;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ank-zoom-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    /* Full-screen fix: align-items:center in flex prevents height:100% from resolving
       on Safari Mobile. Switch to stretch so the container fills the viewport. */
    .ank-overlay {
        padding: 0;
        align-items: stretch;
    }
    .ank-container {
        width: 100%;
        /* Use dvh (dynamic viewport height) — shrinks when mobile browser chrome shows/hides.
           100vh fallback for browsers that don't support dvh. */
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .ank-header-top { padding: 8px 12px; gap: 8px; }
    .ank-flags { padding: 0 12px 8px; }
    .ank-detail-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-radius: 16px;
    }
    .ank-detail-header { padding: 12px 16px; }
    .ank-detail-body { padding: 10px 16px; }
    .ank-detail-actions { padding: 0 16px 12px; }
    .ank-btn-confirm { height: 40px; font-size: 14px; }
    .ank-detail-panel::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
        margin: 8px auto 0;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
    }
}
@media (max-width: 480px) {
    .ank-search-btn span { display: none; }
    .ank-search-btn { padding: 0 12px; width: 40px; justify-content: center; }
    .ank-search-btn svg { width: 17px; height: 17px; }
    .ank-success-card { padding: 24px 20px 20px; }
    .ank-confirmed-title { font-size: 24px; }
}

/* ═══════════════════════════════════════════════════════════════════
 * CARRIER LEGEND (Leaflet control — bottomleft)
 * Frosted glass card with scaled-up pins + carrier name/description.
 * HTML <img> overlays load logos reliably (same technique as map pins).
 * ═══════════════════════════════════════════════════════════════════ */
.ps-legend {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    padding: 7px 10px 8px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.14),
        0 1px 4px rgba(0, 0, 0, 0.08);
    min-width: 130px;
    cursor: default;
    user-select: none;
}

/* Legend scrollable body */
.ps-legend-body {
    max-height: calc(55vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
}
.ps-legend-body::-webkit-scrollbar { width: 3px; }
.ps-legend-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 2px; }

/* Legend header — drag handle + close button */
.ps-legend-hdr {
    display: flex;
    align-items: center;
    padding-bottom: 4px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    cursor: move;
    user-select: none;
}
.ps-legend-hdr-lbl {
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    flex: 1;
}
.ps-legend-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: #94a3b8;
    padding: 0 2px;
    font-weight: 400;
    transition: color .15s;
    flex-shrink: 0;
}
.ps-legend-close-btn:hover { color: #ef4444; }

.ps-legend-title {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--ank-slate-400);
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--ank-slate-200);
    font-family: system-ui, sans-serif;
}

.ps-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.ps-legend-row:hover {
    background: var(--ank-slate-100);
    margin: 0 -4px;
    padding: 2px 4px;
}

/* Pin wrapper: fixed size box that contains the upscaled pin.
   overflow:visible so the drop-shadow doesn't get clipped.        */
.ps-legend-pin-wrap {
    width:  30px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
/* Inner div (38×48 from buildCarrierPinSVG) scaled down 0.75×      */
.ps-legend-pin-inner {
    transform: scale(0.75);
    transform-origin: center center;
}

.ps-legend-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ps-legend-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--ank-slate-900);
    font-family: system-ui, sans-serif;
    line-height: 1;
}
.ps-legend-desc {
    font-size: 8px;
    color: var(--ank-slate-500);
    font-family: system-ui, sans-serif;
    line-height: 1;
}

/* Section separator */
.ps-legend-section-sep {
    border-top: 1px solid var(--ank-slate-200);
    margin: 6px -10px;
}

/* Cluster row — wider to fit 128×128 scaled down */
.ps-legend-cluster-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
}

/* Cluster wrapper: 128×128 scaled down to ~44px */
.ps-legend-cluster-wrap {
    width:  44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.ps-legend-cluster-wrap > div {
    transform: scale(0.34);
    transform-origin: center center;
}

/* Legend collapsed strip state */
.ps-legend-collapsed {
    cursor: pointer;
    border-radius: 6px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
}
.ps-legend-collapsed .ps-legend-hdr {
    border-radius: 6px;
    padding: 6px 12px;
    background: rgba(15,23,42,0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    user-select: none;
    cursor: pointer;
}
.ps-legend-collapsed .ps-legend-hdr-lbl {
    color: #fff !important;
}
.ps-legend-collapsed .ps-legend-body {
    display: none !important;
}

/* Auto-collapse legend on small screens — compact dark pill, tap to expand */
@media (max-width: 480px) {
    .ps-legend {
        border-radius: 6px !important;
        padding: 0 !important;
        min-width: 0 !important;
        max-width: 140px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
    }
    .ps-legend .ps-legend-body { display: none; }
    .ps-legend .ps-legend-hdr {
        border-radius: 6px;
        padding: 5px 10px;
        background: rgba(15,23,42,0.88);
    }
    .ps-legend .ps-legend-hdr-lbl { color: #fff !important; font-size: 8px; }
    .ps-legend .ps-legend-close-btn { display: none; }
    /* Expanded: user tapped the pill */
    .ps-legend.ps-legend-mobile-open {
        max-width: 220px;
        background: rgba(255,255,255,0.97);
    }
    .ps-legend.ps-legend-mobile-open .ps-legend-body {
        display: block;
        max-height: 40vh;
    }
    .ps-legend.ps-legend-mobile-open .ps-legend-hdr {
        background: rgba(15,23,42,0.92);
    }
    .ps-legend.ps-legend-mobile-open .ps-legend-close-btn { display: block; }
}

/* Animator collapsed strip state — dark pill next to legend */
.ps-animator-collapsed {
    cursor: pointer !important;
    border-radius: 6px !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
    overflow: hidden;
}
.ps-animator-collapsed .ps-anim-hdr {
    background: rgba(15,23,42,0.92) !important;
    border-radius: 6px;
    padding: 6px 10px !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
}
.ps-animator-collapsed .ps-anim-title {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: normal !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
 * LEGEND — interactive checkbox rows + count badges
 * ═══════════════════════════════════════════════════════════════════ */

/* Total point count badge in legend title */
.ps-legend-total {
    float: right;
    font-size: 8px;
    font-weight: 800;
    color: #8b5cf6;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 1px;
}

/* Toggle carrier row */
.ps-leg-tog-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 2px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.ps-leg-tog-row:hover {
    background: var(--ank-slate-100);
    margin: 0 -4px;
    padding: 3px 6px;
}

/* iOS-style toggle switch */
.ps-tog-sw {
    width: 34px;
    height: 19px;
    border-radius: 10px;
    background: #22c55e;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ps-tog-sw.ps-tog-off { background: #cbd5e1; }
.ps-tog-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.28);
    transition: transform 0.2s;
    pointer-events: none;
}
.ps-tog-sw:not(.ps-tog-off) .ps-tog-knob { transform: translateX(15px); }

/* Visible / Hidden status label */
.ps-leg-status {
    font-size: 10px;
    font-weight: 700;
    color: #22c55e;
    margin-left: auto;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
.ps-leg-status.ps-leg-off { color: #94a3b8; }

/* Per-carrier count */
.ps-legend-count {
    font-size: 8px;
    font-weight: 800;
    color: #8b5cf6;
    font-family: system-ui, sans-serif;
    line-height: 1;
    margin-top: 1px;
}

/* Dimmed pin when carrier is off */
.ps-legend-pin-wrap.ps-legend-pin-off {
    opacity: 0.3;
    filter: grayscale(0.9);
    transition: opacity 0.2s, filter 0.2s;
}

/* ═══ SCROLL HINT OVERLAY ═══ */
.ank-scroll-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    animation: ankScrollHintFadeIn 0.5s ease;
}
@keyframes ankScrollHintFadeIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
.ank-scroll-hint-mouse {
    width: 28px;
    height: 44px;
    border: 2.5px solid rgba(255,255,255,0.9);
    border-radius: 14px;
    background: rgba(15,23,42,0.6);
    display: flex;
    justify-content: center;
    padding-top: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ank-scroll-hint-wheel {
    width: 4px;
    height: 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    animation: ankScrollWheel 1.1s ease-in-out infinite;
}
@keyframes ankScrollWheel {
    0%   { transform: translateY(0); opacity: 1; }
    60%  { transform: translateY(10px); opacity: 0.3; }
    100% { transform: translateY(0); opacity: 1; }
}
.ank-scroll-hint-text {
    background: rgba(15,23,42,0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
