/* Pełna wersja poprawionego weather-new.css z uwzględnieniem nowych stylów dla przycisków dni */

/* Tooltipy ostrzegawcze na mapie */
.weather-warning-tooltip {
    background-color: rgba(255, 255, 255, 1) !important;
    border: 1px solid #dc2626 !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 4px rgba(220, 38, 38, 0.5) !important;
    padding: 3px 4px !important;
    z-index: 1000 !important;
}

.weather-warning-tooltip::before {
    display: none !important; /* Ukryj strzałkę dla lepszej czytelności */
}

.warning-tooltip-content {
    white-space: nowrap;
    animation: warning-pulse 1.5s infinite;
}

@keyframes warning-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Strzałki nawigacji na mapie */
.map-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #007bff;
    cursor: pointer;
    z-index: 9999999 !important;
    transition: all 0.3s ease;
    box-shadow: none;
    pointer-events: auto !important;
}

/* Widoczna część strzałki - wewnętrzny element */
.map-arrow::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #007bff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    pointer-events: none;
}

.map-arrow i {
    position: relative;
    z-index: 1;
}

.map-arrow:hover::before {
    background: #007bff;
    transform: scale(1.1);
}

.map-arrow:hover {
    color: white;
}

.map-arrow:active::before {
    transform: scale(0.95);
}

.map-arrow-left {
    left: 20px;
}

.map-arrow-right {
    right: 20px;
}

.map-arrow i {
    pointer-events: none;
}

.map-arrow[style*="opacity: 0.3"] {
    cursor: not-allowed;
    color: #999;
}

.map-arrow[style*="opacity: 0.3"]::before {
    background: rgba(200, 200, 200, 0.5);
    border-color: #ccc;
}

.map-arrow[style*="opacity: 0.3"]:hover::before {
    background: rgba(200, 200, 200, 0.5);
    transform: none;
}

