
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
        body, html { width: 100%; height: 100%; overflow: hidden; }
        #map { width: 100%; height: 100%; background: #e5e7eb; }

        #login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
        .login-box { background: #ffffff; padding: 25px 30px; border-radius: 8px; width: 340px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); text-align: center; }
        .login-box h2 { margin-bottom: 15px; color: #1e293b; font-size: 22px; }
        .login-box input { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 14px; }
        .btn { width: 100%; padding: 9px 10px; margin-top: 8px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px; transition: 0.2s; }
        .btn-primary { background: #dc2626; color: white; } .btn-primary:hover { background: #b91c1c; }
        .btn-secondary { background: #e2e8f0; color: #334155; } .btn-secondary:hover { background: #cbd5e1; }
        .btn-success { background: #16a34a; color: white; } .btn-success:hover { background: #15803d; }
        .btn-blue { background: #2563eb; color: white; } .btn-blue:hover { background: #1d4ed8; }
        .btn-purple { background: #9333ea; color: white; } .btn-purple:hover { background: #7e22ce; }

        #map-tools { position: absolute; top: 75px; left: 10px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
        .tool-wrap { position: relative; }
        .tool-btn { width: 38px; height: 38px; background: rgba(255, 255, 255, 0.96); border-radius: 6px; border: 1px solid #cbd5e1; box-shadow: 0 4px 10px rgba(0,0,0,0.15); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
        .tool-btn:hover { background: #f1f5f9; }
        .left-widget { display: none; position: absolute; top: 0; left: 45px; width: 320px; background: rgba(255, 255, 255, 0.96); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 12px; }
        .search-row { display: flex; gap: 6px; }
        .search-row input { flex: 1; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; }
        .search-row button { padding: 7px 12px; background: #0f172a; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; }
        #search-results { list-style: none; margin-top: 6px; max-height: 210px; overflow-y: auto; border-top: 1px solid #f1f5f9; display: none; }
        #search-results li { padding: 7px 6px; font-size: 12px; color: #334155; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
        #search-results li:hover { background: #f8fafc; color: #0f172a; font-weight: 500; }

        #sidebar { position: absolute; top: 15px; right: 15px; width: 360px; max-height: calc(100vh - 30px); background: rgba(255, 255, 255, 0.96); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 15px; overflow-y: auto; z-index: 1000; }
        .panel-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; margin-bottom: 12px; }
        .panel-header h3 { font-size: 17px; color: #0f172a; }
        .role-badge { font-size: 12px; padding: 3px 8px; border-radius: 12px; font-weight: bold; background: #e2e8f0; color: #475569; }
        .role-admin { background: #fef2f2; color: #dc2626; border: 1px solid #f87171; }
        
        details { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 8px; padding: 5px 10px; }
        summary { font-size: 13px; font-weight: 700; color: #334155; cursor: pointer; padding: 5px 0; outline: none; }
        summary:hover { color: #0f172a; }
        .layer-item { display: flex; align-items: center; margin: 7px 0; font-size: 13px; color: #334155; cursor: pointer; }
        .layer-item input { margin-right: 8px; cursor: pointer; }

        .form-group { margin-bottom: 7px; margin-top: 5px; }
        .form-group label { display: block; font-size: 11px; color: #475569; margin-bottom: 2px; font-weight: 600; }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; }
        
        .mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
        .mode-switch button { padding: 6px; font-size: 11px; margin-top: 0; }
        .active-mode { outline: 2px solid #0f172a; }

        .ol-popup { position: absolute; background-color: white; box-shadow: 0 3px 14px rgba(0,0,0,0.2); padding: 14px; border-radius: 8px; border: 1px solid #e2e8f0; bottom: 12px; left: -50px; min-width: 280px; max-width: 350px; font-size: 13px; color: #1e293b; }
        .ol-popup-closer { text-decoration: none; position: absolute; top: 6px; right: 10px; font-size: 16px; color: #64748b; font-weight: bold; }
        .ol-popup h4 { margin-bottom: 6px; color: #0f172a; padding-right: 15px; font-size: 14px; }
        .ol-popup p { margin: 4px 0; }
        
        .legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
        .legend-box { display: inline-block; width: 12px; height: 10px; margin-right: 5px; border: 1px solid #333; }
        .scale-block { display: inline-block; width: 16px; height: 10px; margin-right: 2px; border: 1px solid rgba(0,0,0,0.2); }
        .ol-scale-line { position: absolute; bottom: 20px; right: 20px; left: auto; background: rgba(15, 23, 42, 0.75); border-radius: 4px; padding: 4px 6px; }
        .ol-scale-line-inner { color: #ffffff; border-color: #ffffff; font-weight: 600; font-size: 11px; }

        /* Niezależna, ukrywalna legenda ostrzeżeń */
        #warning-legend { position: absolute; bottom: 30px; left: 15px; width: 280px; background: rgba(255, 255, 255, 0.96); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 12px; z-index: 900; font-size: 11px; color: #475569; line-height: 1.5; display: none; }
        #warning-legend h4 { color: #0f172a; margin-bottom: 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin-top: 0; }
        .legend-close { cursor: pointer; color: #64748b; font-size: 14px; }
        .legend-close:hover { color: #0f172a; }
    