/* === GLOBALNE REGUŁY DLA WSZYSTKICH WIDOKÓW (DESKTOP I MOBILE) === */
/* Usuń białe/czarne paski w miniaturach - naturalne proporcje obrazów */
.gallery .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
.newgallery .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
.image_list .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
.section:has(.photo) .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
#bodyWrapper .section > .photo img.user_photo,
#bodyWrapper .section > .photo a.photo-link img,
.photo img.user_photo {
    object-fit: contain !important;
    aspect-ratio: auto !important;
    height: auto !important;
}

@media only screen and (max-width: 768px) {
    /* Usuń padding-top z #page na mobile */
    #page {
        padding-top: 0 !important;
    }
    
    /* Specyficzna korekta wysokości dla elementu #p252270 na mobilu */
    #p252270 {
        height: 150px !important;           /* zmniejszona wysokość (dopasuj w razie potrzeby) */
        overflow: hidden !important;
    }
    #p252270 img,
    #p252270 .user_photo {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }
    /* Zapewnij odstęp treści pod stałymi paskami (usermenu + quick-links) */
    #bd {
        margin-top: 10px !important;
    }
    /* Pokaż pasek szybkich linków GW/GN i ustaw go pod usermenu */
    #quick-gallery-links {
        display: block !important;
        position: fixed !important;
        top: 52px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 999 !important;
    }
    /* Ukryj cały picker kategorii na mobilu, żeby pod paskiem były od razu przyciski sortowania */
    #category_picker {
        display: none !important;
    }
    .mobile-hide {
        display: none !important;
    }

    /* === STRONA GŁÓWNA - 2 miniatury w rzędzie === */
    /* Sekcje ze zdjęciami na stronie głównej */
    /* Sekcje foto na stronie głównej (bez :has - działa wszędzie) */
    #bodyWrapper .section > .photo {
        display: inline-block !important;
        width: calc(50% - 8px) !important;
        margin: 4px !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
        background-color: #171717 !important;
        border-radius: 12px !important;
        position: relative !important;
    }
    
    /* === GALERIE - 1 miniatura w rzędzie (wyłączone 2 kolumny) === */
    /* .gallery .photo,
    .newgallery .photo,
    .image_list .photo {
        display: inline-block !important;
        width: 300px !important;
        max-width: 300px !important;
        margin: 4px !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
        background-color: #171717 !important;
        border-radius: 12px !important;
        position: relative !important;
    }
    
    /* Kontenery galerii - font-size: 0 żeby usunąć odstępy między inline-block */
    /* .gallery,
    .newgallery,
    .image_list {
        font-size: 0 !important;
    }
    
    /* Przywróć font-size dla elementów wewnątrz */
    /* .gallery *,
    .newgallery *,
    .image_list * {
        font-size: 14px !important;
    } */
    
    #bodyWrapper .section > .photo .title,
    #bodyWrapper .section > .photo .date,
    #bodyWrapper .section > .photo .stats {
        margin: 6px 0 0 0 !important;
        padding: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    #bodyWrapper .section > .photo .title {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: #fff !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    #bodyWrapper .section > .photo .date {
        font-size: 11px !important;
        color: rgba(255,255,255,0.65) !important;
    }
    
    #bodyWrapper .section > .photo .stats {
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 11px !important;
        color: rgba(255,255,255,0.85) !important;
        flex-wrap: wrap !important;
    }
    
    #bodyWrapper .section > .photo .stats img {
        width: 14px !important;
        height: 14px !important;
    }
    
    #bodyWrapper .section > .photo img.user_photo,
    #bodyWrapper .section > .photo a.photo-link img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }
    
    #bodyWrapper .section > .photo img.badge,
    #bodyWrapper .section > .photo a img.badge {
        position: absolute !important;
        right: 8px !important;
        bottom: 8px !important;
        width: 24px !important;
        height: 24px !important;
        z-index: 50 !important;
        pointer-events: none !important;
    }

    body.mobile-gallery {
        background-color: #0b0b0d;
    }


    /* WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA z reguł dla #bd i #main */
    body.mobile-gallery #bd:not(:has([id*="photo"])):not(:has(.photo-detail)),
    body.mobile-gallery #main:not(:has([id*="photo"])):not(:has(.photo-detail)),
    body.mobile-gallery .gallery-wrapper:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    body.mobile-gallery #sidepanel,
    body.mobile-gallery .gallery-ad,
    body.mobile-gallery .top-pane,
    body.mobile-gallery .bottom-pane,
    body.mobile-gallery .darkColumn,
    body.mobile-gallery .komLista,
    body.mobile-gallery .ad-pane {
        display: none !important;
    }

    body.mobile-gallery .gallery {
        padding: 8px !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    body.mobile-gallery #category_picker {
        margin: 12px 0 18px;
        padding: 12px 16px;
        background: rgba(255,255,255,0.04);
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.08);
    }

    body.mobile-gallery #category_picker #cPickerSort {
        font-size: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.mobile-gallery #category_picker #cPickerSort .main_group {
        font-size: 13px;
        padding: 8px 14px;
        border-radius: 999px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.12);
        color: #fff;
        text-decoration: none;
        flex: 1 1 auto;
        text-align: center;
    }

    body.mobile-gallery #category_picker #cPickerSort .main_group.selected {
        background: #c00;
        border-color: #f44;
    }

    body.mobile-gallery .image_list {
        list-style: none;
        padding: 8px !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        /* display: grid; */
        /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
        /* gap: 12px; */
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    body.mobile-gallery .gallery,
    body.mobile-gallery .newgallery,
    body.mobile-gallery div.gallery {
        /* display: grid !important; */
        /* grid-template-columns: repeat(2, minmax(0, 1fr)) !important; */
        /* gap: 12px !important; */
        padding: 8px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }
    
    body.mobile-gallery .lista_kategorie,
    body.mobile-gallery .darkColumn,
    body.mobile-gallery .komLista {
        display: none !important;
    }
    
    body.mobile-gallery #cPickerSort {
        gap: 12px !important;
        flex-wrap: nowrap !important;
        margin: 14px 5px 18px !important;
        padding: 0 8px !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0 !important;
        position: relative !important;
        z-index: 1002 !important;
        justify-content: space-between !important;
    }
    
    body.mobile-gallery #cPickerSort .main_group {
        display: none !important;
    }
    
    body.mobile-gallery #cPickerSort #gr_najnowsze,
    body.mobile-gallery #cPickerSort #gr_polecane {
        display: inline-flex !important;
        flex: 1 1 calc(50% - 6px) !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 12px 14px !important;
        border-radius: 999px !important;
        border: 1px solid #333 !important;
        background: #1c1c1c !important;
        color: #ffffff !important;
        text-decoration: none !important;
        text-transform: uppercase !important;
        font-size: 12px !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    }
    
    body.mobile-gallery #cPickerSort #gr_najnowsze.selected,
    body.mobile-gallery #cPickerSort #gr_polecane.selected {
        background: #c01616 !important;
        border-color: #f04c4c !important;
    }
    
    body.mobile-gallery #cPickerSort .expand,
    body.mobile-gallery #cPickerSort a:not(#gr_najnowsze):not(#gr_polecane) {
        display: none !important;
    }
    
    body.mobile-gallery .mobile-sort-buttons {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    body.mobile-gallery .mobile-sort-buttons a {
        flex: 1 1 calc(50% - 5px);
        justify-content: center;
        align-items: center;
        padding: 10px 12px;
        border-radius: 999px;
        border: 1px solid #333;
        background: #1c1c1c;
        color: #ffffff;
        text-decoration: none;
        text-transform: uppercase;
        font-size: 12px;
        letter-spacing: 0.5px;
        display: inline-flex;
    }
    
    body.mobile-gallery .mobile-sort-buttons a.selected {
        background: #c01616;
        border-color: #f04c4c;
    }
    

    body.mobile-gallery .image_list .photo img.badge,
    body.mobile-gallery .gallery .photo img.badge,
    body.mobile-gallery .newgallery .photo img.badge,
    body.mobile-gallery .photo a img.badge,
    body.mobile-gallery .photo a img.badge img.badge,
    body.mobile-gallery [id*="p"] img.badge,
    body.mobile-gallery [id*="p"] a img.badge,
    body.mobile-gallery [id*="p"] a img.badge img.badge {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        min-width: 24px !important;
        max-height: 24px !important;
        min-height: 24px !important;
        position: absolute !important;
        right: 8px !important;
        bottom: 8px !important;
        z-index: 50 !important;
        pointer-events: none !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        clear: none !important;
        display: block !important;
        box-sizing: border-box !important;
        object-fit: contain !important;
        object-position: center !important;
    }
}