/* Główny kontener */
.weather-container {
    width: 100%;
    height: calc(100vh - 60px);
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.weather-content {
    flex-grow: 1;
    display: flex;
    padding: 0;
    height: 100%;
}

.weather-row {
    display: flex;
    flex-grow: 1;
    gap: 10px;
    min-height: 100%;
    max-height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

/* Panel województw – dopasowany do widoku, logo i kontakt zawsze widoczne */
.voivodeship-panel {
    width: 280px;
    display: flex;
    flex-direction: row;
    background: #0096d6;
    color: white;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    min-height: 0;
    /* Ogranicz wysokość do viewportu, żeby stopka (logo, mail, tel) nie zjeżdżała poza ekran */
    height: 100%;
    max-height: calc(100vh - 120px);
}
.voivodeship-panel .region-container {
    min-height: 0;
    flex: 1 1 0;
    overflow: hidden;
}
/* Baner CUMULUS – przylega do dolnej krawędzi panelu, przyciski mają więcej miejsca */
.time-panel .panel-cumulus {
    flex-shrink: 0;
    margin-top: auto;
    background: linear-gradient(180deg, #0073b7 0%, #005a8c 100%);
    padding: 10px 8px;
    color: #fff;
    border-radius: 6px;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }


  .logo-cumulus {
    display: block;
    margin: 0 auto;
    width: 150px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;

    /* efekt 3D: cień i lekka perspektywa */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .logo-cumulus:hover {
    transform: scale(1.2) rotateX(3deg) rotateY(3deg);
    box-shadow: 0 10px 20px rgba(0, 140, 186, 0.4);
  }


  .address-cumulus {
    width: 100%;
    text-align: center;
    margin-top: .4rem;
  }

.time-panel .panel-cumulus .address-cumulus {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
.time-panel .panel-cumulus .address-cumulus a {
    color: #fff;
    font-weight: 500;
  }

/* Pionowy napis "LOKALIZACJE" */
.vertical-label {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    padding: 10px 5px;
    font-weight: bold;
    font-size: 16px;
    background: #0073b7;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

/* Kontener z przełącznikiem i regionami */
.region-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Lewy panel: lista oddziałów przewijana, logo/contact na dole ekranu */
.voivodeship-panel {
    min-height: 0;
}
.region-container--with-footer {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.branches-list-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
}
.region-container--with-footer .panel-cumulus {
    flex-shrink: 0;
    margin-top: auto;
    padding: 8px;
}

/* Przełącznik Polska/Bałtyk */
.region-toggle {
    display: flex;
    background: #0073b7;
    border-radius: 20px;
    margin-bottom: 10px;
    margin-top: 10px;
    padding: 2px;
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 5px 10px;
    z-index: 1;
    transition: color 0.3s;
    cursor: pointer;
}

.toggle-option.active {
    color: #0073b7;
}

.toggle-slider {
    position: absolute;
    width: 50%;
    height: 100%;
    background: white;
    border-radius: 18px;
    transition: transform 0.3s;
}

.toggle-slider.baltic {
    transform: translateX(100%);
}

/* Grupy regionów */
.region-groups {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Obszar przewijania dla województw */
.scrollable-regions {
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(100vh - 180px);
    /* Pasek przewijania */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 115, 183, 0.2);
}

.scrollable-regions::-webkit-scrollbar {
    width: 6px;
}

.scrollable-regions::-webkit-scrollbar-track {
    background: rgba(0, 115, 183, 0.2);
}

.scrollable-regions::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

/* Panel mapy – ta sama wysokość co panele boczne (viewport), elegancko */
.map-panel {
    flex-grow: 1;
    min-height: 0;
    max-height: calc(100vh - 120px);
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

#weather-map {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #e8f4f8;
}

/* Panel czasu – wypełnia wysokość, wizytówka na dole */
.time-panel {
    width: 350px;
    background: #f5f5f5;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    align-self: stretch;
}

.weather-header {
    background: linear-gradient(180deg, #0096d6 0%, #0073b7 100%);
    padding: 3px;
    color: white;
    border-radius: 4px 4px 0 0;
}

.search-bar {
    background: rgb(229, 246, 248);
    padding: 5px;
    border-radius: 5px;
    color: #055888;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-bar input {
    border: none;
    padding: 5px;
    flex-grow: 1;
    outline: none;
    width: 100%;
    background: transparent;
}

.search-bar button {
    border: none;
    background: none;
    color: #0073b7;
    padding: 5px 10px;
    cursor: pointer;
}

.panel-header {
    background: #0073b7;
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    margin: 10px;
    font-weight: bold;
    font-size: 14px;
}

/* Przyciski województw */
.voivodeship-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s ease;
}

.voivodeship-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.voivodeship-btn.active {
    background: #00a8e8;
    border-color: white;
}

/* Selektor interwału */
.interval-selector {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px;
    display: flex;
    justify-content: space-between;
}

.interval-btn {
    padding: 6px 4px;
    background: #e8f4f8;
    color: #055888;
    border: 1px solid #b3d9e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    flex: 1;
    margin: 0 2px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.interval-btn.active {
    background: linear-gradient(135deg, #0096d6 0%, #0073b7 100%);
    color: white !important;
    border-color: #005a8a;
    box-shadow: 0 4px 8px rgba(0, 115, 183, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.interval-btn:hover:not(.active) {
    background: linear-gradient(135deg, #00a8e8 0%, #0096d6 100%);
    color: white !important;
    border-color: #0073b7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 168, 232, 0.3);
}

/* Przyciski dni i godzin – zajmują całą dostępną przestrzeń nad wizytówką */
#time-buttons {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 10px 10px 10px;
}

/* Zakładki dni - poprawiona wersja */
.days-tabs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* Przycisk dnia z datą i nazwą dnia tygodnia */
.day-tab {
    padding: 2px 4px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s ease;
    height: auto;
    min-height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.day-tab-date {
    font-weight: bold;
    margin-bottom: 1px;
    font-size: 10px;
}

.day-tab-name {
    font-size: 9px;
    color: #555;
}

.day-tab.active {
    background: #0073b7;
    color: white;
}

.day-tab.active .day-tab-name {
    color: rgba(255, 255, 255, 0.9);
}

.day-tab:hover:not(.active):not(.disabled) {
    background: #e0e0e0;
}

.day-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.day-tab.disabled:hover {
    background: #f5f5f5;
}

/* Separator między przyciskami dziennymi a godzinowymi */
.hours-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 150, 214, 0.3) 20%, rgba(0, 150, 214, 0.5) 50%, rgba(0, 150, 214, 0.3) 80%, transparent 100%);
    margin: 8px 10px;
    border-radius: 1px;
}

/* Kontener na godziny */
.hours-container {
    margin-top: 10px;
    overflow-y: auto;
}

/* Siatka przycisków godzin */
.hours-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 3px;
}

/* Siatka dla trybu 12h (tylko 2 przyciski - Dzień i Noc) - wypełniają całą linię */
.hours-grid.hours-grid-12h {
    display: flex !important;
    gap: 6px !important;
}

/* Przyciski w trybie 12h wypełniają całą dostępną szerokość (po 50% każdy) */
.hours-grid.hours-grid-12h .time-btn,
div.hours-grid.hours-grid-12h button.time-btn,
#time-buttons .hours-grid.hours-grid-12h .time-btn,
#time-buttons div.hours-grid.hours-grid-12h button.time-btn {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.time-btn {
    padding: 5px 4px;
    background: #e8f4f8;
    color: #055888;
    border: 1px solid #b3d9e6;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-height: 32px;
}

.time-btn:hover {
    background: linear-gradient(135deg, #00a8e8 0%, #0096d6 100%);
    color: white;
    border-color: #0073b7;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 168, 232, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.time-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 4px rgba(0, 168, 232, 0.3);
}

.time-btn.active {
    background: linear-gradient(135deg, #0096d6 0%, #0073b7 100%);
    color: white;
    border-color: #005a8a;
    box-shadow: 0 2px 6px rgba(0, 115, 183, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* Info o dacie i godzinie prognozy */
.weather-date-time-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: normal;
    color: #0073b7;
    font-size: 11px;
    z-index: 990;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid rgba(0, 115, 183, 0.2);
    max-width: 300px;
    line-height: 1.3;
}

/* Info o wschodzie/zachodzie słońca na środku górnej krawędzi */
.weather-sun-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 990;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid rgba(0, 115, 183, 0.2);
    display: flex;
    gap: 12px;
    align-items: center;
}

.weather-sun-info .sun-info {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.weather-sun-info .sun-info i {
    font-size: 12px;
}

.weather-date-time-info .forecast-date {
    font-weight: normal;
    margin-bottom: 4px;
    font-size: 12px;
}

.weather-date-time-info .sun-times {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 10px;
    border-top: 1px solid rgba(0, 115, 183, 0.1);
    padding-top: 4px;
}

.weather-date-time-info .sun-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-date-time-info .sun-time i {
    font-size: 11px;
}

.weather-date-time-info .sun-time .text-warning {
    color: #ffc107;
}

.weather-date-time-info .sun-time .text-info {
    color: #17a2b8;
}

.weather-date-time-info .gfs-info {
    font-size: 10px;
    color: #666;
    font-style: italic;
}

/* Pogoda i markery – podest na temp + ikonę + nazwę; min-width żeby nic nie wystawało */
.weather-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-width: 106px;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 115, 183, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0;
    cursor: pointer;
    opacity: 0.95;
    transition: transform 0.2s ease, background-color 0.3s ease;
    z-index: 100;
}

.weather-marker.day-mode {
    background-color: rgba(235, 245, 255, 0.95);
    border-color: rgba(0, 115, 183, 0.2);
}

.weather-marker.night-mode {
    background-color: rgba(230, 230, 230, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Publiczna mapa — tryb „pozostałe”: brak paddingu/marginesów na kafelku (mniejszy bbox bez utraty treści) */
#weather-map .weather-marker.map-param-mode-other {
    padding: 0 !important;
    margin: 0 !important;
    /* Bez space-between: inaczej nadmiar wysokości iconSize daje „pusty pas” 2–3 mm w środku kafelka */
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 0 !important;
}

#weather-map .weather-marker.map-param-mode-other .weather-details {
    padding: 0 !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
}

#weather-map .weather-marker.map-param-mode-other .city-name-container {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: stretch !important;
    text-align: center !important;
}

#weather-map .weather-marker.map-param-mode-other .city-name-container .city-name {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    line-height: 1.05 !important;
}

@media (hover: hover) {
    .weather-marker:hover {
        transform: scale(1.1);
        z-index: 9999 !important;
        opacity: 1;
    }
}

.weather-marker.position-adjusted {
    z-index: 200;
    opacity: 0.9;
}

.weather-marker.position-adjusted .city-name-container {
    border-color: #ff6b35;
    background-color: #fff3cd80;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.weather-marker.position-adjusted .adjust-indicator {
    color: #ff6b35;
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
    text-align: center;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 16px;
    margin-left: auto;
    margin-right: auto;
}

@media (hover: hover) {
    .weather-marker:hover {
        border-color: #0073b7;
        border-width: 4px;
        box-shadow: 0 0 8px rgba(0, 115, 183, 0.6);
    }
}

.city-name-container {
    padding: 0px 4px;
    margin-top: -6px; /* Otoczka lekko nachodzi na nazwę miejscowości */
    margin-bottom: 2px;
    width: fit-content;
    min-width: 100px;
    max-width: none;
    text-align: center;
    z-index: 10;
    background-color: transparent;
    border: none;
    box-shadow: none;
    white-space: nowrap;
    line-height: 1.1;
}

.city-name {
    font-size: 15px;
    font-weight: normal;
    font-style: normal;
    color: #000;
    text-shadow: none;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    word-wrap: normal;
    display: inline-block;
    width: fit-content;
    max-width: none;
}

.weather-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    padding: 0 4px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

.temp {
    font-size: 30px;
    font-weight: normal;
    font-style: normal;
    color: #cc340e;
    margin-right: 2px;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
    line-height: 1;
}

.weather-icon-container {
    line-height: 0;
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    padding: 4px; /* +~5% względem 3px – tło pod ikoną większe */
    transition: background-color 0.3s ease;
}

.day-mode .weather-icon-container {
    background-color: rgba(100, 180, 240, 0.45);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
}

.night-mode .weather-icon-container {
    background-color: rgba(80, 80, 80, 0.4);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.1);
}

.weather-icon-container img {
    display: block;
    margin: 0;
    width: 44px;
    height: 44px;
}

/* Style dla Baltic */
#baltic-regions button {
    background-color: rgba(0, 115, 183, 0.2);
}

#baltic-regions button:hover {
    background-color: rgba(0, 115, 183, 0.3);
}

#baltic-regions button.active {
    background-color: #0073b7;
    color: white;
}

/* Media queries – czytelność mapy na mobile */
@media (max-width: 768px) {
    .weather-marker {
        min-width: 36px;
        padding: 1px;
    }

    .weather-details {
        min-width: 50px;
    }

    .temp {
        font-size: 13px;
        margin-right: 1px;
    }

    .weather-icon-container img {
        width: 15px;
        height: 15px;
    }

    .city-name {
        font-size: 8px;
    }

    .city-name-container {
        min-width: 36px;
    }

}

@media (max-width: 768px) and (hover: hover) {
    .weather-marker:hover {
        transform: scale(1.08);
    }
}

@media (max-width: 480px) {
    .weather-marker {
        min-width: 32px;
        padding: 0 1px;
    }

    .weather-details {
        min-width: 44px;
    }

    .temp {
        font-size: 11px;
    }

    .weather-icon-container img {
        width: 12px;
        height: 12px;
    }

    .city-name {
        font-size: 7px;
    }

    .city-name-container {
        min-width: 32px;
        padding: 0 2px;
    }
}

@media (max-width: 1200px) {
    .weather-row {
        flex-wrap: wrap;
    }

    .voivodeship-panel {
        width: 100%;
        max-width: 100%;
        order: 1;
    }

    .map-panel {
        width: 100%;
        order: 2;
        min-height: 500px;
    }

    .time-panel {
        width: 100%;
        max-width: 100%;
        order: 3;
    }

    .voivodeship-panel {
        flex-direction: row;
    }

    .vertical-label {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 5px;
        margin-right: 10px;
        margin-bottom: 0;
        height: auto;
    }

    .scrollable-regions {
        max-height: none;
        display: flex;
        flex-wrap: wrap;
    }

    .voivodeship-btn {
        width: calc(25% - 5px);
        margin: 2px;
    }

    .hours-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .time-btn {
        padding: 6px 5px;
        font-size: 12px;
        min-height: 35px;
    }

    .day-tab {
        min-height: 35px;
        padding: 2px 3px;
    }

    .day-tab-date {
        font-size: 9px;
    }

    .day-tab-name {
        font-size: 8px;
    }

    .interval-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
}

@media (max-width: 992px) {
    .hours-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-btn {
        padding: 11px 7px;
        font-size: 13px;
        min-height: 42px;
    }
}

/* Menu hamburger dla małych ekranów */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1000;
    background: #0096d6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: #0073b7;
    transform: scale(1.05);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 9999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
    left: 0;
}

.mobile-menu-header {
    background: #0096d6;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 18px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    padding: 15px;
    background: white;
}

.mobile-menu-content > div {
    display: block !important;
    visibility: visible !important;
}

.mobile-menu-content .voivodeship-panel,
.mobile-menu-content .time-panel {
    width: 100%;
    position: relative;
    height: auto;
    margin-bottom: 20px;
    display: block !important;
    visibility: visible !important;
}

.mobile-menu-content .region-container {
    width: 100%;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
}

.mobile-menu-content .region-toggle {
    display: flex !important;
    visibility: visible !important;
}

.mobile-menu-content .region-groups {
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
}

.mobile-menu-content .scrollable-regions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 5px;
    max-height: none;
    overflow-y: visible;
    visibility: visible !important;
}

