/* Route Explorer — premium outdoor aesthetic */
.re-page {
    --re-bg: #f3efe6;
    --re-surface: #faf8f3;
    --re-surface-elevated: #ffffff;
    --re-border: rgba(45, 58, 48, 0.12);
    --re-text: #1e2a24;
    --re-muted: #5c6b62;
    --re-accent: #1f6b4a;
    --re-accent-soft: rgba(31, 107, 74, 0.14);
    --re-accent-hover: #185a3d;
    --re-route: #2d6a5a;
    --re-route-dim: rgba(45, 106, 90, 0.35);
    --re-route-active: #1a4f3f;
    --re-shadow: 0 12px 40px rgba(30, 42, 36, 0.08);
    --re-radius: 14px;
    --re-sidebar-w: 360px;
    --re-detail-w: 380px;
    margin: 0 -0.75rem;
    background: var(--re-bg);
    min-height: calc(100vh - 220px);
}

@media (min-width: 992px) {
    .re-page {
        margin: 0 calc(-1 * var(--bs-gutter-x, 0.75rem));
    }
}

.re-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--re-border);
    background: linear-gradient(180deg, var(--re-surface) 0%, var(--re-bg) 100%);
}

.re-hero-inner {
    max-width: 640px;
}

.re-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--re-muted);
    margin-bottom: 0.35rem;
}

.re-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--re-text);
    margin-bottom: 0.35rem;
}

.re-lead {
    color: var(--re-muted);
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.re-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-re-outline {
    border: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    color: var(--re-text);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-re-outline:hover {
    background: var(--re-accent-soft);
    border-color: var(--re-accent);
    color: var(--re-accent);
}

.btn-re-primary {
    border: 1px solid var(--re-accent);
    background: var(--re-accent);
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-re-primary:hover {
    filter: brightness(0.95);
    color: #fff;
}

.re-sidebar-head-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.re-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--re-muted);
}

.re-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--re-border);
    border-top-color: var(--re-accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: re-spin 0.8s linear infinite;
}

@keyframes re-spin {
    to { transform: rotate(360deg); }
}

.re-state-error {
    color: #8b3a3a;
    background: #fdf3f3;
    border-radius: var(--re-radius);
    margin: 1rem;
}

.re-app {
    display: grid;
    grid-template-columns: var(--re-sidebar-w) 1fr;
    grid-template-rows: minmax(0, 1fr);
    height: min(78vh, 1024px);
    max-height: 1024px;
    min-height: 360px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .re-app.re-detail-open {
        grid-template-columns: var(--re-sidebar-w) 1fr var(--re-detail-w);
    }
}

.re-sidebar {
    flex-direction: column;
    background: var(--re-surface);
    border-right: 1px solid var(--re-border);
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.re-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem 0.5rem;
}

.re-sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--re-text);
    margin: 0;
}

.re-count {
    background: var(--re-accent-soft) !important;
    color: var(--re-accent) !important;
    font-weight: 600;
}

.re-filters {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid var(--re-border);
}

.re-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.re-filter-row:last-child {
    margin-bottom: 0;
}

.re-filter-chip {
    border: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    color: var(--re-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.re-filter-chip:hover {
    border-color: var(--re-accent);
    color: var(--re-accent);
}

.re-filter-chip.active {
    background: var(--re-accent);
    border-color: var(--re-accent);
    color: #fff;
}

.re-filter-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.re-filter-range label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--re-muted);
    margin-bottom: 0.15rem;
}

.re-filter-range input,
.re-filter-range select {
    width: 100%;
    font-size: 0.8rem;
    border: 1px solid var(--re-border);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: var(--re-surface-elevated);
}

.re-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
}

.re-list > .re-card,
.re-list > .re-list-empty {
    flex: 0 0 auto;
}

.re-card {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(30, 42, 36, 0.04);
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
}

.re-card:hover {
    border-color: rgba(31, 107, 74, 0.35);
    box-shadow: var(--re-shadow);
    transform: translateY(-1px);
}

.re-card.active {
    border-color: var(--re-accent);
    box-shadow: 0 0 0 2px var(--re-accent-soft), var(--re-shadow);
}

