.emgvp-app {
  --emgvp-bg: #f6f7f8;
  --emgvp-surface: #ffffff;
  --emgvp-ink: #19212a;
  --emgvp-muted: #66717d;
  --emgvp-line: #d9dee4;
  --emgvp-accent: #b32929;
  --emgvp-accent-hover: #8f2020;
  --emgvp-success: #23744b;
  color: var(--emgvp-ink);
  box-sizing: border-box;
}

.emgvp-shell {
  max-width: 1120px;
  margin: 0;
  padding: 0;
}

.emgvp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.emgvp-header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.emgvp-header p {
  margin: 8px 0 0;
  color: var(--emgvp-muted);
}

.emgvp-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.emgvp-image-count {
  color: var(--emgvp-muted);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.emgvp-passcode-form {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: min(100%, 620px);
}

.emgvp-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.emgvp-passcode-form input {
  min-height: 48px;
  border: 1px solid #b9c1ca;
  border-radius: 6px;
  padding: 0 14px;
  flex: 1 1 260px;
  min-width: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.emgvp-button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: var(--emgvp-accent);
  color: #fff;
  min-height: 46px;
  padding: 0 18px;
  flex: 0 0 auto;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.emgvp-button:hover,
.emgvp-button:focus-visible {
  background: var(--emgvp-accent-hover);
  color: #fff;
}

.emgvp-button-secondary {
  min-height: 40px;
  background: #26313d;
}

.emgvp-button-secondary:hover,
.emgvp-button-secondary:focus-visible {
  background: #111820;
}

.emgvp-notice {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.emgvp-notice-success {
  background: rgba(35, 116, 75, 0.12);
  border: 1px solid rgba(35, 116, 75, 0.24);
}

.emgvp-notice-error {
  background: rgba(179, 41, 41, 0.12);
  border: 1px solid rgba(179, 41, 41, 0.24);
}

.emgvp-masonry {
  column-count: 3;
  column-gap: 16px;
}

.emgvp-card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 16px;
  background: #fff;
  border: 1px solid var(--emgvp-line);
  border-radius: 8px;
  overflow: hidden;
}

.emgvp-card img {
  display: block;
  width: 100%;
  height: auto;
}

.emgvp-open-lightbox {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: zoom-in;
}

.emgvp-card-download {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--emgvp-accent);
  box-shadow: 0 4px 14px rgba(25, 33, 42, 0.18);
  text-decoration: none;
}

.emgvp-card-download svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emgvp-card-download:hover,
.emgvp-card-download:focus-visible {
  background: #fff;
  color: var(--emgvp-accent-hover);
}

.emgvp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 16, 0.9);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 999999;
}

.emgvp-lightbox[hidden] {
  display: none;
}

.emgvp-lightbox img {
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 48px);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.emgvp-lightbox-close,
.emgvp-lightbox-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.emgvp-lightbox-close {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.emgvp-lightbox-nav {
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translateY(-50%);
}

.emgvp-lightbox-prev {
  left: 18px;
}

.emgvp-lightbox-next {
  right: 18px;
}

.emgvp-lightbox-nav svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emgvp-lightbox-close:hover,
.emgvp-lightbox-close:focus-visible,
.emgvp-lightbox-nav:hover,
.emgvp-lightbox-nav:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.emgvp-no-scroll {
  overflow: hidden;
}

.emgvp-empty {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .emgvp-masonry {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .emgvp-header {
    flex-direction: column;
  }

  .emgvp-header h1 {
    font-size: 1.6rem;
  }

  .emgvp-header-actions {
    justify-content: flex-start;
  }

  .emgvp-passcode-form {
    flex-direction: column;
    align-items: stretch;
  }

  .emgvp-passcode-form input {
    flex-basis: auto;
  }

  .emgvp-masonry {
    column-count: 1;
  }

  .emgvp-lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .emgvp-lightbox-prev {
    left: 10px;
  }

  .emgvp-lightbox-next {
    right: 10px;
  }
}