.mobile-menu-content .voivodeship-btn {
    display: block !important;
    visibility: visible !important;
    flex: 1 1 calc(33.33% - 4px);
    min-width: calc(33.33% - 4px);
    margin: 0;
    padding: 5px 3px;
    background: #0096d6;
    color: white;
    border: 1px solid #0073b7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}

.mobile-menu-content .voivodeship-btn:hover {
    background: #0073b7;
}

.mobile-menu-content .interval-selector {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    margin-bottom: 10px;
    justify-content: space-between !important;
}

.mobile-menu-content .interval-btn {
    flex: 1 1 auto !important;
    padding: 4px 6px;
    font-size: 11px;
    min-height: 28px;
    width: auto !important;
    min-width: 0 !important;
}

.mobile-menu-content .day-tab {
    min-height: 32px;
    padding: 2px 3px;
    font-size: 10px;
}

.mobile-menu-content .day-tab-date {
    font-size: 9px;
}

.mobile-menu-content .day-tab-name {
    font-size: 8px;
}

.mobile-menu-content .time-btn {
    padding: 4px 3px;
    font-size: 10px;
    min-height: 28px;
}

.mobile-menu-content .hours-grid {
    gap: 3px;
}

.mobile-menu-content .days-tabs-grid {
    gap: 3px;
    margin-bottom: 8px;
}

.mobile-menu-content .panel-cumulus {
    display: block !important;
    visibility: visible !important;
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(180deg, #0096d6 0%, #0073b7 100%) !important;
    border-radius: 5px;
    color: white !important;
}

.mobile-menu-content .panel-cumulus a {
    color: white !important;
}

.mobile-menu-content .panel-cumulus .address-cumulus {
    color: white !important;
}

.mobile-menu-content .region-groups {
    display: flex;
    flex-direction: column;
}

.mobile-menu-content #poland-regions,
.mobile-menu-content #poland-regions-mobile,
.mobile-menu-content #baltic-regions,
.mobile-menu-content #baltic-regions-mobile {
    display: flex;
    flex-direction: column;
}

/* Wymuś ukrycie gdy style inline mówi display: none */
.mobile-menu-content #poland-regions[style*="display: none"],
.mobile-menu-content #poland-regions-mobile[style*="display: none"] {
    display: none !important;
}