.re-card-cover {
    height: 96px;
    background: linear-gradient(135deg, #d8e4dc 0%, #c5d4c8 100%);
    background-size: cover;
    background-position: center;
}

.re-card-body {
    padding: 0.75rem 0.85rem 0.85rem;
}

.re-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.re-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--re-accent-soft);
    color: var(--re-accent);
}

.re-badge-difficulty {
    background: rgba(90, 80, 60, 0.12);
    color: #5a5040;
}

.re-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--re-text);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.re-card-desc {
    font-size: 0.8rem;
    color: var(--re-muted);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.re-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--re-text);
}

.re-card-stat span {
    color: var(--re-muted);
    font-weight: 500;
}

.re-card-compact {
    transform: none;
    overflow: visible;
    height: auto;
    min-height: 0;
}

.re-card-compact:hover {
    transform: none;
}

.re-card-compact .re-card-body {
    padding: 0.9rem 1rem;
}

.re-card-compact .re-card-title {
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 0.2rem;
}

.re-card-compact .re-card-meta {
    margin-bottom: 0.45rem;
}

.re-card-compact .re-card-stats {
    gap: 0.45rem 0.75rem;
    line-height: 1.4;
}

.re-card-compact .re-card-area {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--re-muted);
    margin: 0 0 0.45rem;
    text-align: left;
}

.re-card-area {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--re-muted);
    margin-left: auto;
    text-align: right;
    flex: 1 1 auto;
}

.re-map-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 1024px;
    background: #dde5df;
}

.re-map-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
}

.re-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.re-route-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.re-route-overlay-bg {
    fill: none;
    stroke: #e67700;
    stroke-width: 4;
    stroke-opacity: 0.82;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8 8;
    paint-order: stroke fill;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #fff);
}

.re-route-overlay-active {
    fill: none;
    stroke: #d9480f;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    paint-order: stroke fill;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}

.re-map .maplibregl-map,
.re-map .maplibregl-canvas {
    height: 100%;
    width: 100%;
    font-family: inherit;
}

.re-map-stage .maplibregl-marker {
    z-index: 2;
}

/* I marker impostano z-index inline (in base alla posizione): il popup deve restare sopra. */
.re-map-stage .maplibregl-popup,
.re-map .maplibregl-popup {
    z-index: 10000 !important;
}

.re-map .maplibregl-ctrl-group {
    border-radius: 10px;
    box-shadow: var(--re-shadow);
    border: 1px solid var(--re-border);
    overflow: hidden;
}

.re-basemap-control {
    margin-top: 0.5rem !important;
}

.re-basemap-control select {
    min-width: 8.5rem;
    border-radius: 10px;
    border: 1px solid var(--re-border);
    box-shadow: var(--re-shadow);
    font-size: 0.82rem;
}

.re-map-overlay {
    position: absolute;
    z-index: 500;
    pointer-events: none;
}

.re-follow-alert {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(127, 45, 45, 0.94);
    color: #fff;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    max-width: min(92%, 420px);
    text-align: center;
    box-shadow: 0 10px 30px rgba(80, 20, 20, 0.25);
    pointer-events: none;
}

.re-follow-alert strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}

.re-map-stage.re-map-following .re-user-marker-dot {
    border-color: #1f6b4a;
    box-shadow: 0 0 0 4px rgba(31, 107, 74, 0.25);
}

.re-nav {
    margin-bottom: 0.75rem;
}

