:root {
    --bg: #111317;
    --surface: #1a1d23;
    --surface-soft: #22262e;
    --surface-strong: #2b313b;
    --text: #e4e7ee;
    --text-muted: #9aa4b5;
    --border: rgba(255, 255, 255, 0.12);
    --brand: #fe5f00;
    --brand-hover: #ff7a2d;
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --unknown: #7c879a;
    --shadow-lg: 0 14px 38px rgba(0, 0, 0, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: radial-gradient(circle at 10% -10%, #1f2937 0%, var(--bg) 38%) fixed;
    color: var(--text);
}

.hidden {
    display: none !important;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) 1fr;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.left-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: rgba(15, 18, 24, 0.95);
    min-width: 0;
    min-height: 0;
    isolation: isolate;
}

.sidebar-user {
    padding: 10px 14px 6px;
}

/* Login/Logout placé en haut à droite de la carte */

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-legend-banner {
    flex-shrink: 0;
    margin-top: auto;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 23, 29, 0.92), rgba(15, 18, 24, 0.98));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    z-index: 2;
}

.sidebar-legend-banner.legend {
    border-radius: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.sidebar-legend-banner-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 6px;
}

.sidebar-legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 8px;
}

.sidebar-legend-banner .legend-item {
    font-size: 10px;
    gap: 5px;
    margin-bottom: 0;
    line-height: 1.25;
    min-width: 0;
}

.sidebar-legend-banner .color-box {
    width: 12px;
    height: 12px;
    border-width: 1px;
    border-radius: 2px;
    flex-shrink: 0;
}

.sidebar-legend-banner .legend-line {
    width: 14px;
    height: 3px;
    flex-shrink: 0;
}

.sidebar-legend-banner .legend-line.curvy {
    width: 20px;
    height: 10px;
}

.sidebar-legend-banner .legend-dot {
    width: 9px;
    height: 9px;
    border-width: 1px;
    flex-shrink: 0;
}

header {
    background: linear-gradient(145deg, rgba(26, 29, 35, 0.96), rgba(18, 20, 26, 0.88));
    color: var(--text);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 28px;
    margin-bottom: 5px;
    letter-spacing: -0.02em;
}

header p {
    font-size: 14px;
    color: var(--text-muted);
}

.brand {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.brand-logo {
    width: 58px;
    height: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.brand-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

.brand-name-entre {
    color: #f5f5f5;
}

.brand-name-motards {
    color: #e2342f;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    overflow: visible;
}

.actions, .filters {
    flex-shrink: 0;
    padding: 0;
    background: linear-gradient(165deg, rgba(36, 41, 50, 0.82), rgba(24, 27, 34, 0.82));
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.sidebar-card {
    overflow: hidden;
}

.sidebar-card-title {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    font-weight: 700;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-card-title::-webkit-details-marker {
    display: none;
}

.sidebar-card-title::after {
    content: "▾";
    color: var(--text-muted);
    font-size: 13px;
    transition: transform 0.2s ease;
}

.sidebar-card:not([open]) .sidebar-card-title::after {
    transform: rotate(-90deg);
}

.sidebar-card-body {
    padding: 0 14px 12px;
}

.legend h3, .actions h3, .filters h3 {
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: var(--brand);
    letter-spacing: 0.08em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--text);
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 2px solid rgba(255, 255, 255, 0.28);
}

.color-box.good {
    background: #22c55e;
}

.color-box.bad {
    background: #ef4444;
}

.color-box.unknown {
    background: var(--unknown);
}

.legend-line {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    display: inline-block;
}

.legend-line.curvy {
    background: transparent;
    width: 26px;
    height: 12px;
    border-radius: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12' fill='none'><path d='M1 6 C 5 0, 9 12, 13 6 S 21 0, 25 6' stroke='%23fe5f00' stroke-width='2.5' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.filter-item input {
    accent-color: var(--brand);
}

.sub-filter {
    margin-left: 12px;
    font-size: 12px;
}

.filter-stats {
    margin-top: 4px;
    color: var(--text-muted);
}

.actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.actions .sidebar-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.routing-options {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(19, 26, 36, 0.75);
    border: 1px solid rgba(120, 146, 179, 0.4);
    border-radius: 8px;
}

.routing-options > label {
    font-size: 12px;
    font-weight: 600;
    color: #bfccdf;
}

#routeStyleSelect {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
}

.routing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text);
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--brand);
    color: #1c1b1b;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(254, 95, 0, 0.35);
}