.mobile-menu-content #baltic-regions[style*="display: none"],
.mobile-menu-content #baltic-regions-mobile[style*="display: none"] {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .voivodeship-panel,
    .time-panel {
        display: none !important;
    }

    .voivodeship-panel.mobile-visible,
    .time-panel.mobile-visible {
        display: flex !important;
    }

    .weather-row {
        flex-direction: column;
    }

    .map-panel {
        order: -1; /* Mapa na górze */
        width: 100%;
        min-height: 50vh;
        height: 50vh;
    }

    .voivodeship-btn {
        width: calc(33.33% - 5px);
    }

    .days-tabs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .day-tab {
        min-height: 45px;
    }

    .hours-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .time-btn {
        padding: 8px 6px;
        font-size: 13px;
        min-height: 40px;
    }

    .day-tab {
        min-height: 40px;
        padding: 3px 4px;
    }

    .day-tab-date {
        font-size: 10px;
    }

    .day-tab-name {
        font-size: 9px;
    }

    .interval-btn {
        padding: 5px 7px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .mobile-menu {
        width: 90%;
    }

    .voivodeship-btn {
        width: calc(50% - 5px);
    }

    .days-tabs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hours-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .time-btn {
        padding: 10px 7px;
        font-size: 14px;
        min-height: 45px;
    }

    .day-tab {
        min-height: 42px;
        padding: 3px 4px;
    }

    .day-tab-date {
        font-size: 10px;
    }

    .day-tab-name {
        font-size: 9px;
    }

    .interval-selector {
        flex-wrap: wrap;
        gap: 4px;
    }

    .interval-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Style dla ikon markerów Leaflet – rozmiar z iconSize, zawartość wypełnia ramkę */
.weather-icon-marker {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
}

/*
 * Tryb „pozostałe” na #weather-map: bez rozciągania .weather-marker na całą wysokość iconSize —
 * inaczej biały kafel ma pusty pas na dole (~2 mm), bo tło wypełnia bbox wyższy niż treść.
 */
#weather-map .weather-icon-marker.weather-icon-marker--other-param {
    align-items: flex-start !important;
}

