.zoeyswipe {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: 1fr;
  background: #000;
  color: #fff;
  overscroll-behavior: contain;
  touch-action: none;
}

.zoeyswipe[hidden] { display: none; }

.zoeyswipe-stage {
  position: absolute;
  inset: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.zoeyswipe[data-filmstrip="off"] .zoeyswipe-stage,
.zoeyswipe[data-zoomed="true"] .zoeyswipe-stage { bottom: 0; }

.zoeyswipe-image {
  display: block;
  width: 100%;
  height: 100%;
  object-position: center center;
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center center;
  will-change: transform;
  transition: transform 180ms ease-out;
}

.zoeyswipe.is-interacting .zoeyswipe-image { transition: none; }
.zoeyswipe[data-mode="cover"] .zoeyswipe-image { object-fit: cover; }
.zoeyswipe[data-mode="contain"] .zoeyswipe-image { object-fit: contain; }
.zoeyswipe[data-zoomed="true"][data-align="top"] .zoeyswipe-image { object-position: center top; }

.zoeyswipe:not([data-zoomed="true"]) .zoeyswipe-align,
.zoeyswipe[data-mode="contain"] .zoeyswipe-align { display: none; }

.zoeyswipe-progress {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  left: max(8px, env(safe-area-inset-left));
  z-index: 5;
  display: flex;
  height: 3px;
  gap: 2px;
  pointer-events: none;
}

.zoeyswipe-progress-segment {
  flex: 1 1 0;
  min-width: 1px;
  height: 3px;
  background: rgb(255 255 255 / 24%);
}

.zoeyswipe-progress-segment.complete,
.zoeyswipe-progress-segment.active { background: #fff; }

.zoeyswipe-progress-line {
  position: relative;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgb(255 255 255 / 24%);
}

.zoeyswipe-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
  transition: width 150ms ease-out;
}

.zoeyswipe-toolbar {
  position: absolute;
  top: calc(max(6px, env(safe-area-inset-top)) + 8px);
  right: max(8px, env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  gap: 2px;
}

.zoeyswipe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: #fff;
  background: rgb(0 0 0 / 35%);
  cursor: pointer;
  -webkit-appearance: none;
}

.zoeyswipe-button:hover,
.zoeyswipe-button:focus-visible {
  background: rgb(255 255 255 / 16%);
  outline: none;
}

.zoeyswipe-button svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.zoeyswipe-hit {
  position: absolute;
  top: 0;
  bottom: 76px;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 50%;
  height: auto;
  padding: 12px;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.zoeyswipe-hit:hover,
.zoeyswipe-hit:active,
.zoeyswipe-hit:focus { background: transparent !important; }

.zoeyswipe-hit:focus-visible {
  outline: 2px solid rgb(255 255 255 / 70%);
  outline-offset: -4px;
}

.zoeyswipe-prev { left: 0; justify-content: flex-start; }
.zoeyswipe-next { right: 0; justify-content: flex-end; }

.zoeyswipe-hit svg {
  width: 34px;
  height: 34px;
  opacity: 0;
  filter: drop-shadow(0 1px 3px #000);
  transition: opacity 250ms;
}

.zoeyswipe.show-hints .zoeyswipe-hit svg { opacity: 0.9; }
.zoeyswipe[data-filmstrip="off"] .zoeyswipe-hit { bottom: 0; }
.zoeyswipe[data-zoomed="true"] .zoeyswipe-hit { bottom: 0; cursor: grab; }
.zoeyswipe.is-interacting[data-zoomed="true"] .zoeyswipe-hit { cursor: grabbing; }

.zoeyswipe-filmstrip {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgb(0 0 0 / 40%);
  scrollbar-color: rgb(255 255 255 / 35%) transparent;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.zoeyswipe[data-filmstrip="off"] .zoeyswipe-filmstrip,
.zoeyswipe[data-zoomed="true"] .zoeyswipe-filmstrip { display: none; }

.zoeyswipe-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.55;
  background: #111;
  cursor: pointer;
  -webkit-appearance: none;
}

.zoeyswipe-thumb.active { opacity: 1; }

.zoeyswipe-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.zoeyswipe-locked,
html.zoeyswipe-locked body {
  height: 100%;
  overflow: hidden;
}

@media (max-width: 600px) {
  .zoeyswipe-stage { bottom: 62px; }

  .zoeyswipe[data-filmstrip="off"] .zoeyswipe-stage,
  .zoeyswipe[data-zoomed="true"] .zoeyswipe-stage { bottom: 0; }

  .zoeyswipe-hit { bottom: 62px; }

  .zoeyswipe[data-filmstrip="off"] .zoeyswipe-hit,
  .zoeyswipe[data-zoomed="true"] .zoeyswipe-hit { bottom: 0; }

  .zoeyswipe-toolbar {
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(62px + max(8px, env(safe-area-inset-bottom)));
    flex-direction: column;
  }

  .zoeyswipe[data-filmstrip="off"] .zoeyswipe-toolbar,
  .zoeyswipe[data-zoomed="true"] .zoeyswipe-toolbar {
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .zoeyswipe-thumb { width: 58px; height: 58px; }
  .zoeyswipe-button { width: 42px; height: 42px; }
}