.re-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.re-follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid var(--re-accent);
    background: var(--re-accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.re-follow-btn:hover {
    background: var(--re-accent-hover, #185a3d);
    border-color: var(--re-accent-hover, #185a3d);
}

.re-follow-btn.is-active {
    background: #fff;
    color: #8b3a3a;
    border-color: #d4a0a0;
}

.re-follow-btn.is-active:hover {
    background: #fdf3f3;
}

.re-flyover-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #38598b;
    background: #38598b;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.re-flyover-btn:hover {
    background: #2c4770;
    border-color: #2c4770;
}

.re-flyover-btn.is-active {
    background: #fff;
    color: #8b3a3a;
    border-color: #d4a0a0;
}

.re-flyover-btn.is-active:hover {
    background: #fdf3f3;
}

.re-nav-external {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    color: var(--re-text);
}

.re-nav-external:hover {
    border-color: #4285f4;
    color: #1a73e8;
    background: rgba(66, 133, 244, 0.08);
}

.re-follow-status.text-warning {
    color: #9a6700 !important;
}

.re-follow-status.text-danger {
    color: #8b3a3a !important;
}

.re-map-hint {
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(250, 248, 243, 0.92);
    border: 1px solid var(--re-border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
    color: var(--re-muted);
    backdrop-filter: blur(6px);
    pointer-events: none;
    transition: opacity 0.2s;
    max-width: min(92%, 420px);
    text-align: center;
}

.re-map-hint.re-map-hint-visible {
    color: var(--re-text);
    border-color: rgba(31, 107, 74, 0.35);
    box-shadow: var(--re-shadow);
}

.re-map-stage.re-flyover-active .re-map-hint {
    display: none !important;
}

.re-elevation-panel {
    flex-shrink: 0;
    border-top: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    padding: 0.65rem 0.85rem 0.55rem;
}

.re-elevation-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.re-elevation-hover {
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.re-elevation-chart-wrap {
    position: relative;
    height: 150px;
}

.re-elevation-empty {
    font-size: 0.82rem;
    color: var(--re-muted);
    padding: 0.35rem 0 0.5rem;
}

.re-elevation-marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

#re-elevation-chart {
    width: 100% !important;
    height: 100% !important;
}

.re-map-stage:fullscreen,
.re-map-stage.re-map-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
    background: #dde5df;
}

.re-map-stage:fullscreen .re-map-viewport,
.re-map-stage.re-map-fullscreen .re-map-viewport {
    position: absolute;
    inset: 0;
}

.re-map-stage:fullscreen .re-elevation-panel,
.re-map-stage.re-map-fullscreen .re-elevation-panel {
    display: none !important;
}

.re-map-stage:fullscreen .re-map,
.re-map-stage.re-map-fullscreen .re-map {
    position: absolute;
    inset: 0;
}

body.re-map-fullscreen-active {
    overflow: hidden;
}

.re-map-tools {
    border: none !important;
    box-shadow: var(--re-shadow) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.re-map-tools .re-map-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-bottom: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    color: var(--re-accent);
    cursor: pointer;
    line-height: 1;
}

.re-map-tools .re-map-tool-btn:last-child {
    border-bottom: none;
}

.re-map-tools .re-map-tool-btn:hover {
    background: var(--re-accent-soft);
}

.re-map-tools .re-map-tool-btn.is-active {
    background: var(--re-accent);
    color: #fff;
}

.re-map-tools .re-locate-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
}

.re-map-tools .re-map-tool-btn:disabled {
    pointer-events: none;
}

.leaflet-div-icon.re-user-marker {
    background: transparent !important;
    border: none !important;
}

.re-page .maplibregl-popup-content {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.45;
    border-radius: 12px;
    box-shadow: var(--re-shadow);
}

.re-user-marker-dot {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2563eb;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.re-user-marker-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.45);
    animation: re-user-pulse 2s ease-out infinite;
}

@keyframes re-user-pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.re-flyover-marker-dot {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd43b;
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.re-flyover-marker-pulse {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(255, 212, 59, 0.75);
    animation: re-user-pulse 1.6s ease-out infinite;
}

.re-flyover-controls {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 0.45rem;
    z-index: 600;
    pointer-events: auto;
}

.re-flyover-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
    transition: background 0.15s, border-color 0.15s;
}

.re-flyover-ctrl-btn:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.6);
}

.re-flyover-ctrl-btn.is-paused {
    background: #ffd43b;
    border-color: #ffd43b;
    color: #1e293b;
}

.re-flyover-ctrl-btn.is-paused:hover {
    background: #ffe066;
}