#weather-map .weather-icon-marker.weather-icon-marker--other-param > .weather-marker {
    height: auto !important;
    min-height: 0 !important;
}

/* Usuń wszystkie ramki z divIcon Leaflet dla markerów ostrzeżeń */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.warnings-mode-marker + .leaflet-div-icon,
.weather-icon-marker.warnings-mode-marker,
.leaflet-div-icon .warnings-mode-marker {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Otoczka markera wypełnia całą ramkę (iconSize) */
.weather-icon-marker > div.weather-marker {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: center !important;
}

/*
 * Mobile: bez overflow:hidden na całym markerze — przy małym iconSize z JS obcinało całą treść.
 */
@media (max-width: 768px) {
    .weather-icon-marker > div.weather-marker {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .weather-icon-marker .weather-details {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
        padding: 0 1px !important;
    }

    .weather-icon-marker .city-name-container {
        min-width: 0 !important;
        max-width: 100% !important;
        margin-top: 0 !important;
        padding: 0 1px !important;
        box-sizing: border-box !important;
    }

    .weather-icon-marker .city-name {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: block !important;
    }

    .weather-icon-marker .weather-icon-container {
        padding: 1px !important;
        flex-shrink: 0 !important;
    }

    .weather-icon-marker .warning-squares-wrapper {
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .weather-icon-marker .warning-squares-container {
        transform: scale(0.44);
        transform-origin: top center;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .weather-icon-marker .warning-squares-container {
        transform: scale(0.38);
    }
}

/*
 * Publiczna mapa mobile: temperatura + ikona bez białego „kafelka” (widać nazwy OSM),
 * kolorystyka MeteoMax + cień dla czytelności. Tylko #weather-map — nie „moja mapa” / ostrzeżenia.
 */
@media (max-width: 768px) {
    #weather-map .weather-marker.weather-marker--minimal-mobile {
        min-width: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    #weather-map .weather-marker--minimal-mobile.day-mode,
    #weather-map .weather-marker--minimal-mobile.night-mode {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    #weather-map .weather-marker--minimal-mobile .weather-details {
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important;
    }

    #weather-map .weather-marker--minimal-mobile .temp {
        /* Większa, „chudsza” czcionka: 300 + brak sztucznego pogrubienia; cień bez szerokiej poświaty (wygląda jak bold) */
        font-size: calc(19px + 1pt) !important;
        font-weight: 300 !important;
        font-synthesis: none !important;
        color: #8c2208 !important;
        text-shadow: 0 1px 1px rgba(255, 255, 255, 0.95), 0 0 1px rgba(0, 0, 0, 0.2) !important;
        margin-right: 0 !important;
        line-height: 1 !important;
        -webkit-font-smoothing: antialiased;
    }

    #weather-map .weather-marker--minimal-mobile.night-mode .temp {
        color: #b45309 !important;
        text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 1px rgba(0, 0, 0, 0.35) !important;
    }

    #weather-map .weather-marker--minimal-mobile .weather-icon-container {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    #weather-map .weather-marker--minimal-mobile .weather-icon-container img {
        width: 21px !important;
        height: 21px !important;
    }

    /* Tryb „pozostałe”: panel z większym paddingiem (tekst z weather-map-custom @768) */
    #weather-map .weather-marker--minimal-mobile.weather-marker--minimal-panel {
        background: rgba(255, 255, 255, 0.78) !important;
        border: 1px solid rgba(0, 115, 183, 0.14) !important;
        border-radius: 4px !important;
        padding: 2px 4px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07) !important;
    }

    #weather-map .weather-marker--minimal-mobile.weather-marker--minimal-panel.map-param-mode-other {
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 4px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        border: 1px solid rgba(0, 115, 183, 0.22) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    #weather-map .weather-marker--minimal-mobile.map-param-mode-other .weather-details {
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    #weather-map .weather-marker--minimal-mobile.weather-marker--minimal-panel.night-mode {
        background: rgba(245, 245, 245, 0.88) !important;
        border-color: rgba(0, 0, 0, 0.12) !important;
    }

    #weather-map .weather-marker.map-param-mode-other .city-name-container .city-name {
        font-size: 11px !important;
        font-weight: 600 !important;
        color: #0f172a !important;
    }

    /* Mobile: nadpisanie paddingu z .weather-icon-marker .weather-details (0 1px) — na kafelku „pozostałe” = 0 */
    #weather-map .weather-icon-marker .weather-marker.map-param-mode-other .weather-details,
    #weather-map .weather-icon-marker .weather-marker.map-param-mode-other .city-name-container {
        padding: 0 !important;
    }

    #weather-map .weather-icon-marker .weather-marker.map-param-mode-other {
        justify-content: flex-start !important;
        gap: 0 !important;
    }
}