/* Mobile Gallery - 2 miniatury obok siebie + ZERO bocznych paneli + Infinite Scroll */
@media only screen and (max-width: 768px) {
    
    /* === MENU - Logo po lewej, Flaga+LOGIN po prawej === */
    #usermenu ul li#menuitem-langs {
        margin-left: auto !important;
    }
    
    /* === UKRYJ PAGINACJĘ (infinite scroll zamiast tego) === */
    .paginacja,
    div.paginacja {
        display: none !important;
    }
    
    
    /* === UKRYJ ABSOLUTNIE WSZYSTKO CO BOCZNE === */
    
    /* ULTRA-MEGA-AGRESYWNE ukrycie #sidepanel (lewa kolumna z komentarzami) */
    /* NADPISANIE BŁĘDNEJ DEFINICJI: #sidepanel.hidden { margin-right: -220px; } */
    /* PHP dodaje class="hidden" na mobile - teraz naprawdę ukrywamy */
    /* NADPISZ WSZYSTKIE STYLE Z main2012.css i classic/main.css */
    html body #sidepanel,
    html body #sidepanel.hidden,
    html body div#sidepanel,
    html body div#sidepanel.hidden,
    body #sidepanel,
    body #sidepanel.hidden,
    body div#sidepanel,
    body div#sidepanel.hidden,
    #sidepanel,
    #sidepanel.hidden,
    #sidepanel *,
    div#sidepanel,
    div#sidepanel.hidden,
    .side-pane,
    .top-pane,
    .bottom-pane,
    .top-pane-wrapper,
    .bottom-pane-wrapper,
    .comments-pane,
    .gallery-ad,
    .darkColumn,
    .komLista,
    .rounded-top,
    h2.rounded-top,
    .ad-pane,
    aside,
    [class*="sidebar"],
    [class*="side-"],
    [id*="sidebar"],
    [id*="side"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        position: absolute !important;
        left: -99999px !important;
        right: auto !important;
        top: -99999px !important;
        bottom: auto !important;
        overflow: hidden !important;
        z-index: -9999 !important;
        transform: translateX(-9999px) !important;
        float: none !important;
        clear: both !important;
    }
    
    /* UKRYJ TD Z WIDTH="200" (lewa kolumna z komentarzami) - całkowicie usuń z layoutu */
    td[width="200"],
    td[width="220"],
    td.sticky-left-column,
    td[class*="sticky-left-column"],
    .sticky-left-column,
    [class*="sticky-left-column"],
    .sticky-list,
    [class*="sticky-list"] {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -99999px !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -9999 !important;
        /* Upewnij się że nie zajmuje miejsca w tabeli */
        table-layout: fixed !important;
    }
    
    /* Tabela z ukrytą lewą kolumną - upewnij się że nie rezerwuje miejsca */
    table:has(td[width="200"]),
    table:has(td.sticky-left-column) {
        table-layout: fixed !important;
    }
    
    /* UKRYJ TD Z MAŁĄ SZEROKOŚCIĄ (spacery między kolumnami) */
    td[width="10"],
    td[width="20"],
    td[width="30"],
    td[width="40"],
    td[width="50"],
    td[width="5"],
    td[width="15"],
    td[width="25"],
    td[width="35"],
    td[width="45"] {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -99999px !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -9999 !important;
    }
    
    /* NADPISZ SPECYFICZNIE margin-right: -220px z main2012.css */
    #sidepanel.hidden,
    html body #sidepanel.hidden,
    body #sidepanel.hidden {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    /* UKRYJ GŁÓWNE MENU NAWIGACYJNE NA MOBILE (#mainmenu) */
    #mainmenu,
    div#mainmenu,
    #mainmenu *,
    div#mainmenu *,
    #mainmenu ul,
    #mainmenu li,
    #mainmenu a,
    [id*="mainmenu"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        left: -99999px !important;
        top: -99999px !important;
        overflow: hidden !important;
        z-index: -9999 !important;
    }
    
    /* UKRYJ CZAT LAUNCHER NA MOBILE - może przesuwać zawartość */
    #chat-launcher,
    .chat-launcher,
    #chat-launcher-button,
    .chat-launcher__button,
    #chat-launcher-modal,
    .chat-launcher-modal,
    .chat-launcher--visible {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        left: -99999px !important;
        right: -99999px !important;
        top: -99999px !important;
        overflow: hidden !important;
        z-index: -9999 !important;
        transform: translateX(-9999px) !important;
    }
    
    /* UKRYJ LEWĄ KOLUMNĘ Z ANALIZAMI (.lista_kategorie) */
    .lista_kategorie,
    div.lista_kategorie,
    .lista_kategorie *,
    div.lista_kategorie *,
    .lista_kategorie h2,
    .lista_kategorie .last_item,
    [class*="lista_kategorie"],
    [id*="lista_kategorie"],
    .sticky-left-column,
    td.sticky-left-column,
    [class*="sticky-left-column"],
    .sticky-list,
    [class*="sticky-list"] {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -99999px !important;
        overflow: hidden !important;
        z-index: -9999 !important;
        transform: translateX(-9999px) !important;
    }
    
    /* UPORZĄDKUJ FILTROWANIE - PROSTSZE NA MOBILE */
    #category_picker,
    .szaraBelka#category_picker {
        width: 100% !important;
        margin: 100px 0 10px !important; /* większy odstęp od menu ~100px */
        padding: 0 !important; /* usuń wewnętrzny padding, żeby przyciski były równo z krawędzią */
        background: transparent !important; /* bez tła skrzynki */
        border-radius: 0 !important;
        border: none !important; /* bez ramki */
        box-shadow: none !important;
        display: block !important;
        font-size: 13px !important;
        clear: both !important; /* w razie gdyby elementy powyżej były floatowane */
    }
    
    /* UKRYJ KATEGORIE NA MOBILE */
    #category_picker #cPickerCategory {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    #category_picker .kat_kategorie {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* KOLEJNOŚĆ (SORTOWANIE) - z dropdown (jak kategorie) */
    
    /* Główne przyciski sortowania - UKRYJ WSZYSTKIE domyślnie */
    #category_picker #cPickerSort .main_group {
        display: none !important;
    }
    
    /* Pokaż TYLKO 2 grupy: Najnowsze (#gr_najnowsze) i Polecane (#gr_polecane) */
    #category_picker #cPickerSort #gr_najnowsze,
    #category_picker #cPickerSort a[id*=\"najnowsze\"],
    #category_picker #cPickerSort #gr_polecane,
    #category_picker #cPickerSort a[id*=\"polecane\"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;          /* szerokość zgodna z treścią */
        min-width: max-content !important;  /* nie ścinaj napisu */
        box-sizing: border-box !important;
        height: auto !important;
        padding: 10px 16px !important;
        margin: 0 6px !important;           /* odstęp między przyciskami */
        background: #2a2a2a !important;
        border: 1px solid #3a3a3a !important;
        border-radius: 999px !important;    /* „pigułka” */
        color: #fff !important;
        text-decoration: none !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
        transition: background .15s ease, transform .1s ease, box-shadow .15s ease !important;
        touch-action: manipulation !important;
    }

    /* Odstęp między przyciskami zapewniają marginesy 0 6px na każdym z nich */
    
    #category_picker #cPickerSort #gr_najnowsze:active,
    #category_picker #cPickerSort a[id*="najnowsze"]:active,
    #category_picker #cPickerSort #gr_polecane:active,
    #category_picker #cPickerSort a[id*="polecane"]:active {
        background: #444 !important;
        transform: translateY(1px) scale(0.98) !important;
    }
    
    #category_picker #cPickerSort #gr_najnowsze.selected,
    #category_picker #cPickerSort a[id*="najnowsze"].selected,
    #category_picker #cPickerSort #gr_polecane.selected,
    #category_picker #cPickerSort a[id*="polecane"].selected {
        background: #c01616 !important;
        border-color: #f04c4c !important;
        box-shadow: 0 6px 16px rgba(192,22,22,0.45) !important;
    }
    
    /* Dropdown dla sortowania - ukryty domyślnie, pokazuje się po kliknięciu */
    #category_picker #cPickerSort .expand {
        display: none !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 300px !important;
        margin: 0 !important;
        padding: 10px !important;
        background: #2a2a2a !important;
        border: 2px solid #444 !important;
        border-radius: 8px !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.8) !important;
        z-index: 9999 !important;
    }
    
    
    /* UKRYJ wszystkie opcje w expand (dropdown) */
    #category_picker #cPickerSort .expand a {
        display: none !important;
    }
    
    /* Pokaż tylko opcje dla grup Najnowsze i Polecane w ich dropdownach */
    #category_picker #cPickerSort .expand.gr_najnowsze a,
    #category_picker #cPickerSort .expand.gr_polecane a {
        display: block !important;
        padding: 10px 12px !important;
        margin: 3px 0 !important;
        background: #333 !important;
        border: 1px solid #555 !important;
        border-radius: 4px !important;
        color: #fff !important;
        text-decoration: none !important;
        font-size: 14px !important;
        touch-action: manipulation !important;
    }
    
    #category_picker #cPickerSort .expand.gr_najnowsze a:active,
    #category_picker #cPickerSort .expand.gr_polecane a:active {
        background: #555 !important;
    }
    
    #category_picker #cPickerSort .expand.gr_najnowsze a.selected,
    #category_picker #cPickerSort .expand.gr_polecane a.selected {
        background: #c00 !important;
        border-color: #e00 !important;
        font-weight: bold !important;
    }
    
    /* PAGINACJA - lepsze na mobile */
    .paginacja {
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 8px 5px !important;
        text-align: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
    }
    
    .paginacja a,
    .paginacja .pagebutton {
        display: inline-block !important;
        padding: 8px 12px !important;
        margin: 2px !important;
        background: #333 !important;
        border: 1px solid #555 !important;
        border-radius: 4px !important;
        color: #fff !important;
        text-decoration: none !important;
        font-size: 14px !important;
        min-width: 40px !important;
        text-align: center !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        user-select: none !important;
    }
    
    .paginacja a:active,
    .paginacja .pagebutton:active {
        background: #555 !important;
        transform: scale(0.95) !important;
    }
    
    .paginacja a.yellow,
    .paginacja .pagebutton.yellow {
        background: #c00 !important;
        border-color: #e00 !important;
        font-weight: bold !important;
    }
    
    .paginacja a.fback,
    .paginacja a.ffoward,
    .paginacja a.firsturl,
    .paginacja a.fend {
        font-size: 12px !important;
        min-width: 50px !important;
    }
    
    /* === GALERIA NA PEŁNĄ SZEROKOŚĆ === */
    
    /* USUŃ WSZYSTKIE MARGINESY I PADDINGI lewej kolumny - WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA */
    /* UWAGA: NIE dodajemy text-align: center tutaj - to psuje inne tabele w portalu! */
    body:not(:has([id*="photo"])):not(:has(.photo-detail)),
    #bd:not(:has([id*="photo"])):not(:has(.photo-detail)),
    #main:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .main-pane:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .major:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .page-wrapper:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .page:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .gallery-wrapper:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .gallery-wrapper.ad:not(:has([id*="photo"])):not(:has(.photo-detail)),
    #galleryPane:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .flex-grow:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        float: none !important;
        position: relative !important;
        box-sizing: border-box !important;
        /* text-align: center USUNIĘTE - psuje inne tabele */
    }
    
    /* GALERIE - szerokość z paddingami, żeby miniatury się mieściły - 2 w rzędzie */
    /* UWAGA: text-align: center TYLKO dla kontenerów galerii, nie dla innych elementów */
    .gallery,
    .newgallery {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 4px !important;
        float: none !important;
        position: relative !important;
        box-sizing: border-box !important;
        text-align: center !important; /* Wycentruj miniatury */
    }
    
    /* .image_list jest <td> w tabeli - specjalne traktowanie */
    td.image_list,
    .image_list {
        width: 100% !important;
        max-width: 100% !important;
        padding: 4px !important;
        float: none !important;
        position: relative !important;
        box-sizing: border-box !important;
        text-align: center !important; /* Wycentruj miniatury w komórce tabeli */
        vertical-align: top !important;
    }
    
    /* WYJĄTEK: Tabele wewnątrz miniatur - wycentruj obrazki */
    .gallery .photo table,
    .newgallery .photo table,
    .image_list .image table,
    td.image_list .image table {
        margin: 0 auto !important;
        text-align: center !important;
        width: 100% !important; /* Nadpisz width="230" z HTML */
        max-width: 100% !important;
    }
    
    /* Komórki w tabelach miniatur - wycentruj zawartość */
    .gallery .photo table td,
    .newgallery .photo table td,
    .image_list .image table td,
    td.image_list .image table td {
        text-align: center !important;
    }
    
    /* Obrazki w tabelach miniatur - wycentruj */
    .gallery .photo table td img,
    .newgallery .photo table td img,
    .image_list .image table td img,
    td.image_list .image table td img {
        display: block !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* .newgallery - wycentrowane */
    .newgallery {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* .image_list - wycentrowane */
    .image_list {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Gallery - wycentrowane */
    .gallery {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Ukryj kolumnę z reklamą/komentarzami całkowicie */
    .gallery-ad {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Wrapper.ad - zachowuj się jak normalny wrapper */
    /* WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA z reguł dla .gallery-wrapper.ad */
    .gallery-wrapper.ad:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        display: block !important;
        width: 100% !important;
    }
    
    /* Główny kontener na 100% - padding-top dla usermenu, reszta zero - WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA */
    #bd:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 10px !important;
        padding-bottom: 0 !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        /* text-align: center USUNIĘTE - psuje inne tabele */
    }
    
    /* Main też - WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA */
    #main:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        padding: 0 !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        /* text-align: center USUNIĘTE - psuje inne tabele */
    }
    
    /* Wymuś pełną szerokość dla wszystkich kontenerów */
    #bodyWrapper,
    #content,
    .holder2,
    /* WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA z reguł dla .main-pane */
    .main-pane:not(:has([id*="photo"])):not(:has(.photo-detail)),
    body:not(:has([id*="photo"])):not(:has(.photo-detail)),
    html:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        /* text-align: center USUNIĘTE - psuje inne tabele */
    }
    
    /* UKRYJ .minor (lewa kolumna) - może mieć width: 220px i float: left z main2012.css */
    .minor,
    div.minor,
    [class*="minor"] {
        display: none !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -99999px !important;
        float: none !important;
        clear: both !important;
    }
    
    /* .major (główna kolumna) - pełna szerokość - WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA */
    .major:not(:has([id*="photo"])):not(:has(.photo-detail)),
    div.major:not(:has([id*="photo"])):not(:has(.photo-detail)),
    [class*="major"]:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
        float: none !important;
        clear: both !important;
        /* text-align: center USUNIĘTE - psuje inne tabele */
    }
    
    /* Usuń wszystkie kolumny - tylko jedna kolumna */
    [class*="col-"],
    [class*="column"] {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Wymuś jednowierszowy layout */
    * {
        box-sizing: border-box !important;
    }
    
    /* AGRESYWNE usuwanie lewego marginesu który tworzy "kolumnę" */
    #galleryPane {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Dla elementów wewnątrz #galleryPane - nie przesuwaj */
    #galleryPane * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Dla div[id*="gallery"] i div[class*="gallery"] - tylko główne kontenery */
    div[id*="gallery"]:not(.gallery *):not(.newgallery *):not(.image_list *),
    div[class*="gallery"]:not(.gallery *):not(.newgallery *):not(.image_list *) {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        /* width: 100vw !important; - USUNIĘTE - psuje wycentrowanie */
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Wrapper gdy ma reklamę - normalnie ma float i margin-left - WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA */
    .gallery-wrapper.ad:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        float: none !important;
        margin-left: 0 !important;
    }
    
    /* Div z reklamą nie powinien przesuwać galerii */
    .gallery-ad + .gallery,
    .gallery-ad ~ .gallery {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    
    /* === NEWS TICKER - rozciągnij na całą szerokość === */
    /* Sekcja z newstickerem musi być gridem żeby grid-column zadziałał */
    .section:has(#news-wrapper) {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    /* H2 i newsticker w sekcji - pełna szerokość */
    .section:has(#news-wrapper) h2,
    #news-wrapper,
    #news-wrapper .newsticker_wrapper {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* === RANKING UŻYTKOWNIKÓW - 8 avatarów, 4 w rzędzie, 2 ostatnie ukryte na mobile === */
    /* NADPISZ desktop CSS: .section.high_ranked { grid-template-columns: 201px 201px; width: 420px } */
    #teaser .section.high_ranked,
    div#teaser div.section.high_ranked,
    .section.high_ranked,
    div.section.high_ranked {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 5px !important;
        box-sizing: border-box !important;
    }
    
    /* UKRYJ <br> - powoduje rozjazd */
    .section.high_ranked br {
        display: none !important;
    }
    
    .section.high_ranked > a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        text-decoration: none !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 5px !important;
        background-color: #1a1a1a !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }
    
    /* UKRYJ 7. i 8. element na mobile (2 ostatnie) */
    .section.high_ranked > a:nth-child(7),
    .section.high_ranked > a:nth-child(8) {
        display: none !important;
    }
    
    .section.high_ranked .avatar {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        background-size: cover !important;
        background-position: center !important;
        display: block !important;
        margin-bottom: 5px !important;
    }
    
    .section.high_ranked .label {
        font-size: 11px !important;
        margin: 3px 0 !important;
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    
    .section.high_ranked span:last-child {
        font-size: 9px !important;
        color: #999 !important;
    }
    
    /* User-list (alternatywna struktura) */
    ul.user-list,
    section ul.user-list {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        list-style: none !important;
        padding: 10px 5px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    ul.user-list li {
        display: block !important;
        width: auto !important;
        margin: 0 !important;
    }
    
    /* UKRYJ 7. i 8. <li> na mobile */
    ul.user-list li:nth-child(7),
    ul.user-list li:nth-child(8) {
        display: none !important;
    }
    
    /* UKRYJ <br> w user-list */
    ul.user-list br {
        display: none !important;
    }
    
    ul.user-list li a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        text-decoration: none !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 5px !important;
        background-color: #1a1a1a !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }
    
    ul.user-list .head {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        background-size: cover !important;
        background-position: center !important;
        display: block !important;
        margin-bottom: 5px !important;
    }
    
    ul.user-list .name {
        font-size: 11px !important;
        margin: 3px 0 !important;
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    
    ul.user-list .points {
        font-size: 9px !important;
        color: #999 !important;
    }
    
    /* === FIXED ELEMENTY - nie blokuj klikania na mobile === */
    
    /* Cookie Banner - obniżony z-index i zmniejszona wysokość */
    #cookie-consent-banner {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 100 !important; /* OBNIŻONY z 999999 do 100 */
        max-height: 30vh !important; /* Zmniejszony z 50vh do 30vh */
        pointer-events: auto !important;
        padding: 10px !important;
    }
    
    /* Przyciski w bannerze muszą być klikalne */
    #cookie-consent-banner * {
        pointer-events: auto !important;
    }
    
    /* Quick Gallery Links - WŁĄCZ na mobile i nadaj stałą wysokość pod nawigacją */
    #quick-gallery-links {
        display: block !important;
        position: fixed !important;
        top: 52px !important; /* wysokość usermenu */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 900 !important;
        padding: 8px 10px !important;
        box-sizing: border-box !important;
        pointer-events: auto !important;
        /* Upewnij się że nie blokuje treści poniżej */
        background: #252525 !important;
    }
    
    /* Treść pod quick-gallery-links musi być klikalna */
    #bd,
    #main,
    .gallery,
    .newgallery,
    .image_list {
        position: relative !important;
        z-index: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Miniatury MUSZĄ być klikalne - wyższy z-index niż quick-gallery-links gdy są widoczne */
    .gallery .photo,
    .newgallery .photo,
    .image_list .photo,
    .image_list .image {
        position: relative !important;
        z-index: 10 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
    
    /* Treść strony ZAWSZE klikalna */
    body,
    #bodyWrapper,
    /* WYKLUCZ WIDOK POJEDYNCZEGO ZDJĘCIA z reguł dla pointer-events */
    #teaser:not(:has([id*="photo"])):not(:has(.photo-detail)),
    #bd:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .main-pane:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .section:not(:has([id*="photo"])):not(:has(.photo-detail)),
    .photo:not(:has([id*="photo"])):not(:has(.photo-detail)),
    a:not(:has([id*="photo"])):not(:has(.photo-detail)) {
        pointer-events: auto !important;
    }
    
    /* Dodaj padding-bottom do body aby treść nie być zasłonięta przez banner */
    body {
        padding-bottom: 150px !important; /* Miejsce na cookie banner */
    }
    
    
    /* Obrazki ZDJĘĆ w galeriach - pełna szerokość komórki */
    /* Najpierw ustaw wszystkie obrazki w linkach na 100% - ALE WYKLUCZ BADGE I IKONY STATYSTYK */
    /* WAŻNE: Wykluczamy też obrazki w .stats, bo one nie są w linkach */
    .gallery .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
    .newgallery .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
    .image_list .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img),
    .section:has(.photo) .photo a img:not(.badge):not([src*="views"]):not([src*="likes"]):not([src*="comments"]):not([src*="favorites"]):not([src*=".gif"]):not([alt*="Odsłon"]):not([title*="Odsłon"]):not(.stats img) {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }
    
    /* WYKLUCZ WSZYSTKIE obrazki w .stats z reguł dla obrazków w linkach */
    .gallery .photo .stats img,
    .newgallery .photo .stats img,
    .image_list .photo .stats img {
        width: auto !important;
        height: auto !important;
        max-width: 16px !important;
        min-width: auto !important;
        min-height: auto !important;
        max-height: 16px !important;
        display: inline-block !important;
        position: static !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
        padding: 0 !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
    
    /* NADPISZ SPECYFICZNIE dla ikon statystyk w linkach - wyższa specyficzność */
    .gallery .photo a img[src*="views"],
    .newgallery .photo a img[src*="views"],
    .image_list .photo a img[src*="views"],
    .gallery .photo a img[src*="likes"],
    .newgallery .photo a img[src*="likes"],
    .image_list .photo a img[src*="likes"],
    .gallery .photo a img[src*="comments"],
    .newgallery .photo a img[src*="comments"],
    .image_list .photo a img[src*="comments"],
    .gallery .photo a img[src*="favorites"],
    .newgallery .photo a img[src*="favorites"],
    .image_list .photo a img[src*="favorites"],
    .gallery .photo a img[src*=".gif"],
    .newgallery .photo a img[src*=".gif"],
    .image_list .photo a img[src*=".gif"],
    .gallery .photo a img[alt*="Odsłon"],
    .newgallery .photo a img[alt*="Odsłon"],
    .image_list .photo a img[alt*="Odsłon"],
    .gallery .photo a img[title*="Odsłon"],
    .newgallery .photo a img[title*="Odsłon"],
    .image_list .photo a img[title*="Odsłon"] {
        width: auto !important;
        height: auto !important;
        max-width: 16px !important;
        min-width: auto !important;
        min-height: auto !important;
        max-height: 16px !important;
        display: inline-block !important;
        position: static !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
        padding: 0 !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
    
    /* Potem wykluczenia - badge (ikona zdjęcia dnia) - AGRESYWNE NADPISANIE */
    .photo img.badge,
    .photo a img.badge,
    .photo a img.badge img.badge,
    img.badge,
    img[class*="badge"],
    [id*="p"] img.badge,
    [id*="p"] a img.badge,
    [id*="p"] a img.badge img.badge,
    .gallery .photo a img.badge,
    .newgallery .photo a img.badge,
    .image_list .photo a img.badge,
    .gallery .photo img.badge,
    .newgallery .photo img.badge,
    .image_list .photo img.badge {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        min-width: 24px !important;
        max-height: 24px !important;
        min-height: 24px !important;
        position: absolute !important;
        top: auto !important;
        left: auto !important;
        right: 8px !important;
        bottom: 8px !important;
        z-index: 50 !important;
        pointer-events: none !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        clear: none !important;
        display: block !important;
        box-sizing: border-box !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    /* Upewnij się, że kontener .photo ma position: relative dla badge */
    .gallery .photo,
    .newgallery .photo,
    .image_list .photo,
    .section .photo {
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* Ikonki statystyk - zachowaj oryginalny rozmiar - AGRESYWNE NADPISANIE */
    /* Te reguły są już zdefiniowane wyżej, ale dodajemy jeszcze bardziej specyficzne na końcu */
    /* Dodatkowe selektory dla ikon w linkach (jeśli gdzieś są) */
    .gallery .photo a img[src*="views"],
    .newgallery .photo a img[src*="views"],
    .image_list .photo a img[src*="views"],
    .gallery .photo a img[src*="likes"],
    .newgallery .photo a img[src*="likes"],
    .image_list .photo a img[src*="likes"],
    .gallery .photo a img[src*="comments"],
    .newgallery .photo a img[src*="comments"],
    .image_list .photo a img[src*="comments"],
    .gallery .photo a img[src*="favorites"],
    .newgallery .photo a img[src*="favorites"],
    .image_list .photo a img[src*="favorites"],
    .gallery .photo a img[src*=".gif"],
    .newgallery .photo a img[src*=".gif"],
    .image_list .photo a img[src*=".gif"] {
        width: auto !important;
        height: auto !important;
        max-width: 16px !important;
        min-width: auto !important;
        min-height: auto !important;
        max-height: 16px !important;
        display: inline-block !important;
        position: static !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
        padding: 0 !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
    
    /* NAJWYŻSZA SPECYFICZNOŚĆ - ikony statystyk - MUSZĄ BYĆ NA KOŃCU, żeby nadpisać wszystkie inne reguły */
    /* Używamy bardzo specyficznych selektorów, żeby nadpisać nawet body.mobile-gallery */
    @media only screen and (max-width: 768px) {
        .gallery .photo .stats img[src*="views"],
        .newgallery .photo .stats img[src*="views"],
        .image_list .photo .stats img[src*="views"],
        .gallery .photo .stats img[src*="comments"],
        .newgallery .photo .stats img[src*="comments"],
        .image_list .photo .stats img[src*="comments"],
        .gallery .photo .stats img[src*="critiques"],
        .newgallery .photo .stats img[src*="critiques"],
        .image_list .photo .stats img[src*="critiques"],
        .gallery .photo .stats img[src="/images/views.gif"],
        .newgallery .photo .stats img[src="/images/views.gif"],
        .image_list .photo .stats img[src="/images/views.gif"],
        .gallery .photo .stats img[src="/images/comments.gif"],
        .newgallery .photo .stats img[src="/images/comments.gif"],
        .image_list .photo .stats img[src="/images/comments.gif"],
        .gallery .photo .stats img[src="/images/critiques.gif"],
        .newgallery .photo .stats img[src="/images/critiques.gif"],
        .image_list .photo .stats img[src="/images/critiques.gif"],
        .gallery .photo .stats img[alt*="Odsłon"],
        .newgallery .photo .stats img[alt*="Odsłon"],
        .image_list .photo .stats img[alt*="Odsłon"],
        .gallery .photo .stats img[title*="Odsłon"],
        .newgallery .photo .stats img[title*="Odsłon"],
        .image_list .photo .stats img[title*="Odsłon"],
        body.mobile-gallery .gallery .photo .stats img[src*="views"],
        body.mobile-gallery .newgallery .photo .stats img[src*="views"],
        body.mobile-gallery .image_list .photo .stats img[src*="views"],
        body.mobile-gallery .gallery .photo .stats img[src*="comments"],
        body.mobile-gallery .newgallery .photo .stats img[src*="comments"],
        body.mobile-gallery .image_list .photo .stats img[src*="comments"],
        body.mobile-gallery .gallery .photo .stats img[src="/images/views.gif"],
        body.mobile-gallery .newgallery .photo .stats img[src="/images/views.gif"],
        body.mobile-gallery .image_list .photo .stats img[src="/images/views.gif"],
        body.mobile-gallery .gallery .photo .stats img[alt*="Odsłon"],
        body.mobile-gallery .newgallery .photo .stats img[alt*="Odsłon"],
        body.mobile-gallery .image_list .photo .stats img[alt*="Odsłon"] {
            width: auto !important;
            height: auto !important;
            max-width: 16px !important;
            min-width: auto !important;
            min-height: auto !important;
            max-height: 16px !important;
            display: inline-block !important;
            position: static !important;
            float: none !important;
            clear: none !important;
            margin: 0 !important;
            padding: 0 !important;
            object-fit: contain !important;
            aspect-ratio: auto !important;
        }
    }
    
    /* Usuń clearfix i clear - Grid go nie potrzebuje */
    .clearfix,
    .clear,
    div.clear,
    [class*="clear"] {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        clear: none !important;
        float: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Obrazki responsywne */
    .photo img.user_photo {
        max-width: 100% !important;
        height: auto !important;
        width: 100% !important;
        object-fit: contain !important;
    }
    
    /* Linki w miniaturach - tylko dla pojedynczych .photo (nie w galeriach) */
    .photo:not(.gallery .photo):not(.newgallery .photo):not(.image_list .photo) a.photo-link,
    .photo:not(.gallery .photo):not(.newgallery .photo):not(.image_list .photo) a {
        width: 100% !important;
        height: auto !important;
        line-height: normal !important;
        display: block !important;
    }
    
    /* Linki w galeriach - zachowaj inline-block dla 2 w rzędzie */
    .gallery .photo a,
    .newgallery .photo a,
    .image_list .photo a {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        line-height: normal !important;
    }
    
    /* Tytuł i stats mniejsze */
    .photo .title {
        font-size: 11px !important;
        padding: 3px 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .photo .stats,
    .gallery .photo .stats,
    .newgallery .photo .stats,
    .image_list .photo .stats,
    p.stats {
        font-size: 11px !important;
        line-height: 1.2 !important;
        padding: 4px 0 !important;
        margin: 4px 0 0 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .photo .stats img {
        width: 12px !important;
        height: auto !important;
    }
    
    .photo .date {
        font-size: 9px !important;
    }
    
    /* Section - bez górnego paddingu */
    .section {
        padding: 10px 5px !important;
    }
    
    .section h2 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    
    /* Clear po każdych 2 zdjęciach */
    .photo:nth-child(2n)::after {
        content: "";
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2, 8px);
        clear: both;
    }
}

@media only screen and (max-width: 768px) {
    body.mobile-gallery .gallery .photo .stats span,
    body.mobile-gallery .image_list .photo .stats span,
    body.mobile-gallery .gallery .photo .stats img,
    body.mobile-gallery .image_list .photo .stats img {
        display: none !important;
    }
    
    body.mobile-gallery .gallery .photo .stats span:first-of-type,
    body.mobile-gallery .image_list .photo .stats span:first-of-type,
    body.mobile-gallery .gallery .photo .stats span:first-of-type,
    body.mobile-gallery .image_list .photo .stats span:first-of-type,
    body.mobile-gallery .gallery .photo .stats span:last-of-type,
    body.mobile-gallery .image_list .photo .stats span:last-of-type {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-weight: 600 !important;
        color: #fff !important;
    }
    
    body.mobile-gallery .gallery .photo .stats span:first-of-type + img,
    body.mobile-gallery .image_list .photo .stats span:first-of-type + img,
    body.mobile-gallery .gallery .photo .stats span:last-of-type + img,
    body.mobile-gallery .image_list .photo .stats span:last-of-type + img {
        display: inline-block !important;
        width: 14px !important;
        height: auto !important;
    }
    
    body.mobile-gallery .gallery .photo .stats span:nth-of-type(n+2):not(:last-of-type),
    body.mobile-gallery .image_list .photo .stats span:nth-of-type(n+2):not(:last-of-type),
    body.mobile-gallery .gallery .photo .stats span:nth-of-type(n+2):not(:last-of-type) + img,
    body.mobile-gallery .image_list .photo .stats span:nth-of-type(n+2):not(:last-of-type) + img {
        display: none !important;
    }
}
/* --- FINAL MOBILE OVERRIDES (ensure GW layout matches homepage) --- */
@media only screen and (max-width: 768px) {
    /* Pełna szerokość belki filtrów na mobilu */
    body.mobile-gallery #category_picker,
    body.mobile-gallery #category_picker.szaraBelka,
    body.mobile-gallery #cPickerCategory,
    body.mobile-gallery #cPickerSort {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    body.mobile-gallery .lista_kategorie,
    body.mobile-gallery .darkColumn,
    body.mobile-gallery .komLista {
        display: none !important;
    }

    body.mobile-gallery #cPickerSort {
        gap: 0 !important; /* bez gap — używamy marginesów na przyciskach */
        margin: 8px 0 12px !important;
        padding: 0 12px !important;
        font-size: 0 !important;
        justify-content: space-between !important;
    }

    body.mobile-gallery #cPickerSort .main_group {
        display: none !important;
    }

    body.mobile-gallery #cPickerSort #gr_najnowsze,
    body.mobile-gallery #cPickerSort #gr_polecane {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        min-width: max-content !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        align-items: center !important;
        height: auto !important;
        padding: 10px 16px !important;
        margin: 0 6px !important;
        border-radius: 999px !important;
        border: 1px solid #333 !important;
        background: #1c1c1c !important;
        color: #fff !important;
        text-decoration: none !important;
        text-transform: uppercase !important;
        font-size: 13px !important;
        letter-spacing: 0.3px !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
    }

    body.mobile-gallery #cPickerSort #gr_najnowsze.selected,
    body.mobile-gallery #cPickerSort #gr_polecane.selected {
        background: #c01616 !important;
        border-color: #f04c4c !important;
    }

    body.mobile-gallery .gallery,
    body.mobile-gallery .newgallery,
    body.mobile-gallery .image_list,
    body.mobile-gallery td .image_list {
        /* display: grid !important; */
        /* grid-template-columns: repeat(2, minmax(0, 1fr)) !important; */
        /* gap: 10px !important; */
        padding: 8px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        box-sizing: border-box !important;
        width: 100% !important; /* Zmienione z 100vw na 100% */
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto !important; /* Wycentruj galerię */
        margin-left: auto !important;
        margin-right: auto !important;
        left: auto !important;
        right: auto !important;
        position: relative !important;
        transform: none !important;
        text-align: center !important; /* Wycentruj miniatury */
        display: block !important; /* Upewnij się że to block */
    }
    
    /* <td> zawierający .image_list - wycentruj zawartość */
    body.mobile-gallery td:has(.image_list),
    body.mobile-gallery td .image_list {
        text-align: center !important;
    }
    
    body.mobile-gallery .gallery .photo,
    body.mobile-gallery .image_list .photo {
        /* width: 100% !important; - WYŁĄCZONE dla 2 miniatury w rzędzie */
        /* max-width: 100% !important; - WYŁĄCZONE dla 2 miniatury w rzędzie */
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 12px !important;
        background: #171717 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.mobile-gallery .gallery .photo a.photo-link,
    body.mobile-gallery .image_list .photo a.photo-link,
    body.mobile-gallery .gallery .photo a,
    body.mobile-gallery .image_list .photo a {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        line-height: normal !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    body.mobile-gallery .gallery .photo .title,
    body.mobile-gallery .image_list .photo .title,
    body.mobile-gallery .gallery .photo .date,
    body.mobile-gallery .image_list .photo .date {
        display: none !important;
    }

    body.mobile-gallery .gallery .photo .stats,
    body.mobile-gallery .image_list .photo .stats {
        display: block !important;
        text-align: center !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        color: rgba(255,255,255,0.9) !important;
        margin: 4px 0 0 0 !important;
        padding: 4px 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.mobile-gallery .gallery .photo .stats a,
    body.mobile-gallery .image_list .photo .stats a {
        display: none !important;
    }
    body.mobile-gallery .gallery .photo .stats a.userlogin,
    body.mobile-gallery .image_list .photo .stats a.userlogin,
    body.mobile-gallery .gallery .photo .stats a[href*="/portfolio/"],
    body.mobile-gallery .image_list .photo .stats a[href*="/portfolio/"],
    body.mobile-gallery .gallery .photo .stats a:first-child,
    body.mobile-gallery .image_list .photo .stats a:first-child {
        display: block !important;                 /* login jako pierwszy wiersz */
        color: #ff6464 !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        margin: 0 0 2px 0 !important;              /* odstęp nad statystykami */
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    /* Gwarantowany margines 2px między loginem a statystykami */
    body.mobile-gallery .gallery .photo .stats a.userlogin,
    body.mobile-gallery .image_list .photo .stats a.userlogin {
        margin-bottom: 2px !important;
        line-height: 1.1 !important;   /* ciaśniejszy wiersz loginu */
        padding: 0 !important;         /* bez dodatkowego pionu */
    }

    /* Dodatkowo – usuń marginesy na pierwszym wierszu statów, jeśli występują jako kontener */
    body.mobile-gallery .gallery .photo .stats .stats-row:first-child,
    body.mobile-gallery .image_list .photo .stats .stats-row:first-child {
        margin-top: 0 !important;
    }

    body.mobile-gallery .gallery .photo .stats .stats-row,
    body.mobile-gallery .image_list .photo .stats .stats-row {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 11px !important;
        color: rgba(255,255,255,0.85) !important;
    }

    body.mobile-gallery .gallery .photo .stats .stats-row .stats-value,
    body.mobile-gallery .image_list .photo .stats .stats-row .stats-value {
        font-weight: 600 !important;
        color: #fff !important;
        display: inline-block !important;
    }

    body.mobile-gallery .gallery .photo .stats .stats-row img,
    body.mobile-gallery .image_list .photo .stats .stats-row img {
        width: 14px !important;
        height: auto !important;
        display: inline-block !important;
    }

    /* GLOBALNIE: ujednolicenie wysokości miniatur pod zdjęciem na mobilu */
    body.mobile-gallery .gallery .photo a img.user_photo,
    body.mobile-gallery .image_list .photo a img.user_photo,
    body.mobile-gallery .gallery .photo a img,
    body.mobile-gallery .image_list .photo a img,
    body.mobile-gallery .gallery .photo img,
    body.mobile-gallery .image_list .photo img {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    /* (Revert) GN: usunięto kopiowane ustawienia ze strony głównej */
}

@media only screen and (max-width: 768px) {
    /* GN refined: zachowaj grid, ale ujednolić karty i odstępy */
    body.mobile-gallery .newgallery .image_list { 
        display: contents !important; /* nie psuj grida w kontenerze */
    }
    body.mobile-gallery .newgallery .photo {
        padding: 6px !important; /* Zmienione z 0 na 6px dla 2 miniatury w rzędzie */
        gap: 0 !important;
        overflow: hidden !important;
    }
    body.mobile-gallery .newgallery .photo p,
    body.mobile-gallery .newgallery .photo a { 
        margin: 0 !important; 
        padding: 0 !important; 
    }
    body.mobile-gallery .newgallery .photo .stats {
        text-align: center !important;
        margin-top: 2px !important;
        line-height: 1.1 !important;
    }
    body.mobile-gallery .newgallery .photo .stats a.userlogin {
        display: block !important;
        margin-bottom: 2px !important; /* dokładnie 2px */
        line-height: 1.1 !important;
    }
    body.mobile-gallery .newgallery .photo .stats br { display: none !important; }
}

@media only screen and (max-width: 768px) {
/* Zmniejsz wysokość linku loginu z klasą .art w stats (czasem ma sztuczną wysokość ~167px) */
body.mobile-gallery .gallery .photo .stats a.art,
body.mobile-gallery .image_list .photo .stats a.art,
body.mobile-gallery .newgallery .photo .stats a.art {
    display: block !important;
    height: 20px !important;
    max-height: 20px !important;
    line-height: 20px !important;
    padding: 0 !important;
    margin: 0 0 2px 0 !important;
    overflow: hidden !important;
}

    /* GALERIE - 2 miniatury w rzędzie - NAJWYŻSZA SPECYFICZNOŚĆ - NA KOŃCU */
    html body .gallery .photo,
    html body .newgallery .photo,
    html body .image_list .photo,
    html body .image_list .image,
    html body body.mobile-gallery .gallery .photo,
    html body body.mobile-gallery .newgallery .photo,
    html body body.mobile-gallery .image_list .photo,
    html body body.mobile-gallery .image_list .image,
    body.mobile-gallery .gallery .photo,
    body.mobile-gallery .newgallery .photo,
    body.mobile-gallery .image_list .photo,
    body.mobile-gallery .image_list .image,
    .gallery .photo,
    .newgallery .photo,
    .image_list .photo,
    .image_list .image {
        float: none !important;
        display: inline-block !important;
        width: 300px !important;
        max-width: 300px !important;
        min-width: 0 !important;
        margin: 4px !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
        background-color: #171717 !important;
        border-radius: 12px !important;
        position: relative !important;
        text-align: center !important;
        clear: none !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
        z-index: 10 !important;
    }
    
    /* Linki w miniaturach - MUSZĄ być klikalne */
    html body .gallery .photo a,
    html body .newgallery .photo a,
    html body .image_list .photo a,
    html body .image_list .image a,
    body.mobile-gallery .gallery .photo a,
    body.mobile-gallery .newgallery .photo a,
    body.mobile-gallery .image_list .photo a,
    body.mobile-gallery .image_list .image a,
    .gallery .photo a,
    .newgallery .photo a,
    .image_list .photo a,
    .image_list .image a {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
        display: block !important;
        position: relative !important;
        z-index: 20 !important;
        text-decoration: none !important;
    }
    
    /* Obrazki w linkach - też klikalne i wycentrowane */
    html body .gallery .photo a img,
    html body .newgallery .photo a img,
    html body .image_list .photo a img,
    html body .image_list .image a img,
    body.mobile-gallery .gallery .photo a img,
    body.mobile-gallery .newgallery .photo a img,
    body.mobile-gallery .image_list .photo a img,
    body.mobile-gallery .image_list .image a img,
    .gallery .photo a img,
    .newgallery .photo a img,
    .image_list .photo a img,
    .image_list .image a img {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
        display: block !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Wycentruj linki w miniaturach (flexbox dla lepszego centrowania) */
    html body .gallery .photo a,
    html body .newgallery .photo a,
    html body .image_list .photo a,
    body.mobile-gallery .gallery .photo a,
    body.mobile-gallery .newgallery .photo a,
    body.mobile-gallery .image_list .photo a,
    .gallery .photo a,
    .newgallery .photo a,
    .image_list .photo a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 150px !important;
    }
    
    /* Kontenery galerii - font-size: 0 żeby usunąć odstępy między inline-block */
    @media only screen and (max-width: 768px) {
        .gallery,
        .newgallery,
        .image_list,
        body.mobile-gallery .gallery,
        body.mobile-gallery .newgallery,
        body.mobile-gallery .image_list,
        html body .gallery,
        html body .newgallery,
        html body .image_list,
        html body td .image_list,
        html body div.image_list {
            font-size: 0 !important;
            text-align: center !important; /* Wycentruj miniatury */
            margin: 0 auto !important; /* Wycentruj kontener */
            display: block !important;
        }
        
        /* <td> zawierający .image_list - wycentruj */
        html body td:has(> .image_list) {
            text-align: center !important;
        }
        
        /* Przywróć font-size dla elementów wewnątrz */
        .gallery *,
        .newgallery *,
        .image_list *,
        body.mobile-gallery .gallery *,
        body.mobile-gallery .newgallery *,
        body.mobile-gallery .image_list * {
            font-size: 14px !important;
        }
    }
    
    /* Specjalne reguły dla .image_list .image (GN galeria) - WYSOKA SPECYFICZNOŚĆ */
    @media only screen and (max-width: 768px) {
        html body .image_list .image,
        html body td.image_list .image,
        body.mobile-gallery .image_list .image,
        body.mobile-gallery td.image_list .image,
        html body body.mobile-gallery .image_list .image,
        html body body.mobile-gallery td.image_list .image,
        .image_list .image,
        td.image_list .image {
            width: calc(50% - 8px) !important;
            max-width: calc(50% - 8px) !important;
            min-width: 0 !important;
            height: auto !important;
            min-height: 0 !important;
            margin: 4px auto !important; /* Wycentruj miniatury */
            margin-left: auto !important;
            margin-right: auto !important;
            padding: 6px !important;
            box-sizing: border-box !important;
            display: inline-block !important;
            vertical-align: top !important;
            float: none !important;
            clear: none !important;
            background: #171717 !important;
            background-image: none !important;
            border-radius: 12px !important;
            position: relative !important;
            text-align: center !important;
            pointer-events: auto !important;
            touch-action: manipulation !important;
            cursor: pointer !important;
        }
        
        /* Linki w miniaturach MUSZĄ być klikalne */
        html body .image_list .image a,
        body.mobile-gallery .image_list .image a,
        .image_list .image a {
            pointer-events: auto !important;
            touch-action: manipulation !important;
            cursor: pointer !important;
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            position: relative !important;
            z-index: 10 !important;
        }
        
        /* Obrazki w linkach też klikalne */
        html body .image_list .image a img,
        body.mobile-gallery .image_list .image a img,
        .image_list .image a img {
            pointer-events: auto !important;
            touch-action: manipulation !important;
            cursor: pointer !important;
        }
        
        html body .image_list .image table,
        html body td.image_list .image table,
        body.mobile-gallery .image_list .image table,
        body.mobile-gallery td.image_list .image table,
        .image_list .image table,
        td.image_list .image table {
            width: 100% !important;
            max-width: 100% !important;
            height: auto !important;
            border: none !important;
            border-spacing: 0 !important;
            margin: 0 auto !important; /* Wycentruj tabelę */
            display: flex !important; /* Modern flexbox layout */
            flex-wrap: wrap !important;
            gap: var(--space-2, 8px) !important;
        }
        
        html body .image_list .image table td,
        body.mobile-gallery .image_list .image table td,
        .image_list .image table td {
            padding: 4px !important;
            vertical-align: middle !important;
            height: auto !important;
        }
        
        html body .image_list .image table tr:first-child td,
        body.mobile-gallery .image_list .image table tr:first-child td,
        .image_list .image table tr:first-child td {
            height: auto !important;
            max-height: none !important;
        }
        
        html body .image_list .image img,
        body.mobile-gallery .image_list .image img,
        .image_list .image img {
            max-width: 100% !important;
            width: auto !important;
            height: auto !important;
            display: block !important;
            margin: 0 auto !important;
            border: none !important;
        }
        
        /* Wycentruj obrazek w tabeli (poziomo i pionowo) */
        /* Wycentruj obrazek w tabeli - TYLKO dla miniatur w galeriach */
        /* Komórka z obrazkiem - wycentruj zawartość */
        html body .image_list .image table tr:first-child td,
        html body td.image_list .image table tr:first-child td,
        body.mobile-gallery .image_list .image table tr:first-child td,
        body.mobile-gallery td.image_list .image table tr:first-child td,
        .image_list .image table tr:first-child td,
        td.image_list .image table tr:first-child td {
            text-align: center !important;
            vertical-align: middle !important;
            height: auto !important;
            min-height: 0 !important;
            padding: 4px !important;
        }
        
        /* Wycentruj link w komórce */
        html body .image_list .image table tr:first-child td a,
        html body td.image_list .image table tr:first-child td a,
        body.mobile-gallery .image_list .image table tr:first-child td a,
        body.mobile-gallery td.image_list .image table tr:first-child td a,
        .image_list .image table tr:first-child td a,
        td.image_list .image table tr:first-child td a {
            display: block !important;
            text-align: center !important;
            width: 100% !important;
            height: auto !important;
            margin: 0 auto !important;
        }
        
        /* Wycentruj obrazek w linku */
        html body .image_list .image table tr:first-child td a img,
        html body td.image_list .image table tr:first-child td a img,
        body.mobile-gallery .image_list .image table tr:first-child td a img,
        body.mobile-gallery td.image_list .image table tr:first-child td a img,
        .image_list .image table tr:first-child td a img,
        td.image_list .image table tr:first-child td a img {
            display: block !important;
            margin: 0 auto !important;
            max-width: 100% !important;
            width: auto !important;
            height: auto !important;
        }
        
        html body .image_list .image .subtitle,
        body.mobile-gallery .image_list .image .subtitle,
        .image_list .image .subtitle {
            font-size: 11px !important;
            padding: 4px !important;
            line-height: 1.4 !important;
        }
        
        html body .image_list .image .subtitle b,
        body.mobile-gallery .image_list .image .subtitle b,
        .image_list .image .subtitle b {
            font-size: 12px !important;
            display: block !important;
            margin-bottom: 4px !important;
            font-weight: 600 !important;
        }
        
        /* Usuń clear:both z divów wewnątrz */
        html body .image_list .image div[style*="clear"],
        body.mobile-gallery .image_list .image div[style*="clear"],
        .image_list .image div[style*="clear"] {
            display: none !important;
        }
    }
    
    /* Pozostałe .photo (nie w galeriach) - wyśrodkowane */
    .photo:not(.gallery .photo):not(.newgallery .photo):not(.image_list .photo),
    body.mobile-gallery .photo:not(.gallery .photo):not(.newgallery .photo):not(.image_list .photo) {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 10px !important;
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        text-align: center !important;
        clear: both !important;
    }
    
    /* Wyśrodkuj również linki i obrazki w miniaturach */
    .photo a,
    .gallery .photo a,
    .newgallery .photo a,
    .image_list .photo a,
    .photo a.photo-link {
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .photo a img,
    .gallery .photo a img,
    .newgallery .photo a img,
    .image_list .photo a img {
        display: block !important;
        margin: 0 auto !important;
        float: none !important;
    }
    
    /* Ukryj napis "Automatyczne ładowanie (infinite scroll)" - tylko sam element toggle i jego bezpośredni kontener */
    #infinite-scroll-toggle,
    label[for="infinite-scroll-toggle"],
    label:has(#infinite-scroll-toggle),
    #infinite-scroll-toggle + span,
    label[for="infinite-scroll-toggle"] span,
    label:has(#infinite-scroll-toggle) span {
        display: none !important;
    }
    
    /* Ukryj tylko div z toggle - użyj specyficznego selektora dla diva z inline style */
    div[style*="text-align: right"][style*="margin: 10px 0"]:has(#infinite-scroll-toggle) {
        display: none !important;
    }
    
    /* Wszystkie tabele i komórki na pełną szerokość - OGRANICZ DO VIEWPORT */
    table {
        width: 100% !important;
        max-width: 100vw !important;
        table-layout: fixed !important;
        box-sizing: border-box !important;
    }
    
    td,
    tr {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* <td> zawierający .image_list - szczególnie ogranicz szerokość i wycentruj */
    td:has(.image_list),
    td:has(> .image_list) {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    /* GALERIE - 2 miniatury w rzędzie - NAJWYŻSZA SPECYFICZNOŚĆ - NA SAMYM KOŃCU */
    html body .gallery .photo,
    html body .newgallery .photo,
    html body .image_list .photo,
    html body body.mobile-gallery .gallery .photo,
    html body body.mobile-gallery .newgallery .photo,
    html body body.mobile-gallery .image_list .photo,
    body.mobile-gallery .gallery .photo,
    body.mobile-gallery .newgallery .photo,
    body.mobile-gallery .image_list .photo,
    .gallery .photo,
    .newgallery .photo,
    .image_list .photo {
        float: none !important;
        display: inline-block !important;
        width: 300px !important;
        max-width: 300px !important;
        min-width: 0 !important;
        margin: 4px !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
        background-color: #171717 !important;
        border-radius: 12px !important;
        position: relative !important;
        text-align: center !important;
        clear: none !important;
    }
    
    /* Kontenery galerii - font-size: 0 żeby usunąć odstępy między inline-block - NAJWYŻSZA SPECYFICZNOŚĆ */
    html body html body .gallery,
    html body html body .newgallery,
    html body html body .image_list,
    html body html body td.image_list,
    html body body.mobile-gallery .gallery,
    html body body.mobile-gallery .newgallery,
    html body body.mobile-gallery .image_list,
    html body body.mobile-gallery td.image_list,
    html body .gallery,
    html body .newgallery,
    html body .image_list,
    html body td.image_list,
    body.mobile-gallery .gallery,
    body.mobile-gallery .newgallery,
    body.mobile-gallery .image_list,
    body.mobile-gallery td.image_list,
    .gallery,
    .newgallery {
        font-size: 0 !important;
        text-align: center !important; /* Wycentruj miniatury */
        margin: 0 auto !important; /* Wycentruj kontener */
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        display: block !important;
    }
    
    /* .image_list - użyj flexbox dla lepszego wycentrowania */
    .image_list,
    div.image_list,
    td.image_list {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important; /* Wycentruj miniatury */
        align-items: flex-start !important;
        text-align: center !important;
        margin: 0 auto !important;
        padding: 8px !important;
        box-sizing: border-box !important;
    }
    
    /* Specjalnie dla td.image_list - upewnij się że jest wycentrowane */
    td.image_list {
        text-align: center !important;
        vertical-align: top !important;
    }
    
    /* Przywróć font-size dla elementów wewnątrz */
    html body .gallery *,
    html body .newgallery *,
    html body .image_list *,
    body.mobile-gallery .gallery *,
    body.mobile-gallery .newgallery *,
    body.mobile-gallery .image_list *,
    .gallery *,
    .newgallery *,
    .image_list * {
        font-size: 14px !important;
    }
}
