    html, body {
      margin: 0; padding: 0;
      height: 100vh;
      font-family: Arial, sans-serif;
      display: flex;
      flex-direction: column;
    }
    #map {
      flex-grow: 1;
      width: 100%;
      position: relative;
    }
    /* Panel ostrzeżeń po lewej */
    #alertsPanel {
      position: fixed;
      top: 10%;
      left: 240px;
      width: 450px;
      max-height: 87vh;
      overflow-y: auto;
      background: white;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
      padding: 15px;
      z-index: 7000;
      font-size: 15px;
    }
    #alertsPanel h4 {
      margin-top: 0;
      margin-bottom: 10px;
      font-weight: bold;
      font-size: 18px;
      color: #004080;
      text-align: center;
    }
    .alertItem {
      padding: 10px 12px;
      border-radius: 6px;
      margin-bottom: 12px;
      box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
      cursor: default;
    }
    .alertItem:hover {
      box-shadow: inset 0 0 12px rgba(0,0,0,0.15);
    }
    .alertTitle {
      font-weight: bold;
      font-size: 16px;
      margin-bottom: 6px;
      color: #004080;
    }
    .scale1 { background-color: #adebad; color: #000; }
    .scale2 { background-color: #ffff7d; color: #000; }
    .scale3 { background-color: #ffbb33; color: #000; }
    .scale4 { background-color: #ef5350; color: white; }
    .scale4 strong, .scale4 .alertTitle { color: white !important; }
     
    #legend {
      position: fixed;
      bottom: 60px;
      right: 15px;
      background: white;
      padding: 10px 15px;
      border-radius: 6px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.2);
      font-size: 14px;
      z-index: 5000;
      max-width: 220px;
    }
    #legend h4 {
      margin-bottom: 8px;
      color: #0077cc;
    }
    .legend-item {
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .color-box {
      width: 20px;
      height: 20px;
      border-radius: 3px;
      flex-shrink: 0;
    }

    /* Popup styling */
    .leaflet-popup-content-wrapper {
      border-radius: 12px !important;
      font-family: Arial, sans-serif !important;
      min-width: 320px !important;
    }

    /* --- ZMIANY MOBILNE --- */
    #mobileLegendUnder {
      display: none;
      background: white;
      padding: 15px;
      border-top: 1px solid #ddd;
    }

    @media (max-width: 768px) {
      body { overflow-y: auto; height: auto; display: block; }
      
      #map { 
        height: 60vh !important;
        width: 100% !important;
        flex: none;
      }

      #alertsPanel {
        position: relative; 
        top: 0; 
        left: 0; 
        width: 100%;
        max-height: none; 
        overflow-y: visible;
        box-shadow: none; 
        border-top: 1px solid #ddd;
        border-radius: 0;
        padding: 15px;
        box-sizing: border-box;
      }
      
      #legend { display: none; }
      #mobileLegendUnder { display: block; }
      
      .leaflet-popup-content-wrapper {
        min-width: 260px !important;
        max-width: 85vw !important;
      }
    }