@media (max-width: 480px) {
    #weather-map .weather-marker--minimal-mobile .temp {
        font-size: calc(17px + 1pt) !important;
        font-weight: 300 !important;
        font-synthesis: none !important;
    }

    #weather-map .weather-marker--minimal-mobile .weather-icon-container img {
        width: 19px !important;
        height: 19px !important;
    }
}

/* Tooltip z nazwą miasta (hover / przytrzymanie na markerze) */
.leaflet-tooltip.weather-marker-city-tooltip {
    padding: 7px 12px !important;
    border: 1px solid rgba(0, 115, 183, 0.28) !important;
    background: rgba(255, 255, 255, 0.97) !important;
    color: #1a4a6e !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
}

.leaflet-tooltip.weather-marker-city-tooltip .weather-city-hover-tooltip {
    line-height: 1.25;
}

.leaflet-tooltip.weather-marker-city-tooltip.weather-marker-city-tooltip--archival .archival-tooltip-content {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 115, 183, 0.15);
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.leaflet-tooltip.weather-marker-city-tooltip .warning-tooltip-content {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
}

/* Hover: nad sąsiadami; minimal-mobile = większe font/img + jasnoniebieskie tło (Leaflet nadpisuje transform na .leaflet-marker-icon — nie polegamy na scale wewnątrz) */
#weather-map .leaflet-marker.weather-marker--pane-hover {
    z-index: 9500 !important;
}

#weather-map .leaflet-marker.weather-marker--pane-hover .leaflet-marker-icon {
    overflow: visible !important;
}

#weather-map .leaflet-marker.weather-marker--pane-hover .leaflet-marker-icon .weather-marker:not(.weather-marker--minimal-mobile) {
    transform: scale(1.1);
    transform-origin: center center;
    transition: transform 0.16s ease;
}

#weather-map .leaflet-marker.weather-marker--pane-hover .leaflet-marker-icon .warnings-mode-marker {
    transform: scale(1.06);
}

@media (max-width: 768px) {
    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile,
    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile.day-mode,
    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile.night-mode {
        background: rgba(214, 236, 255, 0.96) !important;
        border: 1px solid rgba(0, 115, 183, 0.32) !important;
        border-radius: 10px !important;
        padding: 6px 10px !important;
        box-shadow: 0 3px 16px rgba(0, 115, 183, 0.2) !important;
        transition: background 0.15s ease, box-shadow 0.15s ease;
    }

    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile .temp {
        font-size: calc(23px + 1pt) !important;
        font-weight: 300 !important;
        font-synthesis: none !important;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 1px rgba(0, 0, 0, 0.22) !important;
    }

    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile .weather-icon-container img {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (max-width: 480px) {
    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile .temp {
        font-size: calc(20px + 1pt) !important;
        font-weight: 300 !important;
        font-synthesis: none !important;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 1px rgba(0, 0, 0, 0.22) !important;
    }

    #weather-map .leaflet-marker.weather-marker--pane-hover .weather-marker--minimal-mobile .weather-icon-container img {
        width: 25px !important;
        height: 25px !important;
    }
}

/* Tooltip w markerPane — nad ikonami innych miast, pod kontrolkami mapy */
#weather-map .leaflet-marker-pane .leaflet-tooltip.weather-marker-city-tooltip {
    z-index: 9600 !important;
}

/* Style dla loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 10px;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073b7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    text-align: center;
    z-index: 1000;
}

.error-message h3 {
    color: #e74c3c;
    margin-top: 0;
}

.retry-btn {
    background: #0073b7;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.retry-btn:hover {
    background: #005a8e;
}

/* Style dla kwadracików z ostrzeżeniami (0d, 2d, 3d) - podobne do starej wersji */
.warning-squares-container {
    display: flex !important;
    gap: 0 !important; /* Kwadraty przylegają do siebie */
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important; /* Bez padding */
    background: transparent !important; /* Bez tła */
    border: none !important; /* Bez obwódki */
    flex-wrap: nowrap !important; /* Trójkąt w tej samej linii */
}

/* Ramka kwadracików i trójkąta – zawsze czarna (tylko tło zmienia się przy ostrzeżeniach) */
.warning-square,
.warning-square[style],
.warning-square.warning-square-dry,
.warning-square.warning-square-wet,
.warning-square.warning-square-snow,
.warning-square.warning-square-slippery {
    border-color: #000000 !important;
}
.warning-square {
    width: 40px !important;
    height: 40px !important;
    border: 2px solid #000000 !important; /* Czarna ramka */
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: normal !important;
    color: #000000 !important;
    padding: 2px !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    box-sizing: border-box !important;
}
.warning-square-icons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    width: 100% !important;
    height: 100% !important;
}
.warning-square-icon {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
}
.warning-square {
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none; /* Bez cienia */
    background-color: #ffffff; /* Domyślnie białe tło */
    margin: 0; /* Bez marginesu */
}

/* Kwadraty przyklejone do siebie - bez odstępów */
.warning-square + .warning-square {
    margin-left: -2px !important; /* Kwadraty przylegają do siebie, wspólna obwódka 2px */
    border-left-color: #000000 !important;
}

