/* ─── Browse map (interactive world view) ─────────────────────────── */

.w-world-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 480px;
    border: 1px solid var(--w-paper-edge, #D8DBE0);
    border-radius: var(--w-radius-md, 4px);
    overflow: hidden;
    box-shadow: none;
    background: #E8EAED;
}

.w-world-map {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
}

.w-world-timeline {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    margin: 0 0 var(--w-space-3);
    border: 1px solid var(--w-paper-edge, #D8DBE0);
    border-radius: var(--w-radius-md, 4px);
    background: var(--w-paper-elev, #fff);
    box-shadow: none;
    font-family: var(--w-font-body);
    opacity: 1;
}

.w-world-timeline.is-active {
    opacity: 1;
}

.w-world-timeline__head i {
    color: var(--w-signal, #FF4D1A);
}

.w-world-timeline input[type="range"] {
    width: 100%;
    accent-color: var(--w-signal, #FF4D1A);
}

.w-world-timeline input[type="range"]:disabled {
    opacity: 0.4;
}

.w-place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.w-place-tile-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--w-paper-edge, #D8DBE0);
    border-radius: var(--w-radius-md, 4px);
    background: var(--w-paper-elev, #fff);
    overflow: hidden;
}

.w-place-tile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1rem 0.75rem;
    text-decoration: none;
    color: var(--w-ink, #111318);
    min-height: 88px;
}

.w-place-tile:hover {
    background: var(--w-bg-alt, #E8EAED);
}

.w-place-tile__flag {
    font-size: 1.35rem;
    line-height: 1;
}

.w-place-tile__name {
    font-family: var(--w-font-display, inherit);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.w-place-tile__count {
    font-family: var(--w-font-data, ui-monospace, monospace);
    font-size: 0.75rem;
    color: var(--w-ink-muted, #5C6370);
}

.w-place-tile__zoom {
    border: 0;
    border-top: 1px solid var(--w-paper-edge, #D8DBE0);
    background: transparent;
    color: var(--w-route, #0A6E8A);
    font: 600 0.8rem/1 var(--w-font-body, system-ui);
    padding: 0.55rem 1rem;
    cursor: pointer;
    text-align: left;
}

.w-place-tile__zoom:hover {
    background: var(--w-bg-alt, #E8EAED);
    color: var(--w-ink, #111318);
}

.w-world-hint {
    margin: 0.75rem 0 0;
    color: var(--w-ink-muted, #5C6370);
    font-size: 0.9rem;
}

@media (max-width: 800px) {
    .w-world-timeline__grid {
        grid-template-columns: 1fr 1fr;
    }
    .w-world-frame {
        aspect-ratio: 4 / 5;
        min-height: 360px;
    }
}

.w-world-timeline__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--w-ink);
    font-size: 13px;
    font-weight: 700;
}

.w-world-timeline__head span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.w-world-timeline__head i {
    color: var(--w-brand-600, #0f8e9e);
}

.w-world-timeline__head button {
    border: 1px solid var(--w-paper-edge);
    border-radius: var(--w-radius-pill);
    background: var(--w-paper-elev);
    color: var(--w-ink-muted);
    cursor: pointer;
    font: 700 11px/1 var(--w-font-body);
    padding: 7px 10px;
}

.w-world-timeline__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.w-world-timeline label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.w-world-timeline label span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--w-ink-muted);
    font-size: 12px;
}

.w-world-timeline label strong {
    color: var(--w-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.w-world-timeline input[type="range"] {
    width: 100%;
    accent-color: var(--w-brand-500, #16acbe);
}

.w-world-timeline p {
    margin: 0;
    color: var(--w-ink-muted);
    font-size: 12px;
}

.w-profile-map-panel {
    margin: 0 0 var(--w-space-5);
}

.w-profile-map-panel__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 var(--w-space-3);
}

.w-profile-map-panel__head h2 {
    margin: 0 0 4px;
    color: var(--w-ink);
    font-family: var(--w-font-display);
    font-size: clamp(24px, 3vw, 34px);
}

.w-profile-map-panel__head p {
    margin: 0;
    color: var(--w-ink-muted);
    font-family: var(--w-font-body);
}

.w-world-frame--profile {
    aspect-ratio: 16 / 7;
    min-height: 360px;
}

/* Side rail with layer toggles. Sits over the map, top-right. */
.w-world-rail {
    position: absolute;
    top: var(--w-space-3);
    right: var(--w-space-3);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--w-paper);
    border: 1px solid var(--w-paper-edge);
    border-radius: var(--w-radius-md);
    padding: 8px;
    box-shadow: var(--w-shadow-elev);
    font-family: var(--w-font-body);
    min-width: 190px;
}

.w-world-rail__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--w-radius-sm);
    cursor: pointer;
    color: var(--w-ink);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.w-world-rail__toggle:hover {
    background: var(--w-paper-elev);
    border-color: var(--w-paper-edge);
}

.w-world-rail__toggle.is-off {
    opacity: 0.4;
}

.w-world-rail__toggle.is-off .w-world-rail__dot {
    background: #aaa !important;
    box-shadow: none;
}

.w-world-rail__dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.w-world-rail__toggle.is-countries .w-world-rail__dot {
    background: #16acbe;
    box-shadow: 0 0 0 2px rgba(22, 172, 190, 0.25);
}

.w-world-rail__toggle.is-recommended .w-world-rail__dot {
    background: #7a4cb5;
    box-shadow: 0 0 0 2px rgba(122, 76, 181, 0.25);
}

.w-world-rail__toggle.is-walks .w-world-rail__dot {
    background: #0f8e9e;
    box-shadow: 0 0 0 2px rgba(15, 142, 158, 0.25);
}

.w-world-rail__toggle.is-live .w-world-rail__dot {
    background: #cc1f1f;
    box-shadow: 0 0 0 2px rgba(204, 31, 31, 0.25);
    animation: w-world-pulse-dot 1.6s ease-in-out infinite;
}

.w-world-rail__divider {
    height: 1px;
    background: var(--w-paper-edge);
    margin: 4px -2px;
}

.w-world-rail__action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--w-brand-50, #effbfc);
    border: 1px solid var(--w-paper-edge);
    border-radius: var(--w-radius-sm);
    cursor: pointer;
    color: var(--w-brand-700, #0f8e9e);
    font-family: var(--w-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 120ms ease, color 120ms ease;
}

.w-world-rail__action:hover {
    background: var(--w-brand-100, #d4f2f5);
    color: var(--w-brand-800, #0a6d79);
}

@keyframes w-world-pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px rgba(204, 31, 31, 0.25); }
    50%      { box-shadow: 0 0 0 6px rgba(204, 31, 31, 0.0); }
}

.w-world-rail__label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.w-world-rail__count {
    color: var(--w-ink-muted);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

/* Hint line under the map */
.w-world-hint {
    margin: var(--w-space-3) 0 0;
    font-family: var(--w-font-body);
    font-size: var(--w-text-sm);
    color: var(--w-ink-muted);
    text-align: center;
}

/* ─── Leaflet overrides ───────────────────────────────────────────── */

.leaflet-container {
    font-family: var(--w-font-body);
    background: #e9e3d6;
}

.w-world-tip {
    background: rgba(255, 252, 245, 0.97) !important;
    border: 1px solid var(--w-paper-edge) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    color: var(--w-ink) !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
}

.w-world-tip::before {
    border-top-color: var(--w-paper-edge) !important;
}

.leaflet-popup.w-world-popup .leaflet-popup-content-wrapper {
    background: var(--w-paper);
    border-radius: var(--w-radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    color: var(--w-ink);
}

.leaflet-popup.w-world-popup .leaflet-popup-content {
    margin: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.leaflet-popup.w-world-popup .leaflet-popup-tip {
    background: var(--w-paper);
}

/* Live walker pulse marker */
.w-world-live-icon { background: transparent !important; border: none !important; }
.w-world-rec-icon  { background: transparent !important; border: none !important; }
.w-world-walk-icon { background: transparent !important; border: none !important; }

/* Recommended pin (refined) */
.w-world-rec-pin {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.32);
    margin: 1px;
}

/* Single-walk dot (city-anchored) */
.w-world-walk-dot {
    display: block;
    width: 12px;
    height: 12px;
    margin: 1px;
    border-radius: 50%;
    background: #16acbe;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Cluster bubble (replaces leaflet.markercluster default) */
.w-world-cluster {
    background: transparent !important;
    border: none !important;
}
.w-world-cluster__bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(22, 172, 190, 0.92);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-family: var(--w-font-body);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Country popup actions */
.w-world-popup__head    { margin-bottom: 8px; }
.w-world-popup__meta    { color: var(--w-ink-muted); font-size: 12px; margin-top: 2px; }
.w-world-popup__live    { color: #cc1f1f; font-weight: 600; }

.w-world-popup__actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.w-world-popup__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--w-paper-edge);
    border-radius: var(--w-radius-sm);
    color: var(--w-ink);
    font-family: var(--w-font-body);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.w-world-popup__btn:hover {
    background: var(--w-paper-elev);
    border-color: var(--w-brand-300);
    color: var(--w-brand-700, #0f8e9e);
}
.w-world-popup__btn--primary {
    background: var(--w-brand-500, #16acbe);
    color: #fff;
    border-color: var(--w-brand-500, #16acbe);
}
.w-world-popup__btn--primary:hover {
    background: var(--w-brand-700, #0f8e9e);
    border-color: var(--w-brand-700, #0f8e9e);
    color: #fff;
}

.w-world-popup__link {
    display: inline-block;
    margin-top: 6px;
    color: var(--w-brand-700, #0f8e9e);
    font-weight: 600;
    text-decoration: none;
}
.w-world-popup__link:hover { text-decoration: underline; }
.w-world-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.w-world-popup__together {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--w-paper-edge, #d8dbe0);
    border-radius: 8px;
    background: #fff;
    color: var(--w-ink, #111);
    cursor: pointer;
    font: 700 12px/1 var(--w-font-body, system-ui);
}
.w-world-popup__together:hover {
    border-color: var(--w-brand-300, #7bb8c9);
    color: var(--w-brand-700, #06485a);
}

/* Walk popup with thumbnail */
.w-world-popup--walk .leaflet-popup-content { margin: 0 !important; }
.w-world-popup__thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    border-top-left-radius:  var(--w-radius-md);
    border-top-right-radius: var(--w-radius-md);
}
.w-world-popup__body { padding: 10px 14px 12px; }

.w-world-live-pulse {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
    margin: 4px;
    border-radius: 50%;
    background: #cc1f1f;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.w-world-live-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(204, 31, 31, 0.35);
    z-index: -1;
    animation: w-world-pulse-ring 1.6s ease-out infinite;
}

@keyframes w-world-pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.7; }
    70%  { transform: scale(2.2); opacity: 0;   }
    100% { transform: scale(2.2); opacity: 0;   }
}

/* ─── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .w-world-timeline__grid {
        grid-template-columns: 1fr 1fr;
    }
    .w-profile-map-panel__head {
        display: block;
    }
    .w-world-frame--profile {
        aspect-ratio: 4 / 5;
        min-height: 420px;
    }
    .w-world-frame {
        aspect-ratio: 4 / 5;
        min-height: 420px;
        border-radius: var(--w-radius-md);
    }
    .w-world-rail {
        top: auto;
        right: 8px;
        left: 8px;
        bottom: 10px;
        min-width: 0;
        padding: 6px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: none;
    }
    .w-world-rail__toggle {
        padding: 6px 8px;
        font-size: 12px;
        flex: 1 1 auto;
        justify-content: center;
    }
    .w-world-rail__count { display: none; }
}
