:root {
  --menv-text-muted: #8895a7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
}

.menv-ba { padding: 4px; }

.menv-ba-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--menv-text-muted);
  font-size: 0.9rem;
}

.menv-ba-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  user-select: none;
  cursor: ew-resize;
}

.menv-ba-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* "Avoid cropping": the photos are shown whole, each over a blurred copy of
   itself. The copy goes past the frame so the blur doesn't fade at its edges. */
.menv-ba-frame.is-whole .menv-ba-img { object-fit: contain; }
.menv-ba-blur {
  position: absolute;
  top: -40px; left: -40px;
  width: calc(100% + 80px);
  max-width: none;
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(22px) brightness(0.8);
  pointer-events: none;
  visibility: hidden;
}
.menv-ba-frame.is-whole .menv-ba-blur { visibility: visible; }

.menv-ba-before-wrap {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}
/* The inner image's pixel width is set in JS to match the frame's full
   width (not the shrinking wrap's), so the crop reveals more/less of a
   fixed-size image instead of squishing it as the wrap resizes. */
.menv-ba-before-wrap .menv-ba-img {
  position: absolute;
  top: 0; left: 0;
  width: auto;
  max-width: none;
  height: 100%;
}

.menv-ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 0;
  border-left: 3px solid #ffffff;
  transform: translateX(-1.5px);
  z-index: 2;
}
.menv-ba-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #1a202c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.menv-ba-label {
  position: absolute;
  top: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;
}
.menv-ba-label-before { left: 12px; }
.menv-ba-label-after { right: 12px; }
