: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: 405px;
  --sidebarWCollapsed: 68px;
  --lbTopH: 56px;
}

*{ 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);
}

/* 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;
}

/* 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;
}

.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::-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:hover{
  background: rgba(255,255,255,.05);
}
.album.is-active{
  background: rgba(191,255,0,.10);
}
.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;
}
.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;
}

/* Main */
.main{
  flex: 1;
  overflow:auto;
  position: relative;
}
.main::-webkit-scrollbar{ width: 12px; }
.main::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.10); border-radius: 999px; }

.siteHeader{
  padding: 22px 22px 10px 22px;
}
.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 22px;
  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__value{ 
  font-weight: 650; 
  min-width:0; 
  overflow:hidden; 
  text-overflow:ellipsis; 
  white-space:nowrap;
  flex: 1;
  max-width: 100%;
}
/* 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; }
.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: 0 22px 26px 22px;
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 22px;
  align-items: start;
}
.grid--masonry{
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 22px;
  grid-auto-flow: row;
  align-items: start;
}
.grid--masonry .card{
  display: block;
  width: 100%;
  /* Tryb mieszany: proporcja kafelka zależna od orientacji zdjęcia (ustawiana w JS przez --thumb-ar) */
  aspect-ratio: var(--thumb-ar, 6 / 4);
}
.grid--horizontal .card__img,
.grid--masonry .card__img,
.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)); }
  .grid--masonry:not([style*="grid-template-columns"]){ column-count: 4; }
}
@media (max-width: 1200px){
  :root{ --sidebarW: 380px; }
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid--masonry:not([style*="grid-template-columns"]){ column-count: 3; }
}
@media (max-width: 900px){
  .grid:not([style*="grid-template-columns"]){ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--masonry:not([style*="grid-template-columns"]){ column-count: 2; }
}
@media (max-width: 680px){
  /* 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 14px 22px 14px; }
  .grid--masonry:not([style*="grid-template-columns"]){ column-count: 2; column-gap: 14px; }
  .toolbar{ padding: 12px 14px; }
  .siteHeader{ padding: 14px 14px 8px 14px; }
}
/* 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; }
  .grid--masonry:not([style*="grid-template-columns"]){ column-count: 1; }
  
  /* Menu rozwijane - pokaż przycisk menu, ukryj przyciski */
  .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;
    min-width: 180px;
  }
  .toolbar__menu.is-open{ display: flex; }
  .toolbar__menu .divider{ 
    width: 100%; 
    height: 1px; 
    margin: 4px 0; 
  }
}

.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--album{
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.card:hover{
  transform: translateY(-2px);
}
.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;
  background: transparent;
}
.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;
}

/* 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 */
.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;
}

/* 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) 1 both;
}
.rotateHint.is-toPortrait .rotateHint__animInner::before{
  transform: translate(-50%,-50%) rotate(-90deg);
  animation: rotateHintLandscapeToPortraitRight 1.55s cubic-bezier(.2,.95,.25,1) 1 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;
}

/* Click zones (half screen) */
.lbZone{
  position:absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
}
.lbZone--left{ left: 0; }
.lbZone--right{ right: 0; }

/* 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--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>"); }
.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>"); }
/* 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--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>"); }
.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--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>"); }
.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>"); }

/* 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);
}
.floatbtn:active{ }
@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: 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);
  }
  /* 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: 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);
  }
}

/* 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: 100;
  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__bg{
  position: absolute;
  inset: 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%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.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;
}
.modal__close{
  flex-shrink: 0;
}

/* Formularz ustawień */
.settings-form{
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-field{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-label{
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.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-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;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.iconbtn--primary{
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.iconbtn--primary:hover{
  background: rgba(191,255,0,.9);
}

/* 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);
}

/* 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;
  }
}