.re-flyover-ctrl-stop:hover {
    background: rgba(139, 58, 58, 0.92);
    border-color: rgba(255, 190, 190, 0.7);
}

.re-detail {
    background: var(--re-surface-elevated);
    border-left: 1px solid var(--re-border);
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(30, 42, 36, 0.06);
    min-height: 0;
    height: 100%;
}

.re-detail-head {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.5rem 0;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--re-surface-elevated) 70%, transparent);
    z-index: 2;
}

.re-detail-close,
.re-sheet-close,
.re-lightbox-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--re-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.re-detail-close:hover,
.re-sheet-close:hover,
.re-lightbox-close:hover {
    background: var(--re-accent-soft);
    color: var(--re-accent);
}

.re-detail-cover {
    height: 160px;
    background: linear-gradient(135deg, #d8e4dc, #b8cfc0);
    background-size: cover;
    background-position: center;
}

.re-detail-body {
    padding: 1rem 1.15rem 1.5rem;
}

.re-detail-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--re-muted);
    margin-bottom: 0.25rem;
}

.re-detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--re-text);
}

.re-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.re-stat-box {
    background: var(--re-bg);
    border-radius: 10px;
    padding: 0.6rem 0.5rem;
    text-align: center;
}

.re-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--re-text);
}

.re-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--re-muted);
}

.re-detail-text {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--re-text);
    margin-bottom: 1rem;
}

.re-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.re-gallery-item {
    border: none;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--re-bg);
}

.re-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.re-gallery-item:hover img {
    transform: scale(1.04);
}

.re-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--re-muted);
    margin: 1rem 0 0.5rem;
    font-weight: 700;
}

.re-rating-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.82rem;
    color: var(--re-text);
}

.re-card-rating {
    margin: 0.35rem 0 0.15rem;
}

.re-rating-empty {
    color: var(--re-muted);
    font-size: 0.78rem;
}

.re-stars {
    color: #c27803;
    letter-spacing: 0.05em;
    font-size: 0.95em;
}

.re-rating-value {
    font-weight: 700;
}

.re-rating-count {
    color: var(--re-muted);
}

.re-reviews {
    margin-top: 1.1rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--re-border);
}

.re-review-form {
    background: var(--re-surface-elevated);
    border: 1px solid var(--re-border);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.9rem;
}

.re-review-pending {
    color: #9a6700;
    background: #fff8e6;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.re-star-input {
    display: flex;
    gap: 0.15rem;
}

.re-star-btn {
    border: 0;
    background: transparent;
    color: #c9a227;
    font-size: 1.45rem;
    line-height: 1;
    padding: 0.1rem 0.15rem;
    cursor: pointer;
}

.re-star-btn.is-active,
.re-star-btn:hover {
    color: #c27803;
}

.re-review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.re-review-item {
    border: 1px solid var(--re-border);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    background: var(--re-surface);
}

.re-review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.35rem;
}

.re-review-author {
    font-size: 0.86rem;
}

.re-review-date {
    font-size: 0.75rem;
    color: var(--re-muted);
    margin-left: auto;
}

.re-review-comment {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--re-text);
}

.re-review-login {
    margin-bottom: 0.75rem;
}

.re-share {
    margin-bottom: 0.75rem;
}

.re-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.re-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--re-border);
    background: var(--re-surface-elevated);
    color: var(--re-text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.re-share-btn:hover {
    border-color: var(--re-accent);
    color: var(--re-accent);
    background: var(--re-accent-soft);
}

.re-share-whatsapp:hover {
    border-color: #25d366;
    color: #1a8f47;
    background: rgba(37, 211, 102, 0.12);
}

.re-share-telegram:hover {
    border-color: #229ed9;
    color: #187aa8;
    background: rgba(34, 158, 217, 0.12);
}

.re-share-email:hover {
    border-color: #6b7280;
    color: #4b5563;
    background: rgba(107, 114, 128, 0.1);
}

.re-share-feedback {
    margin-top: 0.45rem;
}

/* MapLibre customizations */
.re-page .maplibregl-popup-content {
    font-family: inherit;
}

.re-photo-marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--re-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.re-global-poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1.5px solid #5c4d9e;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.24);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.re-global-poi-marker:hover,
.re-global-poi-marker:focus-visible {
    transform: scale(1.12);
    box-shadow: 0 2px 10px rgba(92, 77, 158, 0.35);
    outline: none;
}

.re-global-poi-marker-icon {
    font-size: 11px;
    line-height: 1;
}

.re-global-poi-popup-img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.poi-gallery {
    position: relative;
    margin-bottom: 8px;
}

.poi-gallery-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #e8edf2;
}

