    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-size: 14px;
      background: #1a1a2e;
      color: #e0e0e0;
    }

    /* ── Map ── */
    #map { position: fixed; inset: 0; z-index: 0; }

    /* ── Layout ── */
    #sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      width: 270px;
      z-index: 1000;
      background: rgba(12, 12, 25, 0.97);
      border-right: 1px solid rgba(255,255,255,0.08);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    #sidebar-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
    }
    #sidebar-scroll::-webkit-scrollbar { width: 4px; }
    #sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

    /* Map shifted right */
    #map { left: 270px; }

    /* Mobile toggle button + overlay */
    #mobile-toggle {
      position: fixed;
      top: 12px;
      left: 12px;
      z-index: 2100;
      background: rgba(12, 12, 25, 0.9);
      color: #e0e0e0;
      border: 1px solid rgba(255,255,255,0.1);
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      display: none;
      cursor: pointer;
    }
    #map-info-btn {
      position: fixed;
      top: 12px;
      right: 12px;
      z-index: 2100;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(12, 12, 25, 0.92);
      color: #e0e0e0;
      border: 1px solid rgba(255,255,255,0.1);
      font-size: 16px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    }
    #map-info-btn:hover { opacity: 0.85; }
    #map-info-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      z-index: 2200;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    #map-info-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }
    #map-info-modal {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: min(520px, 92vw);
      max-height: 80vh;
      overflow: hidden;
      z-index: 2300;
      background: rgba(12, 12, 25, 0.98);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 14px;
      box-shadow: 0 18px 40px rgba(0,0,0,0.6);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    #map-info-modal.active {
      opacity: 1;
      pointer-events: auto;
    }
    .map-info-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .map-info-header h3 {
      font-size: 14px;
      font-weight: 700;
      color: #fff;
    }
    #map-info-close {
      background: none;
      border: none;
      color: #94a3b8;
      font-size: 16px;
      cursor: pointer;
    }
    .map-info-body {
      padding: 14px 16px 18px;
      overflow-y: auto;
      max-height: calc(80vh - 52px);
      font-size: 12px;
      line-height: 1.5;
      color: #cbd5f5;
    }
    .map-info-body h4 {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #94a3b8;
      margin: 12px 0 6px;
    }
    .map-info-body ul { padding-left: 18px; margin-bottom: 8px; }
    .map-info-body li { margin-bottom: 4px; }
    .map-info-note { color: #94a3b8; margin-top: 10px; }
    .ocs-legend-list {
      display: grid;
      grid-template-columns: 1fr;
      gap: 6px;
      margin: 6px 0 4px;
      max-height: 180px;
      overflow-y: auto;
      padding-right: 4px;
    }
    .ocs-legend-list::-webkit-scrollbar { width: 3px; }
    .ocs-legend-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
    .ocs-legend-row {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      color: #e2e8f0;
    }
    .ocs-legend-image {
      max-width: 100%;
      height: auto;
      border-radius: 6px;
      border: 1px solid rgba(255,255,255,0.15);
    }
    .ocs-swatch {
      width: 12px;
      height: 12px;
      border-radius: 4px;
      border: 1px solid rgba(255,255,255,0.15);
      flex-shrink: 0;
    }
    .ocs-cs221 { background: #22c55e; }
    .ocs-cs212 { background: #84cc16; }
    .ocs-cs2111 { background: #38bdf8; }
    .ocs-cs2112 { background: #64748b; }
    .ocs-cs2113 { background: #0ea5e9; }
    .ocs-cs222 { background: #facc15; }
    .ocs-note { color: #f97316; font-size: 0.78em; margin-left: 4px; }
    .ocs-legend-panel label {
      margin-bottom: 8px;
    }
    #sidebar-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.55);
      z-index: 1500;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    #sidebar-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }
    #sidebar.open + #sidebar-overlay { opacity: 1; pointer-events: auto; }

    /* ── Panels (right side floating) ── */
    .panel {
      position: absolute;
      z-index: 1000;
      background: rgba(15, 15, 30, 0.92);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    }
    .panel h2, .sidebar-section h2 {
      font-size: 14px;
      font-weight: 600;
      color: #fff;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* ── Sidebar sections ── */
    .sidebar-section {
      margin-bottom: 20px;
    }
    .sidebar-divider {
      border: none;
      border-top: 1px solid rgba(255,255,255,0.07);
      margin: 16px 0;
    }

    /* Legacy — keep for compat */
    #filter-panel { display: none; }

    /* ── Sidebar onglets ── */
    #sidebar-tabs {
      display: flex;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      flex-shrink: 0;
    }
    .sidebar-tab {
      flex: 1;
      padding: 12px 0;
      text-align: center;
      font-size: 12px;
      font-weight: 600;
      color: #555;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.15s;
      user-select: none;
    }
    .sidebar-tab.active {
      color: #4ade80;
      border-bottom-color: #4ade80;
    }
    .sidebar-tab:hover:not(.active) { color: #94a3b8; }
    .sidebar-pane { display: none; }
    .sidebar-pane.active { display: block; }

    .filter-section { margin-bottom: 14px; }
    .filter-section > label {
      display: block;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: #666;
      margin-bottom: 7px;
    }
    .filter-inline {
      display: flex !important;
      align-items: center;
      gap: 8px;
      font-size: 11px !important;
      font-weight: 600 !important;
      color: #94a3b8 !important;
      text-transform: none !important;
      letter-spacing: normal !important;
      margin-bottom: 0 !important;
    }
    .filter-inline + .filter-inline {
      margin-top: 5px !important;
    }
    .filter-inline input {
      accent-color: #4ade80;
    }

    /* Barre de recherche communes */
    #commune-search {
      width: 100%; box-sizing: border-box;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 7px; color: #e0e0e0;
      padding: 5px 9px 5px 28px; font-size: 12px;
      outline: none; margin-bottom: 5px;
    }
    #commune-search::placeholder { color: #555; }
    #commune-search:focus { border-color: rgba(148,163,184,0.4); }
    .commune-search-wrap {
      position: relative;
    }
    .commune-search-wrap::before {
      content: '🔍'; font-size: 10px;
      position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
      pointer-events: none; line-height: 1;
    }

    /* Chips communes — défilables */
    #commune-chips {
      display: flex; flex-direction: column; gap: 4px;
      max-height: 160px; overflow-y: auto;
    }
    #commune-chips::-webkit-scrollbar { width: 3px; }
    #commune-chips::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
    .comm-chip {
      display: flex; align-items: center; gap: 7px;
      padding: 5px 9px; border-radius: 7px; font-size: 12px;
      cursor: pointer; border: 1px solid transparent;
      transition: all 0.13s; user-select: none;
      color: #94a3b8;
    }
    .comm-chip.active {
      background: rgba(148,163,184,0.15);
      border-color: rgba(148,163,184,0.25);
      color: #e0e0e0;
    }
    .comm-chip.inactive {
      background: rgba(255,255,255,0.03);
      color: #444;
    }
    .comm-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
    .comm-chip.inactive .comm-dot { opacity: 0.2; }

    /* Sliders */
    .slider-row { display: flex; align-items: center; gap: 8px; }
    #area-slider { flex: 1; accent-color: #4ade80; cursor: pointer; }
    #area-value { font-size: 12px; color: #4ade80; min-width: 50px; text-align: right; }

    /* Boutons */
    .btn-row { display: flex; gap: 6px; margin-top: 4px; }
    .btn {
      flex: 1; padding: 7px 0; border-radius: 8px;
      border: none; cursor: pointer;
      font-size: 12px; font-weight: 600;
      transition: opacity 0.15s;
    }
    .btn:hover { opacity: 0.8; }
    .btn-primary { background: #4ade80; color: #111; }
    .btn-ghost   { background: rgba(255,255,255,0.1); color: #aaa; }

    /* ── Info panel (bottom-right) ── */
    #info-panel {
      bottom: 36px; right: 12px;
      width: 230px;
      text-align: center;
    }
    .logo-text { font-size: 22px; margin-bottom: 2px; }
    .project-title { font-size: 13px; font-weight: 700; color: #fff; }
    .project-sub { font-size: 10px; color: #555; margin-bottom: 10px; }
    .stat-row { display: flex; justify-content: space-around; }
    .stat .value { font-size: 18px; font-weight: 700; color: #4ade80; }
    .stat .label { font-size: 10px; color: #555; text-transform: uppercase; }

    /* ── Légende gradient ── */
    .legend-gradient-bar {
      height: 10px; border-radius: 5px; margin: 6px 0 4px;
      background: linear-gradient(to right, #94a3b8, #bbf7d0, #86efac, #4ade80, #16a34a);
      border: 1px solid rgba(255,255,255,0.1);
    }
    .legend-gradient-labels { display: flex; justify-content: space-between; font-size: 10px; color: #555; }

    /* ── Itinéraire ── */
    .route-input {
      width: 100%; box-sizing: border-box;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 7px; color: #e0e0e0;
      padding: 7px 10px; font-size: 12px;
      outline: none; margin-bottom: 6px;
    }
    .route-input::placeholder { color: #555; }
    .route-input:focus { border-color: rgba(74,222,128,0.4); }
    .route-status {
      font-size: 11px; color: #555; margin: 4px 0 8px;
      min-height: 16px;
    }
    .route-status.ok  { color: #4ade80; }
    .route-status.err { color: #f87171; }
    .route-steps {
      margin-top: 10px;
      display: flex; flex-direction: column; gap: 5px;
    }
    .route-step {
      display: flex; align-items: flex-start; gap: 8px;
      font-size: 11px; color: #94a3b8;
      padding: 6px 8px;
      background: rgba(255,255,255,0.03);
      border-radius: 6px;
      border: 1px solid rgba(255,255,255,0.06);
      cursor: pointer;
    }
    .route-step:hover { background: rgba(74,222,128,0.07); border-color: rgba(74,222,128,0.2); }
    .route-step-num {
      width: 18px; height: 18px; border-radius: 50%;
      background: #4ade80; color: #111;
      font-size: 10px; font-weight: 800;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; margin-top: 1px;
    }
    .route-step-num.start { background: #60a5fa; }
    .route-step-num.end   { background: #f87171; }
    .route-step-info { flex: 1; }
    .route-step-name { font-weight: 600; color: #e0e0e0; }
    .route-step-meta { color: #555; margin-top: 2px; }
    .route-summary {
      margin-top: 8px; padding: 8px;
      background: rgba(74,222,128,0.07);
      border: 1px solid rgba(74,222,128,0.15);
      border-radius: 7px;
      font-size: 11px; color: #4ade80;
      display: flex; justify-content: space-around;
    }
    .route-summary span { text-align: center; }
    .route-summary strong { display: block; font-size: 14px; }

    /* ── Responsive ── */
    @media (max-width: 768px) {
      #sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        transition: left 0.2s ease;
        z-index: 2000;
      }
      #sidebar.open { left: 0; }
      #map { left: 0; }
      #mobile-toggle { display: block; }
    }
    #loading {
      position: fixed; inset: 0; z-index: 2000;
      background: #1a1a2e;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 14px;
    }
    #loading .sheep { font-size: 48px; animation: hop 0.9s ease infinite alternate; }
    #loading p { color: #555; font-size: 13px; }
    @keyframes hop { to { transform: translateY(-10px); } }

    /* ── Leaflet popup ── */
    .leaflet-popup-content-wrapper {
      background: rgba(12, 12, 25, 0.97) !important;
      border: 1px solid rgba(255,255,255,0.1) !important;
      border-radius: 10px !important;
      color: #e0e0e0 !important;
      box-shadow: 0 8px 32px rgba(0,0,0,0.7) !important;
      padding: 0 !important;
    }
    .leaflet-popup-content { margin: 0 !important; }
    .leaflet-popup-tip { background: rgba(12, 12, 25, 0.97) !important; }
    .popup-body { padding: 14px 16px; }
    .popup-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
    .popup-grid { display: grid; grid-template-columns: 80px 1fr; gap: 4px 8px; font-size: 12px; }
    .popup-grid .k { color: #666; }
    .popup-grid .v { color: #e0e0e0; font-weight: 500; }
    .popup-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
    .tag {
      display: inline-block; padding: 2px 8px; border-radius: 4px;
      font-size: 11px; font-weight: 500;
    }
    .tag-green  { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
    .tag-blue   { background: rgba(96,165,250,0.15); color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
    .tag-red    { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.35); }
    .tag-gray   { background: rgba(148,163,184,0.15); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); }
    .tag-orange { background: rgba(251,146,60,0.15);  color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
    .popup-footer {
      border-top: 1px solid rgba(255,255,255,0.07);
      padding: 8px 16px;
    }
    .popup-link { font-size: 11px; color: #4ade80; text-decoration: none; display: block; text-align: center; }
    .popup-link:hover { text-decoration: underline; }

    .popup-feedback {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed rgba(255,255,255,0.08);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .popup-feedback-title {
      font-size: 11px;
      font-weight: 700;
      color: #e0e0e0;
    }
    .popup-feedback-status {
      font-size: 11px;
      color: #94a3b8;
    }
    .popup-feedback-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .popup-feedback-btn {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      color: #94a3b8;
      font-size: 11px;
      padding: 4px 6px;
      border-radius: 6px;
      cursor: pointer;
    }
    .popup-feedback-btn.active {
      color: #e0e0e0;
      border-color: rgba(74,222,128,0.5);
      background: rgba(74,222,128,0.12);
    }
    .popup-feedback-text {
      width: 100%;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 6px;
      color: #e0e0e0;
      padding: 6px 8px;
      font-size: 11px;
      resize: vertical;
    }
    .popup-comment-form {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .popup-comment-input {
      width: 100%;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 6px;
      color: #e0e0e0;
      padding: 6px 8px;
      font-size: 11px;
    }
    .popup-comment-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 160px;
      overflow-y: auto;
      padding-right: 4px;
    }
    .popup-comment-list::-webkit-scrollbar { width: 3px; }
    .popup-comment-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
    .popup-comment-empty {
      font-size: 11px;
      color: #555;
    }
    .popup-comment-item {
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 6px;
      padding: 6px 8px;
      font-size: 11px;
      color: #e0e0e0;
    }
    .popup-comment-head {
      display: flex;
      justify-content: space-between;
      color: #94a3b8;
      font-size: 10px;
      margin-bottom: 4px;
    }
    .popup-comment-author { font-weight: 600; color: #e0e0e0; }
    .popup-comment-date { color: #555; }
    .popup-comment-text { line-height: 1.4; }
    .popup-feedback-save {
      align-self: flex-start;
      background: rgba(96,165,250,0.2);
      color: #60a5fa;
      border: 1px solid rgba(96,165,250,0.4);
      font-size: 11px;
      padding: 4px 10px;
      border-radius: 6px;
      cursor: pointer;
    }