.btn-secondary {
    background: var(--surface-strong);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #353d49;
}

.btn-warning {
    background: var(--warn);
    color: #1c1b1b;
    font-weight: 700;
}

.btn-warning:hover {
    background: #d97706;
}

.btn.active {
    background: var(--brand);
    color: #1c1b1b;
    transform: translateY(-1px);
}

.btn:disabled,
.btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: #334155;
    color: #e2e8f0;
    border-color: var(--border);
}

.btn-info:hover {
    background: #425062;
}

#map {
    border-top: 0;
    position: relative;
    min-height: 100%;
    width: 100%;
    height: 100%;
}

.main-tabs {
    display: flex;
    gap: 4px;
    padding: 0 14px 10px;
    background: rgba(17, 19, 23, 0.9);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.main-tab {
    padding: 12px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.main-tab:hover {
    color: #ffd6be;
}

.main-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.main-view {
    min-height: 0;
}

.main-view--rides {
    background: transparent;
    padding: 0 14px;
}

.rides-page-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.rides-upload-card,
.rides-list-section {
    background: linear-gradient(165deg, rgba(36, 41, 50, 0.86), rgba(24, 27, 34, 0.86));
    border-radius: 12px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.rides-upload-card h2,
.rides-list-section h2 {
    font-size: 18px;
    color: var(--brand);
    margin-bottom: 10px;
}

.rides-lead {
    font-size: 14px;
    color: #c4cddd;
    line-height: 1.5;
    margin-bottom: 16px;
}

.rides-hint {
    font-size: 14px;
    color: #bcc7da;
    padding: 12px;
    background: rgba(20, 24, 31, 0.8);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
}

.shared-rides-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rides-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 8px 0;
}

.shared-ride-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: rgba(20, 24, 31, 0.72);
}

.shared-ride-card-title {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 6px;
}

.shared-ride-card-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.shared-ride-card-desc {
    font-size: 13px;
    color: #c9d2e1;
    line-height: 1.45;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.shared-ride-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.legend-dot.ride-start {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border: 2px solid #d9f2ef;
    box-shadow: 0 0 0 1px #0f766e;
}

.legend-dot.parking-moto {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 2px solid #dbeafe;
    box-shadow: 0 0 0 1px #1d4ed8;
}

.legend-dot.fuel-station {
    background: linear-gradient(135deg, #b45309, #d97706);
    border: 2px solid #ffedd5;
    box-shadow: 0 0 0 1px #92400e;
}

.legend-dot.viewpoint {
    background: linear-gradient(135deg, #047857, #10b981);
    border: 2px solid #d1fae5;
    box-shadow: 0 0 0 1px #065f46;
}

.legend-dot.photo-spot {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: 2px solid #ede9fe;
    box-shadow: 0 0 0 1px #6d28d9;
}

.parking-moto-marker-outer {
    background: transparent;
}

.parking-moto-marker-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #1d4ed8;
}

.fuel-station-marker-outer,
.viewpoint-marker-outer,
.toilets-marker-outer {
    background: transparent;
}

.fuel-station-marker-inner,
.viewpoint-marker-inner,
.toilets-marker-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 2px solid #fff;
}

.fuel-station-marker-inner {
    background: linear-gradient(135deg, #b45309, #ea580c);
    box-shadow: 0 0 0 1px #92400e;
}

.viewpoint-marker-inner {
    background: linear-gradient(135deg, #047857, #10b981);
    box-shadow: 0 0 0 1px #065f46;
}

.toilets-marker-inner {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    box-shadow: 0 0 0 1px #6d28d9;
}

.poi-marker-glyph {
    width: 13px;
    height: 13px;
    display: block;
    pointer-events: none;
}

.viewpoint-marker-inner .poi-marker-glyph {
    width: 14px;
    height: 14px;
}

.toilets-marker-inner .poi-marker-glyph {
    width: 13px;
    height: 13px;
}

.photo-spot-marker-outer {
    background: transparent !important;
    border: none !important;
}

.photo-spot-marker-inner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #6d28d9, 0 4px 10px rgba(124, 58, 237, 0.45);
}

.photo-spot-marker-inner .poi-marker-glyph {
    width: 17px;
    height: 17px;
}

.photo-spot-marker-inner--temp {
    font-size: 16px;
    line-height: 1;
    background: linear-gradient(135deg, #4338ca, #7c3aed);
    border-style: dashed;
    border-color: #fde68a;
}

.shared-ride-panel {
    z-index: 1101;
}

.shared-ride-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.shared-ride-desc {
    font-size: 14px;
    color: #cad2e0;
    line-height: 1.5;
    margin-bottom: 14px;
    white-space: pre-wrap;
    max-height: 40vh;
    overflow-y: auto;
}

.shared-ride-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shared-ride-panel-actions .btn {
    width: 100%;
    margin-bottom: 0;
}

.shared-ride-marker-outer {
    background: transparent !important;
    border: none !important;
}

.shared-ride-marker-inner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #182028;
    border: 2px solid #0f766e;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
}

.routing-panel {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 320px;
    max-height: 45vh;
    overflow: auto;
    background: rgba(19, 23, 30, 0.92);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1100;
}

.map-stage {
    position: relative;
    height: 100%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.map-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2500;
    border-radius: 999px;
    padding: 12px 16px;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.map-fab--photo {
    bottom: 70px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.map-fab--photo:hover {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
}

.map-fab--photo.active {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
}

.map-user-info {
    position: absolute;
    top: 14px;
    right: 60px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(15, 18, 24, 0.85);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.map-user-info span {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 0 4px;
    white-space: nowrap;
}

.map-user-info .btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 999px;
}

.routing-panel.hidden {
    display: none;
}

.routing-itinerary-stats {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #93c5fd;
}

.routing-itinerary-stats.hidden {
    display: none;
}

.routing-step-handle {
    cursor: grab;
    user-select: none;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 6px 4px 2px;
    flex-shrink: 0;
}

.routing-step-handle:active {
    cursor: grabbing;
}

.routing-step.routing-step--dragging {
    opacity: 0.55;
}

.routing-step.routing-step--drag-over {
    outline: 2px dashed #60a5fa;
    outline-offset: 2px;
    border-radius: 6px;
}

.routing-leg-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: -4px 0 10px 28px;
    padding: 8px 10px;
    background: rgba(51, 65, 85, 0.55);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
}

.routing-leg-row label {
    margin: 0;
    color: #cbd5e1;
    font-weight: 500;
}

.routing-leg-mode {
    min-width: 7rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
}

.routing-leg-meta {
    color: #e2e8f0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.routing-panel-header {
    margin-bottom: 8px;
    color: var(--text);
}

.routing-steps-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.routing-step {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    background: rgba(40, 47, 58, 0.45);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.routing-step-body {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px;
}

.routing-step-main {
    font-size: 12px;
    color: var(--text);
}

.routing-step-actions {
    display: flex;
    gap: 4px;
}

.routing-step-btn {
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 11px;
    cursor: pointer;
}

.routing-step-btn:hover {
    background: #3a4452;
}

.routing-panel-actions .btn {
    width: 100%;
}

.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(22, 26, 34, 0.97);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border);
    width: min(420px, calc(100vw - 32px));
    max-height: 85vh;
    overflow-y: auto;
    z-index: 2100;
    animation: infoPanelPop 0.22s ease;
}

.info-panel::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
    pointer-events: none;
}

.info-panel.hidden {
    display: none;
}

/* Panneau de détails de route : ancré à droite pour laisser l'itinéraire visible */
#infoPanel {
    top: 50%;
    left: auto;
    right: 16px;
    transform: translateY(-50%);
    animation: infoPanelSlideIn 0.22s ease;
}

#infoPanel::before {
    display: none;
}