.poi-gallery-slide {
    display: none;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    margin: 0;
}

.poi-gallery-slide.is-active {
    display: block;
}

.poi-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}

.poi-gallery-prev { left: 0.35rem; }
.poi-gallery-next { right: 0.35rem; }

.poi-gallery-counter {
    position: absolute;
    right: 0.4rem;
    bottom: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 0.7rem;
    z-index: 2;
}

.re-poi-photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.re-poi-photo-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.re-poi-existing-photo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: stretch;
}

.re-poi-existing-photos {
    margin-top: 0.6rem;
}

.re-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.re-lightbox-prev { left: 1rem; }
.re-lightbox-next { right: 1rem; }

.re-lightbox-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.re-global-poi-popup-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.re-global-poi-popup-type,
.re-global-poi-popup-area {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 2px;
}

.re-global-poi-popup-desc {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-top: 6px;
    color: #334155;
}

.re-global-poi-popup-pending {
    font-size: 0.78rem;
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 6px;
    padding: 4px 8px;
    margin: 4px 0 6px;
}

.re-poi-share {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.re-poi-share-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.re-poi-share-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.re-poi-share-btn {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
}

.re-poi-share-btn:hover,
.re-poi-share-btn:focus-visible {
    background: #eef2ff;
    color: #1e293b;
    outline: none;
}

.re-poi-share-wa {
    border-color: rgba(37, 211, 102, 0.45);
    color: #15803d;
}

.re-poi-share-tg {
    border-color: rgba(42, 171, 238, 0.45);
    color: #0369a1;
}

.re-poi-share-walk {
    border-color: rgba(66, 133, 244, 0.45);
    color: #1d4ed8;
}

.re-poi-manage {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.re-poi-manage-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.re-poi-manage-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.re-poi-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    color: #1e293b;
    cursor: pointer;
}

.re-poi-manage-btn:hover,
.re-poi-manage-btn:focus-visible {
    background: #f8fafc;
    outline: none;
}

.re-poi-manage-edit {
    border-color: rgba(37, 99, 235, 0.35);
    color: #1d4ed8;
}

.re-poi-manage-delete {
    border-color: rgba(220, 38, 38, 0.35);
    color: #b91c1c;
}

.re-lightbox-action.re-poi-manage-edit:hover {
    background: rgba(66, 133, 244, 0.3);
    border-color: rgba(66, 133, 244, 0.75);
}

.re-lightbox-action.re-poi-manage-delete:hover {
    background: rgba(220, 38, 38, 0.28);
    border-color: rgba(220, 38, 38, 0.7);
}

.re-poi-filter-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    padding: 4px;
}

.re-poi-filter-control select {
    min-width: 130px;
    font-size: 0.8rem;
    border: none;
    box-shadow: none;
}

/* Menu contestuale mappa (aggiungi POI) */
.re-map-context {
    position: fixed;
    z-index: 1080;
    min-width: 220px;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.re-map-context-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    font-size: 0.92rem;
    color: #1e293b;
    cursor: pointer;
}

.re-map-context-item:hover,
.re-map-context-item:focus-visible {
    background: rgba(92, 77, 158, 0.1);
    outline: none;
}

.re-map-context-hint {
    font-size: 0.75rem;
    line-height: 1.35;
    max-width: 240px;
}

/* Pannello creazione/modifica POI: lascia la mappa cliccabile per posizionare il punto */
.re-poi-modal {
    position: absolute;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 12px;
    background: transparent;
    pointer-events: none;
}

.re-poi-modal.d-none {
    display: none;
}

