/**
 * Manual Assignment Styles
 * CSS for manual waypoint-to-driver assignment functionality
 * Panel uses --wq-* tokens (aligned with Expert / Quick wizard)
 */

/* ----- Panel shell ----- */
#manualAssignmentPanel {
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 100;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    order: 999;
}

#manualAssignmentPanel[style*="display: block"],
#manualAssignmentPanel:not([style*="display: none"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    max-height: none !important;
    overflow: visible !important;
}

#manualAssignmentPanel:not(.collapsed) .section-content {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
}

.ma-panel {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--wq-border, #E2E8F0);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ma-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ma-panel__title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--wq-ink, #0F172A);
}

.ma-panel__title i {
    color: var(--wq-teal-dark, #0F766E);
}

.ma-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    border-radius: var(--wq-r-pill, 999px);
    border: 1px solid var(--wq-border, #E2E8F0);
    background: var(--wq-surface, #fff);
    color: var(--wq-muted, #64748B);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ma-exit-btn:hover {
    background: var(--wq-surface-alt, #F8FAFC);
    color: var(--wq-ink, #0F172A);
    border-color: var(--wq-teal-border, #A7F3D0);
}

.ma-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ma-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wq-muted, #64748B);
}

.ma-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--wq-border, #E2E8F0);
    border-radius: var(--wq-r-md, 10px);
    background: var(--wq-surface, #fff);
    color: var(--wq-ink, #0F172A);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ma-select:focus {
    border-color: var(--wq-teal, #10B981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.ma-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ma-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: none;
    border-radius: var(--wq-r-md, 10px);
    background: linear-gradient(135deg, var(--wq-teal, #10B981), var(--wq-teal-dark, #0F766E));
    color: #fff;
    font-size: 0.875rem;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
    transition: filter 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.ma-btn-primary:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.ma-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ma-count-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: var(--wq-r-pill, 999px);
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
    font-weight: 700;
}

.ma-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--wq-border, #E2E8F0);
    border-radius: var(--wq-r-md, 10px);
    background: var(--wq-surface, #fff);
    color: var(--wq-muted, #64748B);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ma-btn-ghost:hover {
    background: var(--wq-surface-alt, #F8FAFC);
    color: var(--wq-ink, #0F172A);
    border-color: var(--wq-teal-border, #A7F3D0);
}

.ma-summary {
    padding: 0.7rem 0.75rem;
    background: var(--wq-surface-alt, #F8FAFC);
    border: 1px solid var(--wq-border, #E2E8F0);
    border-radius: var(--wq-r-md, 10px);
}

.ma-summary__title {
    margin: 0 0 0.55rem 0;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--wq-ink, #0F172A);
}

.ma-summary__list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ma-summary__empty {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.35rem 0;
    font-size: 0.75rem;
    color: var(--wq-muted, #64748B);
}

.ma-summary__empty i {
    opacity: 0.7;
}

.ma-assignment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    background: var(--wq-surface, #fff);
    border: 1px solid var(--wq-border, #E2E8F0);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ma-assignment-item:hover {
    border-color: var(--wq-teal-border, #A7F3D0);
    box-shadow: 0 1px 4px rgba(15, 118, 110, 0.08);
}

.ma-assignment-item__main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}

.ma-assignment-item__dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.ma-assignment-item__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wq-ink, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ma-assignment-item__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--wq-r-pill, 999px);
    background: var(--wq-teal-soft, #ECFDF5);
    color: var(--wq-teal-dark, #0F766E);
    font-size: 0.7rem;
    font-weight: 700;
}

.ma-assignment-item__remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--wq-muted, #64748B);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ma-assignment-item__remove:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.ma-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
}

.ma-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.4rem;
    border: 1px solid var(--wq-border, #E2E8F0);
    border-radius: 8px;
    background: var(--wq-surface, #fff);
    color: var(--wq-ink, #0F172A);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ma-btn-outline:hover {
    background: var(--wq-surface-alt, #F8FAFC);
    border-color: var(--wq-teal-border, #A7F3D0);
}

.ma-btn-outline--danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.25);
}

.ma-btn-outline--danger:hover {
    background: rgba(185, 28, 28, 0.06);
    border-color: rgba(185, 28, 28, 0.4);
    color: #991b1b;
}

/* Toggle activate button — active state */
#toggleAssignmentMode.is-active {
    background: linear-gradient(135deg, var(--wq-teal, #10B981), var(--wq-teal-dark, #0F766E)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

#toggleAssignmentMode.is-active::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
    animation: ma-pulse-dot 1.2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes ma-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

/* Map floating banner */
.ma-map-banner {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem 0.55rem 0.85rem;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    border-radius: var(--wq-r-pill, 999px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    font-weight: 550;
    max-width: calc(100% - 2rem);
    pointer-events: auto;
}

.ma-map-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--wq-teal, #10B981);
    flex-shrink: 0;
    font-size: 0.75rem;
}

.ma-map-banner__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ma-map-banner__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    border-radius: var(--wq-r-pill, 999px);
    background: rgba(255, 193, 7, 0.95);
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 750;
    flex-shrink: 0;
}

.ma-map-banner__exit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.ma-map-banner__exit:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Leaflet.Draw toolbar restyle */
.leaflet-draw-toolbar a {
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.leaflet-draw-toolbar a:hover {
    background-color: var(--wq-teal-soft, #ECFDF5) !important;
}

.leaflet-draw.leaflet-control {
    margin-top: 0.75rem !important;
    margin-left: 0.75rem !important;
}

/* Dark theme */
body.dark-theme #manualAssignmentPanel .ma-panel,
html.dark #manualAssignmentPanel .ma-panel {
    border-top-color: rgba(148, 163, 184, 0.2);
}

body.dark-theme .ma-panel__title,
html.dark .ma-panel__title {
    color: #F1F5F9;
}

body.dark-theme .ma-exit-btn,
body.dark-theme .ma-btn-ghost,
body.dark-theme .ma-btn-outline,
body.dark-theme .ma-select,
body.dark-theme .ma-assignment-item,
html.dark .ma-exit-btn,
html.dark .ma-btn-ghost,
html.dark .ma-btn-outline,
html.dark .ma-select,
html.dark .ma-assignment-item {
    background: #1E293B;
    border-color: rgba(148, 163, 184, 0.25);
    color: #E2E8F0;
}

body.dark-theme .ma-summary,
html.dark .ma-summary {
    background: #0F172A;
    border-color: rgba(148, 163, 184, 0.2);
}

body.dark-theme .ma-assignment-item__name,
html.dark .ma-assignment-item__name {
    color: #F1F5F9;
}

body.dark-theme .ma-assignment-item__badge,
html.dark .ma-assignment-item__badge {
    background: rgba(16, 185, 129, 0.18);
    color: #6EE7B7;
}

@media (max-width: 480px) {
    .ma-footer {
        grid-template-columns: 1fr;
    }

    .ma-map-banner {
        top: 0.5rem;
        padding: 0.45rem 0.55rem;
        font-size: 0.72rem;
        gap: 0.45rem;
    }

    .ma-map-banner__text {
        max-width: 9rem;
    }
}

/* Waypoint Selection */
.selectable-waypoint {
    transition: all 0.2s ease;
    cursor: pointer !important;
}

.selectable-waypoint:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.selected-waypoint {
    /* Use box-shadow and border instead of transform to avoid position shifts */
    box-shadow: 0 0 0 3px #ffc107, 0 0 0 5px rgba(255, 193, 7, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 1001 !important;
    animation: pulse-selection 1s ease-in-out infinite alternate;
    /* Ensure marker doesn't move */
    position: relative !important;
}

/* For circle markers, increase size without transform */
.leaflet-circle-marker.selected-waypoint {
    stroke-width: 4px !important;
    stroke: #ffc107 !important;
    filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.8));
}

/* For divIcon markers, add border without transform */
.leaflet-marker-icon.selected-waypoint {
    filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.8));
}

@keyframes pulse-selection {
    from {
        box-shadow: 0 0 0 3px #ffc107, 0 0 0 5px rgba(255, 193, 7, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    to {
        box-shadow: 0 0 0 3px #ffc107, 0 0 0 7px rgba(255, 193, 7, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Assigned waypoints - keep color visible */
.assigned-marker {
    /* Marker is already colored by updateWaypointColors, just ensure it's visible */
    z-index: 999 !important;
}

/* Ensure assigned markers don't move during pan/zoom */
.leaflet-marker-icon.assigned-marker,
.leaflet-circle-marker.assigned-marker {
    position: absolute !important;
    will-change: transform;
    transform-origin: center center;
}

/* Prevent marker movement during map interactions */
.leaflet-marker-icon,
.leaflet-circle-marker {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Performance optimizations for marker rendering during zoom */
.leaflet-marker-icon,
.leaflet-circle-marker,
.leaflet-marker-icon div,
.leaflet-circle-marker path {
    /* Use GPU acceleration for smoother zoom */
    will-change: transform;
    /* Reduce repaints during zoom */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Optimize rendering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Optimize marker container during zoom */
.leaflet-marker-pane,
.leaflet-overlay-pane {
    /* Use GPU acceleration */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.color-indicator {
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#toggleAssignmentMode {
    transition: all 0.2s ease;
}

#manualAssignmentPanel {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#manualAssignmentPanel[style*="display: none"] {
    opacity: 0;
    transform: translateY(-6px);
}

#manualAssignmentPanel[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Loading states */
.assignment-loading {
    position: relative;
    pointer-events: none;
}

.assignment-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.assignment-loading::before {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em;
    z-index: 1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success/Error states */
.assignment-success {
    border-color: #28a745 !important;
    background-color: rgba(40, 167, 69, 0.05);
}

.assignment-error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Tooltip styles for assigned waypoints */
.assigned-waypoint-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1002;
    white-space: nowrap;
}

/* Driver color legend */
.driver-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.driver-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.driver-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* GEL Proximity pickup points on map */
.gel-marker-icon {
    background: none !important;
    border: none !important;
}
.gel-marker-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color, #0f766e);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.gel-popup {
    min-width: 180px;
    font-size: 0.9rem;
}

/* Legenda: angolo top-right Leaflet allineato ai .map-controls, immediatamente alla loro sinistra */
.map-container .leaflet-control-container .leaflet-top.leaflet-right.map-legend-leaflet-corner {
    top: 1rem !important;
    right: calc(1rem + 3.35rem + 0.5rem) !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    z-index: 1001 !important; /* sopra .map-controls (1000), stesso contenitore */
}

@media (max-width: 768px) {
    .map-container .leaflet-control-container .leaflet-top.leaflet-right.map-legend-leaflet-corner {
        top: 0.5rem !important;
        right: calc(0.5rem + 3.1rem + 0.375rem) !important;
    }
}

.map-legend.leaflet-control {
    margin: 0 !important;
    clear: none;
    float: none;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.94));
    color: var(--text-primary, #1e293b);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.08);
    min-width: 220px;
    max-width: min(280px, calc(100vw - 5.5rem));
    padding: 12px 14px 14px;
    font-size: 14px;
    line-height: 1.35;
    pointer-events: auto;
}

/* Legenda chiusa: solo pulsante “i”, non copre pannelli ottimizzazione */
.map-legend.leaflet-control.map-legend--collapsed {
    max-width: none;
    width: auto;
    min-width: 0;
    padding: 4px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.map-legend--collapsed .map-legend__panel {
    display: none !important;
}

.map-legend:not(.map-legend--collapsed) .map-legend__pill {
    display: none !important;
}

.map-legend__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--primary-color, #0f766e);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.map-legend__pill:hover {
    filter: brightness(1.06);
}

.map-legend__panel {
    min-width: 0;
}

.map-legend__inner {
    user-select: none;
}

.map-legend__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    opacity: 0.95;
    letter-spacing: 0.02em;
}

.map-legend__head-title {
    flex: 1;
    min-width: 0;
}

.map-legend__close {
    flex-shrink: 0;
    margin: 0;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-primary, #1e293b);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    border-radius: 6px;
}

.map-legend__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}
.map-legend__sub {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
    margin-top: 10px;
    margin-bottom: 4px;
}
.map-legend__row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.map-legend__row--tight {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}
.map-legend__hint {
    flex: 1 1 100%;
    font-size: 12px;
    opacity: 0.78;
    margin-top: 4px;
    line-height: 1.3;
}
.map-legend__slash {
    opacity: 0.45;
    font-size: 12px;
}
.map-legend__sw {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 1;
}
.map-legend__sw--delivery {
    width: 16px;
    height: 16px;
    margin: 3px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.map-legend__sw--pickup {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff9800;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    font-size: 11px;
}
.map-legend__sw--driver {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    font-size: 11px;
}
.map-legend__sw--rt-start {
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 10px;
}
.map-legend__sw--rt-end {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 10px;
}
.map-legend__sw--rt-loop {
    background: #ff9800;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 10px;
}
.map-legend__sw--seq {
    position: relative;
    width: 26px;
    height: 26px;
    background: #3b82f6;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    font-size: 10px;
}
.map-legend__seq-ico {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    line-height: 1;
}
.map-legend__seq-num {
    position: absolute;
    right: -2px;
    bottom: -2px;
    min-width: 12px;
    height: 12px;
    padding: 0 2px;
    font-size: 8px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    background: #fff;
    color: #1e293b;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.map-legend__sw--gel {
    width: 16px;
    height: 16px;
    margin: 3px;
    border-radius: 50%;
    background: var(--primary-color, #0f766e);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* GEL Proximity: blocco compatto (Esperto + Quick), allineato al resto della sidebar */
.gel-proximity-sidebar-block {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color, #e2e8f0);
}

.gel-proximity-sidebar-block--wizard {
    margin-bottom: 0.75rem;
}

.gel-proximity-sidebar-block__head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-primary, #0f172a);
}

.gel-proximity-sidebar-block__head i {
    color: var(--primary-color, #0f766e);
}

.gel-proximity-sidebar-block__hint {
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.gel-proximity-sidebar-block__toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0;
    user-select: none;
    color: var(--text-primary, #0f172a);
}

.gel-proximity-sidebar-block__toggle input[type='checkbox'] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.12rem;
    flex-shrink: 0;
    accent-color: var(--primary-color, #0f766e);
}