/* Jeden trójkąt (grot) – tekst ..7d maksymalnie do lewej krawędzi (minimalny padding) */
.warning-triangle {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    direction: ltr !important; /* Zawsze od lewej, nawet gdy rodzic ma RTL */
    width: 64px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 6px 0 5px !important;
    background: #000000 !important; /* Ramka trójkąta zawsze czarna */
    clip-path: polygon(0 0, 100% 50%, 0 100%) !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* Wewnętrzny trójkąt = wypełnienie (zapala się przy ostrzeżeniu 4–7d jak kwadraciki) */
.warning-triangle::before {
    content: '' !important;
    position: absolute !important;
    left: 3px !important;
    top: 3px !important;
    right: 3px !important;
    bottom: 3px !important;
    z-index: 0 !important;
    background: #eef5fc !important;
    clip-path: polygon(0 0, 100% 50%, 0 100%) !important;
    pointer-events: none !important;
}
/* Kolorowanie trójkąta według poziomu ostrzeżenia długoterminowego – tak jak kwadraciki */
.warning-triangle.warning-square-dry::before { background: #ffffff !important; }
.warning-triangle.warning-square-wet::before { background: #FFEB3B !important; }
.warning-triangle.warning-square-snow::before { background: #2196F3 !important; }
.warning-triangle.warning-square-slippery::before { background: #f44336 !important; }

/* Wypełnienie trójkąta kolorem z API – pełne tło jak w kwadracikach (nad ::before) */
.warning-triangle-fill {
    position: absolute !important;
    left: 3px !important;
    top: 3px !important;
    right: 3px !important;
    bottom: 3px !important;
    z-index: 1 !important;
    clip-path: polygon(0 0, 100% 50%, 0 100%) !important;
    pointer-events: none !important;
}

.warning-square:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    z-index: 10;
    border: 2px solid #1a2d4a !important; /* Zachowaj obramowanie przy hover */
}

.warning-square-label {
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: normal !important;
    color: #000000 !important; /* Czarne cyfry */
    text-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

/* 0d, 2d, 3d – zawsze widoczne, czytelne na każdym tle (białe/żółte/niebieskie/czerwone) */
.warning-square-day-nr {
    font-size: 14px !important;
    font-weight: normal !important;
    color: #000000 !important;
    line-height: 1 !important;
    text-shadow: 0 0 1px #fff, 0 1px 1px rgba(255,255,255,0.8) !important;
}

/* Kontener trójkąta – jeden element przy kwadracikach */
.warning-triangle-wrap {
    display: inline-flex !important;
    align-items: center !important;
    margin-left: -2px !important;
    position: relative !important;
}
/* Obramowanie trójkąta – zawsze czarne */
.warning-triangle-wrap::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 64px !important;
    height: 48px !important;
    background: #000000 !important;
    clip-path: polygon(0 0, 100% 50%, 0 100%) !important;
    z-index: -1 !important;
    transform: scale(1.08) !important;
    transform-origin: left center !important;
    pointer-events: none !important;
}
/* Tekst ..7d – na stałe od lewej (margin-right: auto + LTR na rodzicu) */
.warning-triangle-day-nr {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    margin-right: auto !important; /* Przyklej do lewej, nie do prawej */
    text-align: left !important;
    font-size: 13px !important;
    font-weight: normal !important;
    color: #000 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-shadow: 0 0 1px #fff, 0 1px 1px rgba(255,255,255,0.8) !important;
}

/* Kolory poziomów ostrzeżeń – niebieska obwódka wspólna */
.warning-square-dry {
    background-color: #ffffff !important;
    border: 2px solid #000000 !important; /* Czarna ramka */
    color: #000000 !important;
}

.warning-square-wet {
    background-color: #FFEB3B !important;
    border: 2px solid #000000 !important; /* Czarna ramka */
    color: #000000 !important;
}

.warning-square-snow {
    background-color: #2196F3 !important;
    border: 2px solid #000000 !important; /* Czarna ramka */
    color: #ffffff !important;
}

.warning-square-snow .warning-square-label,
.warning-square-snow .warning-square-icons { color: #ffffff !important; }
/* 0d/2d/3d zawsze czarne z cieniem dla czytelności */
.warning-square-snow .warning-square-day-nr { color: #000 !important; text-shadow: 0 0 1px #fff, 0 1px 2px rgba(255,255,255,0.9) !important; }

.warning-square-slippery {
    background-color: #F44336 !important;
    border: 2px solid #000000 !important; /* Czarna ramka */
    color: #ffffff !important;
}

.warning-square-slippery .warning-square-label,
.warning-square-slippery .warning-square-icons { color: #ffffff !important; }
.warning-square-slippery .warning-square-day-nr { color: #000 !important; text-shadow: 0 0 1px #fff, 0 1px 2px rgba(255,255,255,0.9) !important; }

/* Prawy panel – ta sama wysokość co lewy (viewport), legenda w swoim okienku z przewijaniem */
.time-panel.time-panel-rules {
    padding: 0 12px 12px 12px !important;
    background: #0096d6 !important;
    border-radius: 10px;
    overflow: hidden;
    min-height: 0;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}
.time-panel-rules .warnings-rules-header {
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}
.time-panel-rules .warnings-rules-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}
.time-panel-rules .warnings-rules-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    margin: 0 0 4px 0;
}
.time-panel-rules .warnings-rules-subtitle.text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}
.time-panel-rules .warnings-rules-horizon {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin: 0;
}
.time-panel-rules .warnings-rules-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.time-panel-rules .warnings-rules-table-wrap {
    overflow-x: auto;
    margin-bottom: 15px;
}
.time-panel-rules .warnings-rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 6px;
    overflow: hidden;
}
.time-panel-rules .warnings-rules-table th,
.time-panel-rules .warnings-rules-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}
.time-panel-rules .warnings-rules-table th {
    background: #004a73;
    color: #fff;
    font-weight: 600;
}
.time-panel-rules .warnings-rules-table td.condition-cell {
    max-width: 140px;
    word-break: break-word;
    font-size: 0.7rem;
}
.time-panel-rules .badge-level {
    font-size: 0.7rem;
    padding: 2px 6px;
}
.time-panel-rules .warnings-rules-empty {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    margin: 0;
}
/* Stopka Cumulus w prawym panelu – przylega do dołu, na niebieskim tle */
.time-panel-rules .panel-cumulus {
    background: rgba(0, 73, 115, 0.9) !important;
    color: #fff !important;
    padding: 8px !important;
    margin-top: auto !important;
    flex-shrink: 0;
    border-radius: 6px;
}
.time-panel-rules .panel-cumulus a {
    color: #fff !important;
    text-decoration: underline;
}
.time-panel-rules .panel-cumulus .address-cumulus {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Karta ostrzeżeń – kwadraciki u góry, nazwa oddziału pod spodem, jasnoniebieska obwódka */
.warning-card-marker.warnings-mode-marker {
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.warning-card-marker .warning-squares-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.warning-card-marker .warning-card-name.city-name-container {
    /* Etykieta nazwy: jasne tło tylko pod tekstem, dosunięte do strzałki */
    margin: 1px 0 0 0 !important;
    padding: 0 2px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 6px !important;
    border: none !important;
    box-shadow: 0 1px 1px rgba(0,0,0,0.12) !important;
}

.warning-card-marker .warning-card-name .city-name {
    font-size: 13px;
    font-weight: normal;
    color: #333;
    white-space: nowrap;
    line-height: 1 !important;
    text-shadow: none !important;
}

/* Rząd pod kwadracikami: ikonka wykresu | nazwa miasta | ikonka tabeli (Moje miasta – Ostrzeżenia) */
.warning-card-marker .warning-card-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.warning-card-marker .warnings-marker-chart-btn,
.warning-card-marker .warnings-marker-table-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.warning-card-marker .warnings-marker-chart-btn {
    background: #2563eb;
    color: #fff;
}
.warning-card-marker .warnings-marker-table-btn {
    background: #16a34a;
    color: #fff;
}
.warning-card-marker .warnings-marker-chart-btn:hover,
.warning-card-marker .warnings-marker-table-btn:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

/* Stary marker ostrzeżeń (fallback) */
.warnings-mode-marker:not(.warning-card-marker) {
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.warnings-mode-marker .city-name-container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 2px 0 !important;
    box-shadow: none !important;
}

.warnings-mode-marker .warning-squares-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.warnings-mode-marker .city-name {
    font-size: 13px;
    font-weight: normal;
    color: #000000;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 6px 0 !important;
    box-shadow: none !important;
}

/* Wspólny element skaluje się wraz z całą etykietą ostrzeżeń:
   kwadraciki + strzałka + tło + napis (razem), a nie osobno. */
.warnings-zoom-group {
    width: max-content;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: center top;
    transform: scale(var(--warnings-zoom-scale, 1));
}

/* Podświetlenie wierszy ostrzeżeń w tabeli prognozy – wysoka specyficzność, tło na td */
#weather-data-table tbody tr.weather-row-warning-2 td {
    background-color: #fff3cd !important;
}
#weather-data-table tbody tr.weather-row-warning-3 td {
    background-color: #f8d7da !important;
}
#weather-data-table tbody tr.weather-row-warning-4 td {
    background-color: #333333 !important;
    color: #fff !important;
}

/*
 * `/warning` - mobile: nazwa ma być tuż pod strzałką (bez „długiej” pustej przerwy).
 * Problem wynika z justify-content: space-between na `.weather-marker`.
 */
@media (max-width: 768px) {
    #weather-map .weather-marker.warnings-mode-marker {
        justify-content: flex-start !important;
        /* Na mobile w /warning nie pokazujemy "białych kart" jako podkładu */
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* Karta ostrzeżeń: mniej miejsca między kwadracikami a nazwą */
    #weather-map .warning-card-marker .warning-squares-wrapper {
        margin: 0 !important;
    }

    #weather-map .warning-card-marker.warnings-mode-marker {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    #weather-map .warning-card-marker .warning-card-name.city-name-container {
        /* Mobile: przyklejenie etykiety do strzałki jak w dopracowanej wersji */
        margin: -22px 0 0 0 !important;
        padding: 0px 1px !important;
        background: rgba(255, 255, 255, 0.92) !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 1px rgba(0,0,0,0.12) !important;
    }

    /* Mniejsza i czytelniejsza nazwa */
    #weather-map .warning-card-marker .warning-card-name .city-name {
        font-size: 10px !important;
        line-height: 1 !important;
        text-shadow: none !important;
    }

    /* Dla markerów ostrzeżeń bez „karty” (fallback) też dopasuj wysokość/pisanie */
    #weather-map .warnings-mode-marker .city-name {
        font-size: 11px !important;
        margin-bottom: 0 !important;
        text-shadow: none !important;
    }
}