@keyframes infoPanelPop {
    from {
        transform: translate(-50%, -48%) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes infoPanelSlideIn {
    from {
        transform: translateY(-50%) translateX(16px);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

.info-panel h3 {
    margin-bottom: 15px;
    color: var(--brand);
    font-size: 16px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #b3bece;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    background: rgba(8, 11, 16, 0.55);
    color: var(--text);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(254, 95, 0, 0.2);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    margin-top: 6px;
    text-transform: none;
}

.info-panel .btn {
    width: 100%;
    margin-bottom: 8px;
}

/* Leaflet Draw Customization */
.leaflet-draw-toolbar,
.leaflet-draw-actions {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .left-sidebar {
        max-height: 52vh;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-legend-banner {
        padding: 6px 8px 8px;
    }

    .sidebar-legend-grid {
        gap: 2px 6px;
    }

    .sidebar-legend-banner .legend-item {
        font-size: 9px;
    }

    .map-stage {
        min-height: 48vh;
    }

    .controls {
        padding: 10px;
    }

    .main-tabs {
        padding: 0 10px 8px;
    }

    .main-tab {
        font-size: 13px;
        padding: 10px 12px;
    }

    .routing-options {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .info-panel {
        width: calc(100vw - 20px);
        max-width: 420px;
        padding: 18px;
    }

    #infoPanel {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: none;
        width: auto;
        max-width: none;
        max-height: 60vh;
        animation: none;
    }

    .routing-panel {
        width: calc(100% - 20px);
        left: 10px;
        bottom: 10px;
        max-height: 36vh;
    }

    .map-fab {
        right: 12px;
        bottom: 12px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .map-fab--photo {
        bottom: 60px;
    }

    .map-user-info {
        top: 10px;
        right: 56px;
        padding: 6px 8px;
        gap: 6px;
    }

    .map-user-info span {
        font-size: 12px;
    }

    .map-user-info .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Signalements */
.report-marker {
    background: transparent !important;
    border: none !important;
}

.report-marker-inner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    background: #fff;
    border: 3px solid #ef4444;
    box-shadow:
        0 0 0 2px rgba(239, 68, 68, 0.35),
        0 4px 10px rgba(0, 0, 0, 0.55);
}

.routing-point {
    background: transparent !important;
    border: none !important;
    font-size: 20px;
}

.report-popup {
    max-width: 200px;
}

.report-popup h4 {
    margin-bottom: 8px;
    color: var(--text);
}

.report-popup p {
    color: #d2d8e3;
    margin-bottom: 8px;
    font-size: 13px;
}

.report-popup small {
    color: var(--text-muted);
    font-size: 11px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Mode routing */
.routing-mode-active {
    cursor: crosshair !important;
}

/* Vite modules: géocodage, sidebar mobile, historique admin */
.map-geocode-wrap {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 900;
    width: min(320px, calc(100% - 24px));
}

.map-geocode-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(21, 25, 32, 0.94);
    color: var(--text);
    font-size: 13px;
}

.map-geocode-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(21, 25, 32, 0.98);
    box-shadow: var(--shadow-lg);
}

.map-geocode-result {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.map-geocode-result:hover {
    background: rgba(254, 95, 0, 0.12);
}

.map-geocode-empty {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-toggle-btn {
    margin-left: auto;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
}

.left-sidebar header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.left-sidebar--collapsed {
    max-height: 52px !important;
    overflow: hidden;
}

.left-sidebar--collapsed .sidebar-scroll,
.left-sidebar--collapsed .sidebar-legend-banner,
.left-sidebar--collapsed .main-tabs {
    display: none;
}

.route-history-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.route-history-panel h4 {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.route-history-list {
    max-height: 140px;
    overflow-y: auto;
    font-size: 12px;
}

.route-history-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.route-history-empty,
.route-history-loading {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

@media (min-width: 769px) {
    .sidebar-toggle-btn {
        display: none;
    }
}

/* Auth modales & toasts (ex-index-api.html inline) */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(31, 36, 45, 0.92);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(23, 27, 34, 0.96);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.45);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e4e7ee;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #fe5f00;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-tab {
    flex: 1;
    padding: 10px;
    background: #2f3541;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #d5dbe8;
}

.modal-tab.active {
    background: #fe5f00;
    color: #1c1b1b;
}

.admin-dev-hint {
    font-size: 12px;
    color: #666;
    margin: 10px 0;
}

.auth-link-row {
    margin: 8px 0 12px;
    font-size: 12px;
}

.auth-link-row button {
    background: none;
    border: none;
    color: var(--brand);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-size: inherit;
}

.filter-item--spaced {
    margin-top: 8px;
}

#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 300px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(21, 25, 32, 0.96);
    font-size: 13px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(20px);
}

.toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon {
    background: #dcfce7;
}

.toast-error .toast-icon {
    background: #fee2e2;
}

.toast-warning .toast-icon {
    background: #fef9c3;
}

.toast-info .toast-icon {
    background: #dbeafe;
}

.toast-title {
    font-weight: 600;
    color: #e4e7ee;
    margin-bottom: 2px;
}

.toast-msg {
    color: #b6c0d1;
    line-height: 1.4;
}

.toast-close {
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    margin-left: auto;
    padding: 0 2px;
    background: none;
    border: none;
}

.toast-close:hover {
    color: #f3f4f6;
}

.toast-progress {
    height: 2px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.toast-success .toast-progress {
    background: #22c55e;
}

.toast-error .toast-progress {
    background: #ef4444;
}

.toast-warning .toast-progress {
    background: #eab308;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

.sidebar-footer-links {
    padding: 8px 14px 12px;
    font-size: 11px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.sidebar-footer-links a:hover {
    color: var(--brand);
}

.account-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

.btn-block:last-child {
    margin-bottom: 0;
}

.privacy-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    line-height: 1.6;
    color: var(--text);
}

.privacy-page h1 {
    color: var(--brand);
    margin-bottom: 16px;
}

.privacy-page h2 {
    margin-top: 24px;
    font-size: 1.1rem;
}

.privacy-page a {
    color: var(--brand);
}

.privacy-body {
    min-height: 100vh;
    overflow: auto;
    background: var(--bg);
}

.register-privacy-row {
    margin: 10px 0 14px;
    font-size: 12px;
    line-height: 1.4;
}

.register-privacy-row a {
    color: var(--brand);
}

.route-votes-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.route-votes-panel h4 {
    font-size: 13px;
    margin-bottom: 6px;
}

.route-votes-counts {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.route-votes-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.route-votes-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.report-panel-body {
    padding: 10px 0;
}

.report-panel-body p {
    margin-bottom: 6px;
}

.report-panel-expiry {
    color: var(--text-muted);
    font-weight: 600;
}

.report-votes-panel {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(15, 18, 24, 0.6);
    border: 1px solid var(--border);
}

.report-votes-panel h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
    margin-bottom: 8px;
}

.report-votes-counts {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 13px;
}

.report-votes-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.report-votes-count--confirm {
    color: #22c55e;
}

.report-votes-count--deny {
    color: #ef4444;
}

.report-votes-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.report-votes-actions .btn {
    flex: 1;
}

.report-votes-actions .btn.active {
    background: var(--brand);
    color: #1c1b1b;
    border-color: var(--brand);
}

.report-votes-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
}

.routing-weather-block {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 18, 24, 0.85);
    border: 1px solid var(--border);
    font-size: 12px;
}

.routing-weather-block.hidden {
    display: none;
}

.routing-weather-list {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--text-muted);
}

.routing-weather-attrib {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
}

.auth-form.hidden {
    display: none !important;
}

#loginForm.hidden {
    display: none !important;
}

.account-panel-info {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.account-panel-note {
    margin: 6px 0 0;
    font-size: 11px;
    text-align: center;
    color: var(--text-muted);
}

.account-panel-note a {
    color: var(--text-muted);
    text-decoration: underline;
}

.account-panel-note a:hover {
    color: var(--brand);
}

.delete-account-warning {
    margin: 0 0 16px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    color: #fecaca;
}

.consent-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2500;
    background: rgba(23, 27, 34, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: #e4e7ee;
    padding: 14px 16px;
    transition: opacity 0.25s ease;
}

.consent-banner.hidden {
    opacity: 0;
    pointer-events: none;
}

.consent-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

.consent-banner-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    flex: 1 1 320px;
}

.consent-banner-content a {
    color: var(--brand);
    text-decoration: underline;
}

.consent-banner-content .btn {
    flex: 0 0 auto;
    margin: 0;
}

@media (max-width: 560px) {
    .consent-banner-content {
        flex-direction: column;
        align-items: stretch;
    }

    .consent-banner-content .btn {
        width: 100%;
    }
}