.re-poi-modal-card {
    width: min(100%, 400px);
    max-height: calc(100% - 24px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.35);
    padding: 18px 20px 20px;
    pointer-events: auto;
}

.re-poi-placement-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #b91c1c;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(185, 28, 28, 0.45);
    cursor: grab;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

.re-poi-placement-marker:active {
    cursor: grabbing;
}

.re-map-stage .maplibregl-marker:has(.re-poi-placement-marker) {
    z-index: 10001 !important;
}

@media (max-width: 767.98px) {
    .re-poi-modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .re-poi-modal-card {
        width: 100%;
        max-width: none;
        max-height: min(55vh, 420px);
        border-radius: 14px 14px 0 0;
    }
}

.re-poi-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.re-poi-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.re-poi-modal-close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
}

.re-poi-coords {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 12px;
}

.re-poi-field {
    margin-bottom: 12px;
}

.re-poi-field > label,
.re-poi-visibility legend {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.re-poi-visibility {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
}

.re-poi-visibility legend {
    float: none;
    width: auto;
    font-size: 0.86rem;
    padding: 0 4px;
    margin-bottom: 4px;
}

.re-poi-users-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin: 8px 0 4px;
}

.re-poi-vis-hint {
    margin-top: 8px;
}

.re-poi-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.re-poi-photo-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.re-poi-photo-preview img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.14);
}

.re-poi-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

@media (hover: hover) and (pointer: fine) {
    .re-poi-camera-btn {
        display: none;
    }
}

.re-poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.re-poi-marker:hover,
.re-poi-marker:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
    outline: none;
}

.re-poi-marker-peak {
    color: #7c4a1a;
}

.re-poi-marker-place {
    color: #2f5a45;
}

.re-poi-popup-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #1e2a24;
}

.re-poi-popup-meta {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #5b6b62;
}

.re-start-marker-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.re-photo-popup img {
    width: 180px;
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 0.35rem;
}

/* Mobile sheet */
.re-mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    max-height: 72vh;
    background: var(--re-surface-elevated);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(30, 42, 36, 0.15);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.re-mobile-sheet.open {
    transform: translateY(0);
}

.re-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--re-border);
    border-radius: 999px;
    margin: 0.5rem auto 0;
}

.re-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--re-border);
}

.re-mobile-sheet .re-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
}

.re-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 24, 0.45);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.re-mobile-sheet .re-filters {
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .re-app {
        grid-template-columns: 1fr;
        height: min(68vh, 640px);
        max-height: 640px;
        min-height: 280px;
    }

    .re-elevation-chart-wrap {
        height: 120px;
    }

    .re-elevation-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .re-elevation-hover {
        text-align: left;
        white-space: normal;
    }

    .re-detail {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 1050;
        max-height: 85vh;
        border-left: none;
        border-radius: 18px 18px 0 0;
        transform: translateY(105%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .re-detail.open {
        transform: translateY(0);
    }
}

/* Photo lightbox */
.re-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 22, 18, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.re-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.re-lightbox-figure {
    max-width: min(920px, 100%);
    margin: 0;
    text-align: center;
}

.re-lightbox-figure img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.re-lightbox-figure figcaption {
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.re-lightbox-actions {
    margin-top: 0.9rem;
}

.re-lightbox-actions-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.re-lightbox-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.re-lightbox-action:hover,
.re-lightbox-action:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.re-lightbox-action.re-share-whatsapp:hover {
    background: rgba(37, 211, 102, 0.28);
    border-color: rgba(37, 211, 102, 0.7);
}

.re-lightbox-action.re-share-telegram:hover {
    background: rgba(36, 161, 222, 0.28);
    border-color: rgba(36, 161, 222, 0.7);
}

.re-lightbox-action.re-share-email:hover {
    background: rgba(250, 176, 5, 0.28);
    border-color: rgba(250, 176, 5, 0.7);
}

.re-lightbox-action.re-share-walk:hover {
    background: rgba(66, 133, 244, 0.3);
    border-color: rgba(66, 133, 244, 0.75);
}

.re-list-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--re-muted);
    font-size: 0.9rem;
}
