.zcu-topbar {
  height: 72px;
  grid-template-columns: minmax(190px, 230px) minmax(240px, 1fr) auto;
  gap: 16px;
}

.zcu-top-actions {
  min-width: 0;
  flex-wrap: nowrap;
}

.zcu-top-actions button,
.zcu-top-actions > a {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  line-height: 1;
  white-space: nowrap;
}

.zcu-top-actions .zcu-publish {
  min-width: 132px;
  height: 44px;
  line-height: 1.35;
  white-space: nowrap;
}

.zcu-document-name,
.zcu-document-name input {
  min-width: 0;
}

.zcu-stage {
  height: calc(100vh - 72px);
}

.zcu-media-block--gallery .zcu-media-list,
.zc-qr-page__gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 74px;
  gap: 10px;
}

.zcu-media-block--gallery .zcu-media-list figure,
.zc-qr-page__gallery figure {
  grid-column: span 4;
  grid-row: span 2;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--zc-media-radius, 16px);
  background: #eef2f6;
}

.zcu-media-block--gallery .zcu-media-list figure:first-child,
.zc-qr-page__gallery figure:first-child {
  grid-column: span 8;
  grid-row: span 4;
}

.zcu-media-block--gallery .zcu-media-list figure:nth-child(6n+4),
.zc-qr-page__gallery figure:nth-child(6n+4) {
  grid-column: span 6;
  grid-row: span 3;
}

.zcu-media-block--gallery .zcu-media-list figure:nth-child(6n+5),
.zc-qr-page__gallery figure:nth-child(6n+5) {
  grid-column: span 6;
  grid-row: span 3;
}

.zcu-media-block--gallery .zcu-media-list img,
.zc-qr-page__gallery img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
}

.zc-qr-page__gallery figure:hover img {
  transform: scale(1.035);
  filter: saturate(1.06) contrast(1.02);
}

.zc-qr-page__gallery figcaption {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(15, 23, 42, .72));
  color: #fff;
  text-align: right;
}

.zc-qr-page__gallery figure {
  position: relative;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .1);
}

.zc-qr-page__gallery[data-count="1"] {
  display: block;
}

.zc-qr-page__gallery[data-count="1"] figure {
  width: min(100%, 640px);
  margin-inline: auto;
}

.zc-qr-page__gallery[data-count="1"] img {
  height: auto;
  max-height: 72vh;
  object-fit: contain;
}

.zc-qr-page__gallery[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
}

.zc-qr-page__gallery[data-count="2"] figure,
.zc-qr-page__gallery[data-count="2"] figure:first-child {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 4 / 5;
}

.zc-qr-page__gallery[data-count="3"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(150px, 1fr));
}

.zc-qr-page__gallery[data-count="3"] figure,
.zc-qr-page__gallery[data-count="3"] figure:nth-child(n) {
  grid-column: 2;
  grid-row: auto;
}

.zc-qr-page__gallery[data-count="3"] figure:first-child {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.zc-qr-gallery__item {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}

.zc-qr-gallery__item:focus-visible {
  outline: 4px solid var(--zc-page-accent, #126782);
  outline-offset: 4px;
}

.zc-qr-gallery__zoom {
  position: absolute;
  inset: 12px 12px auto auto;
  display: inline-flex;
  min-width: 64px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(15, 23, 42, .76);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(8px);
}

.zc-qr-gallery__item:hover .zc-qr-gallery__zoom,
.zc-qr-gallery__item:focus-visible .zc-qr-gallery__zoom {
  opacity: 1;
  transform: translateY(0);
}

.pswp {
  --pswp-bg: #080d19;
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: #111827;
  direction: ltr;
}

.pswp__button {
  width: 48px;
  height: 48px;
}

.pswp__counter {
  min-width: 84px;
  padding-inline: 16px;
  direction: rtl;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  opacity: .9;
}

.pswp__zc-caption {
  position: absolute;
  z-index: 10;
  inset: auto 50% 18px auto;
  max-width: min(760px, calc(100vw - 32px));
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(8, 13, 25, .72);
  color: #fff;
  direction: rtl;
  font-family: inherit;
  line-height: 1.8;
  text-align: center;
  transform: translateX(50%);
  backdrop-filter: blur(12px);
}

@media (max-width: 1100px) {
  .zcu-topbar {
    grid-template-columns: minmax(160px, 200px) minmax(190px, 1fr) auto;
    gap: 10px;
    padding-inline: 12px;
  }

  .zcu-view-page span:last-child {
    display: none;
  }
}

@media (max-width: 900px) {
  .zcu-topbar {
    height: 62px;
    grid-template-columns: auto minmax(110px, 1fr) auto;
    gap: 6px;
  }

  .zcu-stage {
    height: calc(100vh - 62px);
  }

  .zcu-top-actions button,
  .zcu-top-actions > a {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
  }

  .zcu-top-actions .zcu-publish {
    width: auto;
    min-width: 82px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .zcu-top-actions [data-settings] span:first-child,
  .zcu-view-page span:first-child {
    display: inline;
  }
}

@media (max-width: 600px) {
  .zcu-media-block--gallery .zcu-media-list,
  .zc-qr-page__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 118px;
    gap: 7px;
  }

  .zcu-media-block--gallery .zcu-media-list figure,
  .zc-qr-page__gallery figure,
  .zcu-media-block--gallery .zcu-media-list figure:nth-child(n),
  .zc-qr-page__gallery figure:nth-child(n) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .zcu-media-block--gallery .zcu-media-list figure:first-child,
  .zc-qr-page__gallery figure:first-child {
    grid-column: 1 / -1;
    grid-row: span 2;
  }

  .zc-qr-page__gallery[data-count="1"] {
    display: block;
  }

  .zc-qr-page__gallery[data-count="1"] figure {
    width: 100%;
  }

  .zc-qr-page__gallery[data-count="1"] figure:first-child {
    grid-column: auto;
    grid-row: auto;
  }

  .zc-qr-page__gallery[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .zc-qr-page__gallery[data-count="2"] figure,
  .zc-qr-page__gallery[data-count="2"] figure:first-child {
    grid-column: span 1;
    grid-row: span 1;
  }

  .zc-qr-page__gallery[data-count="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 180px 118px;
  }

  .zc-qr-page__gallery[data-count="3"] figure:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .zc-qr-page__gallery[data-count="3"] figure:nth-child(2),
  .zc-qr-page__gallery[data-count="3"] figure:nth-child(3) {
    grid-column: auto;
    grid-row: 2;
  }

  .zc-qr-gallery__zoom {
    inset: 8px 8px auto auto;
    min-width: 52px;
    min-height: 32px;
    opacity: 1;
    transform: none;
  }

  .pswp__zc-caption {
    bottom: 12px;
    border-radius: 14px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zcu-media-block--gallery img,
  .zc-qr-page__gallery img {
    transition: none;
  }

  .zc-qr-gallery__zoom {
    transition: none;
  }
}
