:root{
  --bg:#0d0f14;
  --panel:#121621;
  --panel2:#0f131c;
  --text:#e8eefc;
  --muted:#aab4cc;
  --muted2:#7f8aa6;
  --border:rgba(255,255,255,.08);
  --accent:#bfff00;
  --shadow: 0 6px 18px rgba(0,0,0,.22);
  --radius:14px;
  --radius2:18px;
  --sidebarW: 460px;
  --sidebarWCollapsed: 68px;
  --lbTopH: 56px;
  --pagePad: 22px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

/* Fade-in przy pierwszym załadowaniu aplikacji */
body.app-fade-init .app{
  opacity: 0;
}
body.app-fade-in .app{
  opacity: 1;
  transition: opacity 1s ease;
}
body.is-lightbox-open .app{
  opacity: 0;
  transition: opacity .28s ease;
}
@media (prefers-reduced-motion: reduce){
  body.app-fade-init .app,
  body.app-fade-in .app,
  body.is-lightbox-open .app{
    opacity: 1;
    transition: none;
  }
}

/* Ułatwia stylowanie natywnych kontrolek (select/scrollbar) w ciemnym motywie */
html{
  color-scheme: dark;
}

/* Globalny overlay (np. podczas generowania miniaturek) */
.busyOverlay{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  padding: 12px 14px 16px;
  pointer-events: none;
}
.busyOverlay[hidden]{ display: none !important; }
.busyOverlay__card{
  width: min(520px, 88vw);
  background: rgba(18,22,33,.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.busyOverlay__title{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}
.busyOverlay__progress{
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
}

.busyOverlay__progress .pbar{
  width: 100%;
}
.busyOverlay__count{
  font-size: 12px;
  color: var(--muted);
  min-width: 52px;
  text-align: left;
}
.busyOverlay__actions{
  display: inline-flex;
  gap: 8px;
}

/* Gdy galeria jest tylko dla zalogowanych i pokazujemy login na stronie głównej,
   ukryj topbar (toolbar). W trybie albumu przez link (bez logowania) toolbar zostaje. */
body.is-loginGate .toolbar{
  display: none;
}

/* Utrudnij kopiowanie obrazów */
body.is-copyProtected .grid,
body.is-copyProtected .lightbox{
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

a{ color:inherit; text-decoration:none; }

.app{
  display:flex;
  height:100%;
  width:100%;
  overflow:hidden;
  transition: opacity .28s ease;
}

/* Sidebar */
.sidebar{
  width: var(--sidebarW);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap: 10px;
  transition: width .22s ease, transform .22s ease;
  position: relative;
}

/* Sidebar overlay (autoukrywanie jak pasek Windows) — nie zmienia szerokości galerii */
.app.sidebar-overlay .sidebar{
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100%;
  width: var(--sidebarW);
  max-width: 92vw;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.app.sidebar-overlay .sidebar:not(.is-collapsed){
  transform: translateX(0);
}
/* Nadpisz desktopowe "width:0" dla .sidebar.is-collapsed */
@media (min-width: 681px){
  .app.sidebar-overlay .sidebar.is-collapsed{
    width: var(--sidebarW);
    min-width: 0;
    border-right: 1px solid var(--border);
    overflow: hidden;
  }
  /* W overlay trybie pokazuj X (żeby dało się szybko schować) */
  .app.sidebar-overlay .sidebar__close-btn{
    display: flex !important;
  }
}
@media (max-width: 680px){
  .app.sidebar-overlay .sidebar{
    width: 100vw;
    max-width: 100vw;
  }
}
/* Na desktopie: ukryj przycisk X, użyj uchwytu do zwijania */
@media (min-width: 681px){
  .sidebar__close-btn{
    display: none !important;
  }
}
/* Na desktopie: całkowicie ukryj sidebar gdy jest zwinięty */
@media (min-width: 681px){
  .sidebar.is-collapsed{ 
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
  }
}
/* Na telefonach: zachowaj poprzednie zachowanie */
@media (max-width: 680px){
  .sidebar.is-collapsed{ width: var(--sidebarWCollapsed); }
}
.sidebar__top{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 14px;
  min-height: 0;
}
.sidebar__brand{ min-width:0; }
.brand__title{ font-weight:700; letter-spacing:.3px; }
.brand__meta{ font-size:12px; color: var(--muted2); margin-top:2px; }
.sidebar.is-collapsed .sidebar__brand,
.sidebar.is-collapsed .sidebar__tools,
.sidebar.is-collapsed .albums,
.sidebar.is-collapsed .sidebar__bottom{ display:none; }

.sidebar__bottom{
  margin-top: auto;
  padding: 12px 14px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar__separator{
  display: none;
}
.sidebar__info{
  flex: 1;
  min-width: 0;
}
.sidebar__count{
  font-size: 12px;
  color: var(--muted2);
  text-align: left;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.sidebar__count strong{
  color: var(--text);
  font-weight: 600;
}
.sidebar__user-btn{
  flex-shrink: 0;
}
.sidebar__close-btn{
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.15);
  border: 1px solid rgba(255, 0, 0, 0.3);
  color: #ff4444;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sidebar__close-btn:hover{
  background: rgba(255, 0, 0, 0.25);
  border-color: rgba(255, 0, 0, 0.5);
}
/* Czerwony X pokazuj gdy sidebar jest otwarty (na mobile i desktop) */
.sidebar:not(.is-collapsed) .sidebar__close-btn{
  display: flex;
}

.sidebar__tools{
  padding: 0 14px 10px 14px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.sidebar__logo{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height .25s ease, opacity .2s ease, transform .25s ease, padding .2s ease;
  overflow: hidden;
  pointer-events: none;
}
.sidebar__logo.is-visible{
  padding: 4px 6px;
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sidebar__logo-inner{
  position: relative;
  width: 100%;
  height: 90px;
  display:flex;
  justify-content:center;
  align-items:center;
}
.sidebar__logo-img{
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
  display:block;
  opacity: 0;
  transition: opacity .25s ease;
}
.sidebar__logo-img.is-active{
  opacity: 1;
}

.search{
  display:flex;
  align-items:center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(0,0,0,.18);
  width: 100%;
  box-sizing: border-box;
}
.search input{
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
  max-width: 100%;
  box-sizing: border-box;
  outline:none;
  border:0;
  background:transparent;
  color: var(--text);
  font-size:14px;
}
.search input::placeholder{ color: rgba(170,180,204,.65); }

.albums{
  overflow:auto;
  padding: 4px 8px 14px 8px;
  list-style: none;
}
.albums__divider{
  height: 1px;
  background: var(--border);
  margin: 10px 8px;
  opacity: .85;
}
.albums::-webkit-scrollbar{ width:10px; }
.albums::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.10); border-radius: 999px; }
.albums::-webkit-scrollbar-track{ background: transparent; }

.album{
  display:grid;
  grid-template-columns: auto 1fr 100px;
  align-items:center;
  gap: 8px;
  padding: 4px 8px;
  margin: 0;
  border-radius: 4px;
  border: none;
  transition: background .14s ease;
  cursor:pointer;
}
.album--sub{
  /* Podalbum w sidebarze (2. poziom) */
  padding-left: 22px;
  grid-template-columns: auto 1fr 92px;
}
.album--sub .album__title{
  font-size: 12.5px;
  opacity: .92;
}
.album--sub .album__date{
  font-size: 11.5px;
  opacity: .75;
}
.album--sub .album__bullet{
  opacity: .7;
}
.album:hover{
  background: rgba(255,255,255,.05);
}
.album.is-active{
  background: rgba(191,255,0,.10);
}
.album.is-live .album__title{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.album.is-live .album__title::after{
  content: "";
  position: static;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 6px rgba(255, 59, 59, 0.8);
  animation: albumLivePulse 2.8s ease-in-out infinite;
}
@keyframes albumLivePulse{
  0%{ opacity: .45; box-shadow: 0 0 4px rgba(255, 59, 59, 0.35); }
  50%{ opacity: 1; box-shadow: 0 0 9px rgba(255, 59, 59, 0.85); }
  100%{ opacity: .45; box-shadow: 0 0 4px rgba(255, 59, 59, 0.35); }
}
.album--all-wrapper{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
}
.album--all-wrapper:hover{
  background: transparent;
}
.album--all-wrapper .album--all{
  background: transparent;
}
.album--all-wrapper .album--all:hover{
  background: rgba(255,255,255,.05);
}
.album--all{
  flex: 1;
  margin-bottom: 0;
}
.album__sort-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.album__sort-btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
}
.album__sort-btn .icon{
  width: 14px;
  height: 14px;
  opacity: 0.8;
}
.album__title{
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  min-width:0;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  grid-column: 2;
  position: relative;
}
.album__date{
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted2);
  opacity: 0.8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  grid-column: 3;
  font-family: "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", "Helvetica Condensed", "Arial", "Courier New", monospace;
  letter-spacing: 0.02em;
}
.album__bullet{
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted2);
  opacity: .6;
  width: 12px;
  text-align: center;
  grid-column: 1;
}
.album .icon--home,
.album .icon--folder{
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: .7;
}
.album.is-active .icon--home,
.album.is-active .icon--folder{
  opacity: 1;
}

.album-info{
  margin: 12px var(--pagePad);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(80, 120, 255, 0.12);
  border: 1px solid rgba(80, 120, 255, 0.35);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.album-info__text{
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.album-info__close{
  flex-shrink: 0;
  margin-left: auto;
  padding: 1px 4px;
  font-size: 12px;
}

.album-info-popup{
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.album-info-popup[hidden]{
  display: none !important;
}
.album-info[hidden]{
  display: none !important;
}
.album-info-popup__card{
  width: min(520px, calc(100vw - 32px));
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.album-info-popup__text{
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.album-info-popup__actions{
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.info-format{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.info-format__group{
  display: flex;
  gap: 4px;
}
.info-format__btn{
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
}
.info-format__btn .icon{
  width: 14px;
  height: 14px;
}
.info-format__btn.is-active{
  background: rgba(255,255,255,.12);
  color: var(--accent);
}
.info-format__color{
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-format__size{
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-format__color input[type="color"]{
  width: 32px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
}
.info-format__color input[type="color"].is-disabled{
  opacity: .5;
}

/* Main */
.main{
  flex: 1;
  overflow:auto;
  position: relative;
}
.main::-webkit-scrollbar{ width: 12px; }
.main::-webkit-scrollbar-track{ background: transparent; }
.main::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.10);
  border-radius: 0; /* bez „marginesu” od krawędzi */
}

.siteHeader{
  padding: 22px var(--pagePad) 10px var(--pagePad);
}
.hero{
  border-radius: var(--radius2);
  overflow:hidden;
  border: 1px solid var(--border);
  background: var(--panel2);
  box-shadow: var(--shadow);
}
.hero__inner{
  padding: 18px 18px 14px 18px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
}
.hero__title{
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .92;
}
.hero__subtitle{
  color: var(--muted2);
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero__nav{
  display:flex;
  gap: 14px;
  flex-wrap:wrap;
}
.hero__nav a{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(232,238,252,.85);
  opacity: .9;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}
.hero__nav a:hover{ border-bottom-color: rgba(191,255,0,.35); color: var(--text); }

.toolbar{
  padding: 14px var(--pagePad);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.crumbs{ display:flex; gap: 8px; align-items:center; min-width:0; flex: 1; }
.crumbs__label{ color: var(--muted2); font-size: 12px; letter-spacing:.08em; text-transform: uppercase; }
.crumbs__sep{
  color: var(--muted2);
  opacity: .7;
  font-weight: 800;
  flex: 0 0 auto;
}
.crumbs__value{ 
  font-weight: 650; 
  min-width:0; 
  overflow:hidden; 
  text-overflow:ellipsis; 
  white-space:nowrap;
  flex: 1;
  max-width: 100%;
}
.crumbs__value--link{
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 650; /* jak .crumbs__value */
  text-align: left;
  cursor: pointer;
  flex: 0 1 auto; /* niech nie wypycha aktywnego tytułu */
  max-width: 240px;
}
.crumbs__value--link:hover{
  text-decoration: underline;
  text-decoration-color: rgba(232,238,252,.65);
}
/* Na telefonach - przycinaj tytuł bardziej agresywnie */
@media (max-width: 680px){
  .crumbs{
    gap: 6px;
    max-width: calc(100vw - 120px); /* Zostaw miejsce na przycisk menu */
  }
  .crumbs__value{
    max-width: calc(100vw - 160px); /* Zostaw miejsce na przycisk domku i menu */
    font-size: 13px;
  }
}

.toolbar__right{ display:flex; align-items:center; gap: 8px; position: relative; }
.toolbar__menu-toggle{ display: none; } /* Ukryty na większych ekranach */
.toolbar__menu{ display:flex; align-items:center; gap: 8px; }
.toolbar__pinned{ display:flex; align-items:center; gap: 8px; }
.toolbar__right.toolbar__right--menu .toolbar__menu-toggle{ display: flex; }
.toolbar__menu.toolbar__menu--dropdown{
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  z-index: 100;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 24px);
}
.toolbar__menu.toolbar__menu--dropdown.is-open{ display: flex; }
.toolbar__menu.toolbar__menu--dropdown .iconbtn{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-height: 42px;
  padding: 10px 12px;
}
.toolbar__menu.toolbar__menu--dropdown .iconbtn::after{
  content: attr(aria-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toolbar__menu.toolbar__menu--dropdown #toolbarLive .icon{
  display: inline-block;
}
.toolbar__menu.toolbar__menu--dropdown #toolbarLive::after{
  content: attr(data-menu-label);
  background: none;
  box-shadow: none;
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline;
}
.toolbar__menu.toolbar__menu--dropdown #toolbarLive{
  background: rgba(0,0,0,.18);
  border-color: var(--border);
}
.divider{ width:1px; height: 24px; background: var(--border); margin: 0 4px; }

.iconbtn{
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 10px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.iconbtn--text{
  padding: 10px 12px;
  min-width: 56px;
}
.iconbtn__text{
  font-size: 12px;
  letter-spacing: .14em;
  font-weight: 750;
  opacity: .9;
}
.iconbtn:hover{ background: rgba(255,255,255,.06); transform: translateY(-1px); }
.iconbtn:active{ transform: translateY(0px); }

.pill{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  width:100%;
  border-radius: 999px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  cursor:pointer;
}
.pill:hover{ background: rgba(255,255,255,.06); }

/* Grid */
.grid{
  padding: 12px var(--pagePad) 26px var(--pagePad);
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 22px;
  align-items: start;
}
.album-info + .grid,
.album-info + .grid--subalbums{
  padding-top: 0;
}
.grid--subalbums{
  /* Podalbumy mają być „sekcją” nad zdjęciami – trochę ciaśniej niż główna siatka */
  padding-bottom: 10px;
}
.grid--subalbums[hidden]{
  display: none !important;
}
.grid--masonry{
  /* Tryb mieszany: układ "justified" – wiersze dopasowują wysokość,
     żeby zmieścić dodatkowe zdjęcie i domknąć lukę po prawej. */
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: stretch;
}
.grid--masonry .card{
  display: block;
  /* Rozmiary (width/height) ustawiane inline w JS per wiersz. */
  flex: 0 0 auto;
  width: auto;
  height: auto;
  transition: width .18s ease, height .18s ease;
  will-change: width, height;
}

/* 1 kolumna: pełna szerokość + proporcja zdjęcia (bez rozciągania) */
.grid--masonry.is-onecol{
  flex-direction: column;
  align-items: stretch;
}
.grid--masonry.is-onecol .card{
  width: 100% !important;
}

@media (prefers-reduced-motion: reduce){
  .grid--masonry .card{
    transition: none !important;
  }
}
.grid--horizontal .card__img,
.grid--masonry .card__img,
.grid--masonry .card__video,
.grid--square .card__img,
.grid--vertical .card__img{
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.grid--horizontal .card{
  aspect-ratio: 6 / 4;
}
.grid--square .card{
  aspect-ratio: 1 / 1;
}
.grid--vertical .card{
  aspect-ratio: 4 / 6;
}
/* Media queries są nadpisywane przez inline style z JS (gridColumns) */
@media (max-width: 1500px){
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 1200px){
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px){
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px){
  :root{ --pagePad: 14px; }
  /* Sidebar jako pełnoekranowy panel na telefonie */
  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 40;
    height: 100%;
    transform: translateX(-100%);
    transition: transform .24s ease;
  }
  .sidebar:not(.is-collapsed){ transform: translateX(0); }
  .sidebar.is-collapsed{ transform: translateX(-100%); width: 100vw; }
  .main{ padding-left: 0; }
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(2, minmax(0,1fr)); padding: 0 var(--pagePad) 22px var(--pagePad); }
  /* W trybie mieszanym mamy flex-gap; nie używamy column-count */
  .toolbar{ padding: 12px var(--pagePad); }
  .siteHeader{ padding: 14px var(--pagePad) 8px var(--pagePad); }
}
/* Na telefonie w trybie pionowym: jedna kolumna i menu rozwijane */
@media (max-width: 680px) and (orientation: portrait){
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: 1fr; }

  /* Menu rozwijane - pokaż przycisk menu, ukryj przyciski */
  .toolbar__right.toolbar__right--menu .toolbar__menu-toggle{ display: flex !important; }
  .toolbar__menu{ 
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    z-index: 100;
    width: max-content;
    min-width: 0;
    max-width: calc(100vw - 24px);
  }
  .toolbar__menu.is-open{ display: flex; }
  .toolbar__menu .divider{ 
    width: 100%; 
    height: 1px; 
    margin: 4px 0; 
  }
  .toolbar__menu .iconbtn{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: auto;
    min-height: 42px;
    padding: 10px 12px;
  }
  .toolbar__menu .iconbtn::after{
    content: attr(aria-label);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toolbar__menu #toolbarLive .icon{
    display: inline-block;
  }
  .toolbar__menu #toolbarLive::after{
    content: attr(data-menu-label);
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
    border-radius: 0;
    display: inline;
  }
  .toolbar__menu #toolbarLive{
    background: rgba(0,0,0,.18);
    border-color: var(--border);
  }
}

.card{
  border-radius: 10px;
  overflow:hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
  transform: translateZ(0);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  position: relative;
}
.card--selected{
  outline: 2px solid rgba(191,255,0,.9);
  outline-offset: -2px;
  box-shadow: 0 0 0 2px rgba(191,255,0,.28);
}
.grid.is-selecting,
.grid.is-selecting *{
  user-select: none;
}
.card--album{
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.card:hover{
  transform: translateY(-2px);
}
/* Miniatury zdjęć: nie podnoś kafelka na hover (potrafi psuć układ w siatce / w justified) */
.grid .card:hover{
  transform: translateZ(0);
}
.card--album:hover{
  transform: none;
  background: transparent;
}
.card__img{
  width:100%;
  height: auto;
  object-fit: unset;
  display:block;
  filter: saturate(1.04) contrast(1.02);
  transition: transform .22s ease, opacity .35s ease;
  background: transparent;
  opacity: 1;
}
.card__img.is-thumb-fade{
  opacity: 0;
}
.card__img.is-thumb-fade.is-thumb-loaded{
  opacity: 1;
}
.card:hover .card__img{ transform: scale(1.08); }

/* Admin: ukryte zdjęcia (hiddenImages) mają być widoczne jako przyciemnione + ikona na środku */
.card--hidden-admin .card__img{
  filter: saturate(.55) contrast(1.05) brightness(.55);
}
.card--hidden-admin::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.22);
  pointer-events:none;
}
.card__hiddenBadge{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  z-index: 2;
}
.card__hiddenBadgeInner{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(18,22,33,.88);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  color: rgba(232,238,252,.92);
}
.card__label{
  z-index: 3;
}
.card__label{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding-bottom: 8px;
  color: rgba(232,238,252,.95);
  font-size: 12px;
  letter-spacing: .10em;
  font-weight: 700;
  opacity: 0;
  transition: opacity .14s ease;
  pointer-events:none;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.card:hover .card__label{
  opacity: 1;
}

/* Przycisk edytora na miniaturkach */
.card__edit{
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  background: rgba(18,22,33,.85);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  opacity: .9;
}
.card__edit:hover{
  opacity: 1;
}

/* Ocenianie na miniaturkach: zatwierdź, odrzuć, ulubione */
.card__star-wrap{
  position: absolute;
  inset: 8px;
  z-index: 3;
  pointer-events: none;
  display: block;
}
.card__rating-thumbs{
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.card:hover .card__rating-thumbs{
  opacity: 1;
  pointer-events: auto;
}
.card__rating-colors{
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.card:hover .card__rating-colors{
  opacity: 1;
  pointer-events: auto;
}
.card__star-wrap .card__star,
.card__star-wrap .card__rating-btn{
  pointer-events: auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.4);
  color: rgba(232,238,252,.6);
  opacity: .7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__star-wrap .card__star:hover,
.card__star-wrap .card__rating-btn:hover{
  background: rgba(0,0,0,.55);
  color: var(--accent);
  opacity: 1;
}
.card__star-wrap .card__rating-btn.is-active,
.card__star-wrap .icon--star-filled{
  color: var(--accent);
  opacity: 1;
}
.card__rating-btn.card__rating-approve.is-active{ color: var(--accent); }
.card__rating-btn.card__rating-reject.is-active{ color: #e74c3c; }
.card__star-wrap .card__rating-btn .icon{
  width: 18px;
  height: 18px;
}
.card__star-wrap .card__star{
  position: absolute;
  right: 0;
  top: 0;
}
.card__rating-color{
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.4);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card__color-dot{
  position: absolute;
  left: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.8);
  z-index: 3;
  pointer-events: none;
}
.card__rating-color.is-active{
  box-shadow: 0 0 0 2px rgba(0,0,0,.6);
}
.color--red{ background: #e74c3c !important; }
.color--green{ background: #2ecc71 !important; }
.color--blue{ background: #3498db !important; }
.color--yellow{ background: #f1c40f !important; }
.color--purple{ background: #9b59b6 !important; }

.card--color-red{ --rating-color: rgba(231,76,60,.85); }
.card--color-green{ --rating-color: rgba(46,204,113,.85); }
.card--color-blue{ --rating-color: rgba(52,152,219,.85); }
.card--color-yellow{ --rating-color: rgba(241,196,15,.9); }
.card--color-purple{ --rating-color: rgba(155,89,182,.85); }
.card--approved{ --rating-color: rgba(191,255,0,.9); }
.card--rejected{ --rating-color: rgba(231,76,60,.9); }
.card.card--approved::after,
.card.card--rejected::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--rating-color, transparent);
  pointer-events: none;
}

/* Tytuł pod miniaturą dla albumów (folderów) */
.card--album .card__img-wrapper{
  width: 100%;
  aspect-ratio: 6 / 4;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transform-origin: center center;
  transition: transform .22s ease;
}
.card--album .card__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.card--album:hover .card__img-wrapper{
  transform: scale(1.05);
}
.card--album .card__title-wrapper{
  position: relative;
  margin-top: 0;
  padding: 10px 8px 8px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.card--album .card__title{
  color: rgba(232,238,252,.88);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card--album .card__date{
  color: rgba(170,180,204,.75);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", "Helvetica Condensed", "Arial", "Courier New", monospace;
  letter-spacing: 0.02em;
}
.card--album .card__label{
  display: none;
}

/* Lightbox */
body.is-lightbox-open .app{
  opacity: 0;
}
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .26s ease, visibility 0s linear .26s;
}
.lightbox.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .26s ease;
}
.lightbox__bg{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity .28s ease;
}
.lightbox.is-open .lightbox__bg{ opacity: 1; }
.lightbox__ui{
  position:absolute;
  inset: 0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(0,0,0,0);
}
.lightbox__top{
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 12px;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  background: transparent;
  border-bottom: none;
  height: var(--lbTopH);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease;
}
.lightbox.is-open .lightbox__top{
  opacity: 1;
  transform: translateY(0);
}
.lightbox__title{
  display: none;
}
.lightbox__actions{ 
  display:flex; 
  gap: 8px; 
  align-items:center;
  flex-shrink: 0;
}
.lightbox__timebox{
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.lightbox__timeval{
  min-width: 36px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.lightbox__timebox .iconbtn{ min-height: 36px; padding: 0 12px; }
.lightbox__divider{
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.14);
  margin-left: 8px;
  pointer-events: none;
}

/* Licznik zdjęcia (zawsze widoczny w lightbox) */
.lightbox__counter{
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 101;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .10em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox.is-open:not(.is-uiHidden) .lightbox__counter{ opacity: 1; }
.lightbox.is-slideshow:not(.is-uiHidden) .lightbox__counter{ opacity: 1; }

/* Nazwa pliku na dole po środku */
.lightbox__filename{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  max-width: min(92vw, 980px);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox.is-open:not(.is-uiHidden) .lightbox__filename{ opacity: 1; }
.lightbox.is-slideshow:not(.is-uiHidden) .lightbox__filename{ opacity: 1; }
@media (max-width: 680px){
  .lightbox__counter{ top: 10px; left: 10px; }
  .lightbox__filename{ bottom: 14px; }
}
/* Na telefonach - bardziej agresywne przycinanie tytułu */
@media (max-width: 680px){
  .lightbox__top{
    gap: 8px;
  }
  .lightbox__actions{
    gap: 6px;
  }
  .lightbox__actions .iconbtn{
    padding: 8px;
    min-width: 36px;
  }
  .lightbox__actions .iconbtn--text{
    padding: 8px 10px;
    min-width: 44px;
  }
}
/* Ukryj przycisk fit/fill w toolbarze przy miniaturach */
#toggleFill{ display:none; }

.lightbox__stage{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  padding: 0;
  overflow: hidden;
  /* Pozwól na własny pinch/pan (bez domyślnego scroll/zoom przeglądarki) */
  touch-action: none;
}
.lightbox__canvas{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  /* Stałe tło pod obrazem – eliminuje „ramkę” gdy img jest chwilowo ukryty/pusty */
  background: rgba(0,0,0,0);
  touch-action: none;
}

/* (usunięto eksperymentalny loader is-loading – powodował flash/białą klatkę) */

/* Podpowiedź obrotu ekranu (tylko w trybie FILL i bez slideshow) */
.rotateHint{
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.rotateHint.is-visible{
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity .18s ease, transform .18s ease;
}
.lightbox:not(.is-cover) .rotateHint{ display: none; }
.lightbox.is-slideshow .rotateHint{ display: none; }
/* Podczas ładowania pierwszego zdjęcia nie pokazuj podpowiedzi obrotu (to wygląda jak biały obrys) */
.lightbox.is-loading .rotateHint{ display: none !important; }

.rotateHint__content{
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0,0,0,.46);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(76vw, 320px);
}
.rotateHint__label{
  color: rgba(232,238,252,.96);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .01em;
}

.rotateHint__anim{
  width: 74px;
  height: 74px;
  position: relative;
  display: grid;
  place-items: center;
}
.rotateHint__animInner{
  width: 74px;
  height: 74px;
  position: relative;
}
/* Prosty „telefon” */
.rotateHint__animInner::before{
  content:"";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 48px;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 9px;
  box-sizing: border-box;
  background: rgba(255,255,255,.06);
  transform: translate(-50%,-50%) rotate(0deg);
}
/* Bez dodatkowych kółek/strzałek – tylko sam telefon */

/* Jednorazowy obrót (informacja, bez wymuszania) */
@keyframes rotateHintPortraitToLandscapeLeft{
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(-90deg); }
}
@keyframes rotateHintLandscapeToPortraitRight{
  from { transform: translate(-50%,-50%) rotate(-90deg); }
  to   { transform: translate(-50%,-50%) rotate(0deg); }
}
.rotateHint.is-toLandscape .rotateHint__animInner::before{
  transform: translate(-50%,-50%) rotate(0deg);
  animation: rotateHintPortraitToLandscapeLeft 1.55s cubic-bezier(.2,.95,.25,1) 3 both;
}
.rotateHint.is-toPortrait .rotateHint__animInner::before{
  transform: translate(-50%,-50%) rotate(-90deg);
  animation: rotateHintLandscapeToPortraitRight 1.55s cubic-bezier(.2,.95,.25,1) 3 both;
}
/* (usunięto: łuk + grocik + odbicia) */

/* Side navigation */
.lbSide{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,.40);
  color: rgba(232,238,252,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, background .16s ease;
}
.lbSide:hover{ background: rgba(0,0,0,.55); }
.lbSide--left{ left: 14px; }
.lbSide--right{ right: 14px; }

.lightbox.is-open:not(.is-uiHidden) .lbSide{
  opacity: 1;
  pointer-events: auto;
}
/* Podczas slideshow przyciski ukryte domyślnie, ale mogą być pokazane */
.lightbox.is-slideshow:not(.is-uiHidden) .lbSide{
  opacity: 1;
  pointer-events: auto;
}
.lightbox.is-slideshow.is-uiHidden .lbSide{
  opacity: 0;
  pointer-events: none;
}

/* W trybie powiększenia (zoom/pan) przyciski prawo/lewo mają działać cały czas,
   nawet gdy UI jest auto-ukryte. */
.lightbox.is-open.is-zoomed .lbSide{
  opacity: 1;
  pointer-events: auto;
}

/* Click zones (half screen) */
.lbZone{
  position:absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
}
.lbZone--left{ left: 0; }
.lbZone--right{ right: 0; }

/* Na telefonach: nie rób strefy "pół ekranu" — tylko pasy przy krawędziach */
@media (max-width: 900px){
  .lbZone{
    width: clamp(90px, 22vw, 300px);
  }
}

/* Gdy użytkownik jest w przybliżeniu, priorytetem jest pan (drag), nie nawigacja strefami */
.lightbox.is-zoomed .lbZone{
  pointer-events: none;
}

/* Hide UI when idle */
.lightbox.is-uiHidden .lightbox__top{
  opacity: 0;
  pointer-events:none;
}
/* Podczas slideshow górna belka ukryta domyślnie, ale może być pokazana */
.lightbox.is-slideshow:not(.is-uiHidden) .lightbox__top{
  opacity: 1;
  pointer-events: auto;
}
.lightbox.is-slideshow.is-uiHidden .lightbox__top{
  opacity: 0;
  pointer-events: none;
}
.lightbox.is-slideshow .lbClose{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
}
.lightbox__img{
  position:absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  transition: opacity .34s ease, transform .42s cubic-bezier(.2,.95,.2,1);
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  /* Bez tła na samym IMG (na niektórych przeglądarkach wyglądało jak jasna ramka) */
  background: transparent;
  outline: none;
  border: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  opacity: 0;
}
.lightbox__img.is-active{ opacity: 1; }
.lightbox.is-cover .lightbox__img{
  object-fit: cover;
}

/* Wideo w lightbox (pokazywane zamiast obrazów) */
.lightbox__video{
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: transparent;
  border: 0;
  outline: none;
  display: none;
}
.lightbox.is-cover .lightbox__video{ object-fit: cover; }
.lightbox.is-video .lightbox__video{ display: block; }
.lightbox.is-video .lightbox__img{ display: none !important; }

/* Kontrolki wideo w lightbox */
.lightbox.is-video .progress{ display: none; }
.videoControls{
  display: none;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  z-index: 80;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  opacity: 1;
  visibility: visible;
}
.lightbox.is-video .videoControls{ display: block; }
.lightbox.is-video.is-uiHidden .videoControls{
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.videoControls__row{
  display: flex;
  align-items: center;
  gap: 8px;
}
.videoControls__time{
  margin-left: auto;
  font-size: 12px;
  color: rgba(232,238,252,.9);
  font-variant-numeric: tabular-nums;
}
.videoControls__seek{
  width: 100%;
  margin-top: 8px;
}
.videoControls__filename{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(232,238,252,.92);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* Ikony dodatkowe */
.icon--pause{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><rect x='6' y='5' width='4' height='14'/><rect x='14' y='5' width='4' height='14'/></svg>"); }
.icon--stop{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><rect x='7' y='7' width='10' height='10' rx='1'/></svg>"); }
.icon--volume{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M11 5 6.5 9H3v6h3.5L11 19V5z'/><path d='M14.5 8.5a5 5 0 0 1 0 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>"); }
.icon--mute{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M11 5 6.5 9H3v6h3.5L11 19V5z'/><path d='M16 9l5 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M21 9l-5 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>"); }

/* FIT <-> FILL: krótka animacja (maskuje skok object-fit) */
.lightbox.is-fitfillTransition .lightbox__img.is-active{
  transition: opacity .18s ease, transform .28s cubic-bezier(.2,.95,.2,1);
}

/* Slideshow: delikatny zoom w trakcie (Ken Burns) */
.lightbox{ --slideMs: 3200ms; }
.lightbox.is-slideshow .lightbox__img.is-active{
  animation: lbKenBurns var(--slideMs) ease-out both;
}
/* Pierwsze zdjęcie w pokazie slajdów: wyłącz animację Ken Burns (uruchomiona przez JS po opóźnieniu) */
.lightbox.is-slideshow .lightbox__img.is-active.is-first-slide{
  animation: none !important; /* Wyłącz animację Ken Burns dla pierwszego zdjęcia */
  transform: scale(1.0) !important; /* Ustaw początkowy scale */
}
@keyframes lbKenBurns{
  from{ transform: scale(1.0); }
  to{ transform: scale(1.12); }
}
/* Płynne przejście cross-fade w slideshow (zachowaj transform podczas fade-out) */
.lightbox.is-slideshow .lightbox__img{
  transition: opacity .48s ease-in-out, transform .48s ease-in-out;
}
/* Gdy obraz traci is-active, zachowaj aktualny transform podczas fade-out */
.lightbox.is-slideshow .lightbox__img:not(.is-active){
  animation: none;
}
.lightbox__bottom{
  padding: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  transition: opacity .2s ease, visibility .2s ease;
}
.lightbox.is-slideshow .lightbox__bottom{
  opacity: 0;
  visibility: hidden;
}
/* Przycisk zamknięcia na dole - widoczny podczas automatycznego pokazu slajdów */
.lightbox__close-bottom{
  display: none;
}
/* Przycisk widoczny podczas pokazu slajdów na wszystkich ekranach */
.lightbox.is-slideshow .lightbox__close-bottom{
  display: flex !important;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.8;
  transition: opacity 0.2s ease;
  pointer-events: auto !important;
  visibility: visible !important;
}
.lightbox.is-slideshow .lightbox__close-bottom:hover,
.lightbox.is-slideshow .lightbox__close-bottom:active{
  opacity: 1;
  background: rgba(0, 0, 0, 0.7) !important;
}
.progress{
  height: 3px;
  background: rgba(255,255,255,.12);
}
.progress__bar{
  height: 100%;
  width: 0%;
  background: rgba(191,255,0,.95);
  transition: width .08s linear;
}

/* Modern icons (SVG mask) */
.icon{
  display:inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: var(--icon) no-repeat center / contain;
  mask: var(--icon) no-repeat center / contain;
}
.icon--burger{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='4' y1='6' x2='20' y2='6'/><line x1='4' y1='12' x2='20' y2='12'/><line x1='4' y1='18' x2='20' y2='18'/></svg>"); }
.icon--search{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='6'/><line x1='16.5' y1='16.5' x2='21' y2='21'/></svg>"); }
.icon--sort{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 4v16'/><polyline points='5 7 8 4 11 7'/><polyline points='5 17 8 20 11 17'/><path d='M13 7h7'/><path d='M13 12h5'/><path d='M13 17h3'/></svg>"); }
.icon--shuffle{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='16 3 21 8 16 13'/><line x1='4' y1='8' x2='21' y2='8'/><polyline points='8 11 3 16 8 21'/><line x1='3' y1='16' x2='20' y2='16'/></svg>"); }
.icon--sort-asc{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 4v16'/><polyline points='5 7 8 4 11 7'/><path d='M13 17h7'/><path d='M13 12h5'/><path d='M13 7h3'/></svg>"); }
.icon--sort-desc{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 4v16'/><polyline points='5 17 8 20 11 17'/><path d='M13 7h7'/><path d='M13 12h5'/><path d='M13 17h3'/></svg>"); }
.icon--grid{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>"); }
/* Ikony trybu siatki (dla przycisku viewGrid) */
.icon--grid-mixed{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='3' y='3' width='8' height='9' rx='1'/><rect x='13' y='3' width='8' height='6' rx='1'/><rect x='13' y='11' width='8' height='10' rx='1'/><rect x='3' y='14' width='8' height='7' rx='1'/></svg>"); }
.icon--grid-horizontal{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='3' y='4' width='18' height='4' rx='1'/><rect x='3' y='10' width='18' height='4' rx='1'/><rect x='3' y='16' width='18' height='4' rx='1'/></svg>"); }
.icon--grid-square{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='4' y='4' width='7' height='7' rx='1'/><rect x='13' y='4' width='7' height='7' rx='1'/><rect x='4' y='13' width='7' height='7' rx='1'/><rect x='13' y='13' width='7' height='7' rx='1'/></svg>"); }
.icon--grid-vertical{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='4' y='3' width='4' height='18' rx='1'/><rect x='10' y='3' width='4' height='18' rx='1'/><rect x='16' y='3' width='4' height='18' rx='1'/></svg>"); }
.icon--zoom{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='6'/><line x1='11' y1='8' x2='11' y2='14'/><line x1='8' y1='11' x2='14' y2='11'/><line x1='16.5' y1='16.5' x2='21' y2='21'/></svg>"); }
.icon--play{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><polygon points='8 5 20 12 8 19'/></svg>"); }
.icon--left{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 6 9 12 15 18'/></svg>"); }
.icon--right{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 15 12 9 18'/></svg>"); }
.icon--close{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='6' y1='6' x2='18' y2='18'/><line x1='18' y1='6' x2='6' y2='18'/></svg>"); }
.icon--fullscreen{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9V4h5'/><path d='M20 9V4h-5'/><path d='M4 15v5h5'/><path d='M20 15v5h-5'/></svg>"); }
.icon--fit{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='8' y='8' width='8' height='8' rx='1'/></svg>"); }
.icon--fill{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='6' y='6' width='12' height='12' rx='1' fill='black' opacity='0.35'/></svg>"); }
.icon--monitor{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='12' rx='2'/><path d='M8 20h8'/><path d='M12 16v4'/></svg>"); }
.icon--fit{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='8' y='8' width='8' height='8' rx='1'/></svg>"); }
/* FIT/FILL ikony: FIT = ramka z obrazem w środku (contain), FILL = ramka wypełniona (cover) */
.icon--fitfill-fit{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2'/><rect x='7' y='7' width='10' height='10' rx='1'/></svg>"); }
.icon--fitfill-fill{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2'/><rect x='3' y='3' width='18' height='18' rx='1' fill='black' opacity='0.3'/></svg>"); }
.icon--home{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-7 9 7'/><path d='M5 10v10h14V10'/></svg>"); }
.icon--photo{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 5H16l-2-2H10L8 5H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z'/><circle cx='12' cy='13' r='3'/></svg>"); }
.icon--sliders{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='4' y1='6' x2='20' y2='6'/><circle cx='9' cy='6' r='2.2'/><line x1='4' y1='12' x2='20' y2='12'/><circle cx='15' cy='12' r='2.2'/><line x1='4' y1='18' x2='20' y2='18'/><circle cx='11' cy='18' r='2.2'/></svg>"); }
.icon--folder{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h7l2 3h9v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z'/></svg>"); }
.icon--download{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v12'/><polyline points='7 11 12 16 17 11'/><path d='M4 20h16'/></svg>"); }
/* Download z watermarkiem: dodatkowa, węższa kreska pod strzałką (jak "napis") */
.icon--download-wm{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v12'/><polyline points='7 11 12 16 17 11'/><path d='M8 18h8'/><path d='M4 20h16'/></svg>"); }
.icon--link{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10 13a5 5 0 0 1 0-7l2-2a5 5 0 0 1 7 7l-1.5 1.5'/><path d='M14 11a5 5 0 0 1 0 7l-2 2a5 5 0 0 1-7-7L6.5 11.5'/></svg>"); }
.icon--align-left{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='4' y1='6' x2='16' y2='6'/><line x1='4' y1='12' x2='20' y2='12'/><line x1='4' y1='18' x2='14' y2='18'/></svg>"); }
.icon--align-center{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='5' y1='6' x2='19' y2='6'/><line x1='3' y1='12' x2='21' y2='12'/><line x1='6' y1='18' x2='18' y2='18'/></svg>"); }
.icon--align-right{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='8' y1='6' x2='20' y2='6'/><line x1='4' y1='12' x2='20' y2='12'/><line x1='10' y1='18' x2='20' y2='18'/></svg>"); }
.icon--align-justify{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='4' y1='6' x2='20' y2='6'/><line x1='4' y1='12' x2='20' y2='12'/><line x1='4' y1='18' x2='20' y2='18'/></svg>"); }
.icon--bold{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 5h6a3 3 0 0 1 0 6H7z'/><path d='M7 11h7a3 3 0 0 1 0 6H7z'/></svg>"); }
.icon--italic{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><line x1='10' y1='5' x2='18' y2='5'/><line x1='6' y1='19' x2='14' y2='19'/><line x1='14' y1='5' x2='10' y2='19'/></svg>"); }
.icon--trash{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M8 6V4h8v2'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><line x1='10' y1='11' x2='10' y2='17'/><line x1='14' y1='11' x2='14' y2='17'/></svg>"); }
.icon--user{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>"); }
.icon--flag{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 3v18'/><path d='M5 4h12l-2 4 2 4H5'/></svg>"); }
.icon--flag-filled{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M5 3v18h2v-7h12l-2-4 2-4H7V3H5z'/></svg>"); }
.icon--live{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M5 12a7 7 0 0 1 7-7'/><path d='M12 5a7 7 0 0 1 7 7'/><path d='M19 12a7 7 0 0 1-7 7'/><path d='M12 19a7 7 0 0 1-7-7'/></svg>"); }
.icon--bell{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 7h18s-3 0-3-7'/><path d='M13.73 21a2 2 0 0 1-3.46 0'/></svg>"); }
.icon--bell-off{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 7h18s-3 0-3-7'/><path d='M13.73 21a2 2 0 0 1-3.46 0'/><line x1='3' y1='3' x2='21' y2='21'/></svg>"); }
.icon--settings{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M12 1v6m0 6v6M5.64 5.64l4.24 4.24m4.24 4.24l4.24 4.24M1 12h6m6 0h6M5.64 18.36l4.24-4.24m4.24-4.24l4.24-4.24'/></svg>"); }
.iconbtn.is-edited{ color: rgba(191,255,0,.95); }
.icon--device{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='2' width='14' height='20' rx='2'/><line x1='12' y1='18' x2='12' y2='18'/></svg>"); }
.icon--star{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"); }
.icon--star-filled{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"); }
.icon--thumbs-up{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='4 12 9 17 20 6'/></svg>"); }
.icon--thumbs-down{ --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><line x1='6' y1='6' x2='18' y2='18'/><line x1='18' y1='6' x2='6' y2='18'/></svg>"); }

/* Pasek filtrów ocen (pod toolbarem) */
.rating-filter-bar{
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  padding: 10px var(--pagePad);
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  overflow-x: auto;
}
.rating-filter-bar[hidden]{ display: none !important; }
.rating-filter-bar.rating-filter-bar--server-only .rating-filter-accordion--left,
.rating-filter-bar.rating-filter-bar--server-only .rating-filter-accordion--right{
  display: none;
}
.live-strip{
  --live-thumb-w: 129px;
  --live-thumb-h: 129px;
  --live-thumb-img-h: 98px;
  --live-thumb-scale: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 10px var(--pagePad);
  background: linear-gradient(90deg, rgba(255,59,59,0.12), rgba(255,255,255,0.02));
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.live-strip[hidden]{ display: none !important; }
.live-strip__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-strip__left{
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.live-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ff3b3b;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.6px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255,59,59,0.15);
  animation: liveRecBlink 2.2s ease-in-out infinite;
}
.live-strip--idle .live-badge{
  background: #9aa0a6;
  box-shadow: 0 0 0 2px rgba(154,160,166,0.2);
  animation: none;
}
.live-strip__title{ letter-spacing: 0.2px; }
.live-strip__count{
  opacity: 0.7;
  font-size: 12px;
}
.live-strip__scroller{
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 6px 9px 3px;
  scroll-snap-type: x proximity;
  justify-content: flex-start;
  overflow-y: visible;
}
.live-strip__scroller::-webkit-scrollbar{ height: 6px; }
.live-strip__scroller::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.2); border-radius: 999px; }
.live-strip__item{
  position: relative;
  flex: 0 0 auto;
  width: var(--live-thumb-w);
  height: var(--live-thumb-h);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: #000;
  scroll-snap-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  box-shadow: inset 0 0 0 2px rgba(255,59,59,0);
}
.live-strip__thumb{
  position: relative;
  width: 100%;
  height: var(--live-thumb-img-h);
  flex: 0 0 auto;
  overflow: hidden;
  background: #000;
  margin-top: 5px;
}
.live-strip__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.live-strip__item--pulse{
  animation: livePulse 2.2s ease-out;
}
@keyframes livePulse{
  0%{ box-shadow: inset 0 0 0 2px rgba(255,59,59,0.95); }
  45%{ box-shadow: inset 0 0 0 2px rgba(255,59,59,0.5); }
  100%{ box-shadow: inset 0 0 0 2px rgba(255,59,59,0); }
}
.card--live-pulse{
  animation: livePulse 2.2s ease-out;
}
.toolbar-live-pulse{
  animation: liveToolbarPulse 2.2s ease-in-out infinite;
}
#toolbarLive{
  position: relative;
  background: rgba(0,0,0,.18);
  border-color: var(--border);
}
#toolbarLive .icon{
  display: none;
}
#toolbarLive::after{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.8);
  display: inline-block;
}
#toolbarLive.toolbar-live-idle::after{
  background: #bfc3c9;
  box-shadow: 0 0 6px rgba(191, 195, 201, 0.75);
}
#toolbarLive.toolbar-live-pulse::after{
  animation: liveToolbarPulse 2.2s ease-in-out infinite;
}
@keyframes liveToolbarPulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: .35; }
}
.live-strip__time{
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(20px * var(--live-thumb-scale));
  padding: 0 4px;
  font-size: calc(10px * var(--live-thumb-scale));
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  margin: 4px 0;
}
.live-strip__item::after{
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.live-strip__actions{
  display: flex;
  gap: 6px;
  align-items: center;
}
.live-strip__actions--below{
  justify-content: flex-end;
  margin-top: 2px;
}
.live-strip__actions .iconbtn{
  padding: 0 10px;
  font-size: 12px;
  height: 32px;
  line-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.live-strip__actions .iconbtn .icon{
  width: 16px;
  height: 16px;
}
.live-strip__actions #liveStripSound .icon,
.live-strip__actions #liveStripMonitor .icon{
  width: 14px;
  height: 14px;
}
.live-strip__actions .iconbtn.is-active{
  color: var(--accent);
  border-color: rgba(191,255,0,.35);
  background: rgba(191,255,0,.1);
}
@keyframes liveRecBlink{
  0%, 100%{ opacity: 1; }
  50%{ opacity: .35; }
}
.rating-filter-group{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.rating-filter-accordion{
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 0;
}
.rating-filter-accordion__summary{
  display: none;
}
.rating-filter-btn--modal{
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.rating-filter-select{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.rating-color-dot{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: 1px solid var(--border);
  display: inline-block;
}
.rating-color-dot[data-color="none"]{
  background: transparent;
}
.rating-color-dot[data-color="red"]{ background: #ff4b4b; }
.rating-color-dot[data-color="green"]{ background: #37d07d; }
.rating-color-dot[data-color="blue"]{ background: #4bb3ff; }
.rating-color-dot[data-color="yellow"]{ background: #ffd34b; }
.rating-color-dot[data-color="purple"]{ background: #a66bff; }
.rating-filter-select select{
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 600;
  outline: none;
}
.rating-filter-bar.is-compact .rating-filter-group--left .rating-filter-btn[data-filter="approved"],
.rating-filter-bar.is-compact .rating-filter-group--left .rating-filter-btn[data-filter="rejected"],
.rating-filter-bar.is-compact .rating-filter-group--left .rating-filter-btn[data-filter="unflagged"]{
  display: none;
}
.rating-filter-bar:not(.is-compact) #ratingStatusModalBtn{
  display: none !important;
}
.rating-filter-bar.is-compact .rating-filter-group--left .rating-filter-btn[data-filter="all"]{
  display: none;
}
.rating-filter-bar.is-compact #ratingStatusModalBtn{
  display: inline-flex !important;
}
.rating-filter-bar.is-compact .rating-action-label{
  display: none;
}
.rating-filter-bar.is-compact .rating-filter-accordion__summary{
  display: none;
}
.rating-filter-bar.is-compact .rating-sep{
  display: none;
}
.rating-filter-accordion--left{ justify-content: flex-start; flex: 1 1 0; }
.rating-filter-accordion--center{ justify-content: center; flex: 0 0 auto; margin: 0 auto; }
.rating-filter-accordion--center .rating-filter-group{ justify-content: center; }
.rating-filter-accordion--right{ justify-content: flex-end; flex: 1 1 0; }
.rating-filter-accordion--right .rating-filter-group{
  max-width: 220px;
}
.rating-filter-accordion--right .rating-filter-group{ justify-content: flex-end; }

@media (max-width: 1100px){
  .rating-filter-bar{
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .rating-sep{ display: none; }
  .rating-filter-accordion{
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
  }
  .rating-filter-accordion__summary{
    display: none;
  }
  .rating-filter-accordion .rating-filter-group{
    padding-bottom: 0;
  }
  .rating-filter-accordion--right .rating-filter-group{ justify-content: flex-end; }
}
.rating-sep{
  width: 1px;
  height: 22px;
  background: var(--border);
  opacity: .7;
  display: inline-block;
}
.download-zip-options{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}
.download-zip-option{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.rating-filter-btn{
  --btn-pad-y: 6px;
  padding: var(--btn-pad-y) 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  position: relative;
}
.rating-filter-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.rating-filter-btn:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
.rating-filter-btn.is-active{
  color: var(--accent);
  background: rgba(191,255,0,.1);
  border-color: rgba(191,255,0,.35);
}
.rating-count{
  font-size: 12px;
  opacity: 0.7;
  margin-left: 8px;
  padding-left: 8px;
  display: inline-flex;
  align-items: center;
  position: relative;
}
.rating-count::before{
  content: "";
  position: absolute;
  left: 0;
  top: calc(-1 * var(--btn-pad-y));
  bottom: calc(-1 * var(--btn-pad-y));
  width: 1px;
  background: var(--border);
}
.rating-filter-btn.rating-filter-color{
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.6);
  background: transparent;
}
.rating-filter-btn.rating-filter-color.is-active{
  box-shadow: 0 0 0 2px rgba(0,0,0,.5);
  border-color: rgba(255,255,255,.9);
}
.rating-filter-btn--icon{
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 32px;
  min-height: 32px;
}
.rating-filter-btn--icon > span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rating-filter-btn--icon > span:empty:not(.icon){
  display: none;
}
.rating-filter-btn--icon .icon{
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
}
.rating-filter-btn--icon .rating-count{ margin-left: 2px; }
.rating-action-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.rating-action-btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}

@media (max-width: 720px){
  .rating-filter-bar{
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .rating-filter-group{
    padding-bottom: 4px;
  }
  .rating-filter-group::-webkit-scrollbar{ height: 6px; }
  .rating-filter-group::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.2); border-radius: 999px; }
  .rating-sep{ display: none; }
}


/* Panel ocen w lightbox (łapki + ulubione) – nad nazwą pliku */
.ratingControls{
  display: none;
  position: fixed;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  z-index: 102;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
@media (max-width: 680px){
  .ratingControls{ bottom: 52px; }
}
.ratingControls[aria-hidden="true"]{ display: none !important; }
.ratingControls[aria-hidden="false"]{
  display: flex !important;
}
.lightbox.is-rating .ratingControls[aria-hidden="false"]{ display: flex !important; }
.lightbox.is-rating.is-uiHidden .ratingControls[aria-hidden="false"]{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}
.ratingControls .iconbtn{
  color: rgba(232,238,252,.9);
  min-width: 40px;
  min-height: 40px;
  touch-action: manipulation;
}
.ratingControls .iconbtn:hover{ color: var(--accent); }
.ratingControls .iconbtn.is-active{ color: var(--accent); }
.ratingControls #lbRatingReject.is-active,
.ratingControls #lbRatingReject.is-active .icon{ color: #e74c3c; }
.ratingControls .iconbtn .icon--star-filled{ color: var(--accent); }
.ratingControls__group{ display: inline-flex; gap: 8px; align-items: center; }
.ratingControls__divider{
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.18);
  margin: 0 6px;
}
.ratingControls__colors{
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.ratingControls__color{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.75);
  background: rgba(0,0,0,.35);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  opacity: .5;
  transition: opacity .12s ease;
}
.ratingControls__color:hover{ opacity: .9; }
.ratingControls__color.is-active{
  box-shadow: 0 0 0 2px rgba(0,0,0,.6);
  opacity: 1;
}

/* Large thumbs mode */
body.is-largeThumbs .grid{ gap: 16px; }

/* Float button (przycisk rozwijania menu bocznego) */
.floatbtn{
  position: fixed;
  left: 16px;
  bottom: 11px;
  z-index: 30;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 33, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.24);
  transition: background .16s ease, box-shadow .16s ease, left .22s ease;
}
.floatbtn:hover{
  background: rgba(25, 30, 45, 1);
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
}
@media (max-width: 680px){
  .floatbtn{
    left: 16px;
    bottom: 20px;
  }
}
/* Na desktop: uchwyty do zwijania/rozwijania */
@media (min-width: 681px){
  .floatbtn{ 
    display: none; 
  }
  /* Uchwyt do zwijania - gdy sidebar jest otwarty, wystaje poza sidebar po prawej stronie */
  .app:not(.sidebar-collapsed) .floatbtn,
  .app:not(:has(.sidebar.is-collapsed)) .floatbtn {
    display: flex;
    left: var(--sidebarW);
    top: 10px;
    bottom: auto;
    width: 35px;
    height: 48px;
    border-radius: 0 10px 10px 0;
    border-left: none;
    border-right: 1px solid var(--border);
    border-top: none;
    border-bottom: 1px solid var(--border);
  }
  /* Uchwyt do rozwijania - gdy sidebar jest zwinięty, przy lewej krawędzi ekranu (wyższy priorytet) */
  .app.sidebar-collapsed .floatbtn,
  .app:has(.sidebar.is-collapsed) .floatbtn {
    display: flex !important;
    left: 0 !important;
    top: 10px;
    bottom: auto;
    width: 35px;
    height: 48px;
    border-radius: 0 10px 10px 0;
    border-left: none;
    border-right: 1px solid var(--border);
    border-top: none;
    border-bottom: 1px solid var(--border);
  }
}

/* Overlay: uchwyt tak samo jak w trybie show - przy lewej gdy zamknięty, po prawej gdy otwarty */
@media (min-width: 681px){
  .app.sidebar-overlay .floatbtn{
    display: flex !important;
    top: 20px;
    bottom: auto;
    width: 48px;
    height: 48px;
    border-radius: 0 12px 12px 0;
    border-left: none;
    border-right: 1px solid var(--border);
    border-top: none;
    border-bottom: 1px solid var(--border);
  }
  /* Gdy sidebar jest otwarty, przycisk po prawej stronie sidebara */
  .app.sidebar-overlay:not(.sidebar-collapsed) .floatbtn,
  .app.sidebar-overlay:not(:has(.sidebar.is-collapsed)) .floatbtn {
    left: var(--sidebarW) !important;
  }
  /* Gdy sidebar jest zamknięty, przycisk przy lewej krawędzi */
  .app.sidebar-overlay.sidebar-collapsed .floatbtn,
  .app.sidebar-overlay:has(.sidebar.is-collapsed) .floatbtn {
    left: 0 !important;
  }
}

/* Modal ustawień */
.modal{
  position: fixed;
  inset: 0;
  z-index: 12000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .26s ease, visibility 0s linear .26s;
}
.modal.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .26s ease;
}
.modal--slideTime{
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: block;
  pointer-events: none;
}
.modal--slideTime .modal__bg{ display: none; }
.modal--slideTime .modal__content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  width: min(92vw, 320px);
  pointer-events: auto;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1;
}
.modal--slideTime .modal__header{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.modal--slideTime .modal__title{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.modal--slideTime .modal__body{
  padding: 12px;
}
.slideTimeModal__body{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.slideTimeModal__row{
  display: flex;
  align-items: center;
  gap: 10px;
}
.slideTimeModal__btn{
  min-width: 48px;
  min-height: 38px;
  font-size: 16px;
}
.slideTimeModal__value{
  min-width: 56px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}
.slideTimeModal__note{
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.modal__bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal__content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  max-width: 720px;
  width: min(92vw, 100%);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#settingsModal .modal__content{
  max-width: 750px;
  width: min(96vw, 750px);
}
#toolsModal .modal__content{
  max-width: 828px;
  width: min(96vw, 828px);
}
.tools-warm-grid{
  display: grid;
  grid-template-columns: auto 90px auto 90px auto 70px;
  gap: 8px 10px;
  align-items: center;
}
.tools-warm-grid .settings-input{
  width: 100%;
}
.tools-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 720px){
  .tools-warm-grid{
    grid-template-columns: auto 1fr;
  }
}
.modal__header{
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal__title{
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.modal__body{
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.rating-info__lead{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.rating-info__list{
  margin: 0 0 12px 0;
  padding-left: 18px;
  color: var(--text);
}
.rating-info__list li{
  margin: 6px 0;
}
.rating-info__note{
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}
.modal__close{
  flex-shrink: 0;
}

/* Formularz ustawień */
.settings-form{
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-group{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 12px 12px;
  background: rgba(0,0,0,.08);
}
.settings-group + .settings-group{ margin-top: 6px; }
.settings-group summary{
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text);
  padding: 8px 4px;
}
.settings-group[open] summary{
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.settings-group summary::-webkit-details-marker{ display: none; }
.settings-group summary::after{
  content: "▾";
  float: right;
  opacity: .7;
}
.settings-group[open] summary::after{ content: "▴"; }
.settings-group__content{
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 6px 4px 6px;
}
.settings-group__content .sidebar__count{
  display: block;
  line-height: 1.4;
  white-space: normal;
}
.settings-field{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-checklist{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.settings-check{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.12);
  font-size: 13px;
  color: var(--text);
}
.settings-check input{ accent-color: var(--accent); }
.settings-check span{ line-height: 1.2; }
.settings-check__actions{
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.settings-check__btn{
  padding: 6px 8px;
  min-width: 32px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}
@media (max-width: 720px){
  .settings-checklist{ grid-template-columns: 1fr; }
}
.settings-stack{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.settings-label{
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.settings-input,
.settings-textarea,
.settings-select{
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .14s ease, background .14s ease;
}
.settings-select{
  color-scheme: dark;
}
.settings-select option{
  background: var(--panel);
  color: var(--text);
}
.settings-input:focus,
.settings-textarea:focus,
.settings-select:focus{
  border-color: var(--accent);
  background: rgba(0,0,0,.25);
}
.settings-textarea{
  resize: vertical;
  min-height: 100px;
}
.settings-actions{
  display: flex;
  gap: 10px;
  transition: opacity .28s ease;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.settings-actions--grid2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
}
.settings-actions--grid3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}
.settings-actions--grid2 .iconbtn,
.settings-actions--grid3 .iconbtn{
  width: 100%;
  justify-content: center;
}
.iconbtn--primary{
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.iconbtn--primary:hover{
  background: rgba(191,255,0,.9);
}
.iconbtn--success{
  background: #2ecc71;
  color: #0b130f;
  border-color: #2ecc71;
}
.iconbtn--success:hover{
  background: #27ae60;
}

/* Menu kontekstowe */
.context-menu{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 200px;
}
.context-menu__item{
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: background .14s ease;
}
.context-menu__item:hover{
  background: rgba(255,255,255,.06);
}
.context-menu__item--danger{
  color: #ff6b6b;
}
.context-menu__item--danger:hover{
  background: rgba(255,107,107,.1);
}

.grid-selection-rect{
  position: fixed;
  border: 1px dashed rgba(191,255,0,.9);
  background: rgba(191,255,0,.12);
  box-shadow: 0 0 0 1px rgba(191,255,0,.2) inset;
  pointer-events: none;
  z-index: 1100;
}

/* Login gate (gdy galeria tylko dla zalogowanych) */
.grid.grid--loginGate{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 60px 22px;
}
.loginGate{
  width: 100%;
  display: flex;
  justify-content: center;
}
.loginGate__card{
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.loginGate__title{
  margin: 0 0 28px 0;
  font-size: 24px;
  font-weight: 750;
  color: var(--text);
  line-height: 1.2;
}
.loginGate__form{
  text-align: left;
}
.loginGate__form .settings-actions{
  justify-content: flex-start;
}
.loginGate__submit{
  flex: 1;
  display: flex;
  justify-content: center;
}
@media (max-width: 680px){
  .grid.grid--loginGate{
    padding: 44px 14px;
    min-height: 60vh;
  }
  .loginGate__title{
    font-size: 20px;
  }
}

/* Album header HTML (naglowek albumu) */
.album-header-html{
  margin-top: 12px;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.album-header-html a{
  color: inherit;
  text-decoration: underline;
}
.my-header{
  position: relative;
  overflow: hidden;
  --header-bg: none;
  --header-bg-next: none;
  --header-bg-pos: center;
  --header-bg-opacity: 1;
  --header-bg-next-opacity: 0;
  --header-bg-color: transparent;
  max-height: 2000px;
  transition: max-height .35s ease, opacity .35s ease, margin .35s ease, padding .35s ease;
  background-image: none !important;
}
.my-header-bg,
.my-header-bg-next{
  position: absolute;
  inset: 0;
  background-image: none;
  background-position: var(--header-bg-pos);
  background-size: cover;
  background-color: var(--header-bg-color);
  opacity: 1;
  transition: opacity .35s ease;
  z-index: 0;
}
.my-header-bg-next{
  opacity: 0;
}
.my-header.is-hidden{
  display: none !important;
}
.my-header::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--header-bg);
  background-position: var(--header-bg-pos);
  background-size: cover;
  background-color: var(--header-bg-color);
  opacity: var(--header-bg-opacity);
  transition: opacity .35s ease;
  z-index: 0;
}
.my-header::after{
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--header-bg-next);
  background-position: var(--header-bg-pos);
  background-size: cover;
  background-color: var(--header-bg-color);
  opacity: var(--header-bg-next-opacity);
  transition: opacity .35s ease;
  z-index: 0;
}
.my-header::before,
.my-header::after{
  opacity: 0 !important;
}
.my-header.is-collapsed{
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
}
.my-header-cover{
  position: relative;
  z-index: 1;
}
.my-header-extra{
  display: block;
  text-align: center;
  margin-top: 6px;
}
.album-header-overlay{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.my-header-cover > *:not(.album-header-overlay){
  position: relative;
  z-index: 2;
}
.my-header.is-custom-header .my-header-cover > :not(.album-header-overlay):not(.album-header-html){
  display: none !important;
}

