.portal-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(3 18 13 / 78%);
}
.portal-popup-dialog {
  position: relative;
  display: flex;
  width: min(760px, 100%);
  max-height: min(92vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 38%);
}
.portal-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #10231c;
  background: #fff;
  box-shadow: 0 2px 12px rgb(0 0 0 / 38%);
  font: 700 30px/1 system-ui, sans-serif;
  cursor: pointer;
}
.portal-popup-close:focus-visible,
.portal-popup-controls button:focus-visible,
.portal-popup-open:focus-visible {
  outline: 3px solid #10b981;
  outline-offset: 3px;
}
.portal-popup-content {
  display: grid;
  min-height: 160px;
  flex: 1;
  place-items: center;
  overflow: auto;
  background: #f2f5f3;
}
.portal-popup-content img {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
.portal-popup-dialog.portal-popup-ad {
  width: max-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 24px 80px rgb(0 0 0 / 38%);
}
.portal-popup-ad .portal-popup-ad-content {
  position: relative;
  display: block;
  min-height: 0;
  flex: none;
  overflow: visible;
  background: transparent;
}
.portal-popup-ad .portal-popup-content img {
  width: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  object-fit: contain;
}
.portal-popup-ad .portal-popup-close {
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 85%);
  color: #fff;
  background: rgb(3 18 13 / 76%);
  box-shadow: 0 2px 12px rgb(0 0 0 / 45%);
  font-size: 28px;
}
.portal-popup-dialog.portal-popup-instructions {
  width: max-content;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  align-items: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.portal-popup-instructions .portal-popup-content {
  position: relative;
  display: grid;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  flex: none;
  place-items: center;
  overflow: visible;
  background: transparent;
}
.portal-popup-instructions .portal-popup-content img {
  width: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(92vh - 76px);
  object-fit: contain;
}
.portal-popup-instructions .portal-popup-content iframe {
  width: min(760px, calc(100vw - 32px));
  height: min(65vh, 700px);
  max-height: calc(92vh - 76px);
}
.portal-popup-instructions .portal-popup-close {
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 85%);
  color: #fff;
  background: rgb(3 18 13 / 76%);
  box-shadow: 0 2px 12px rgb(0 0 0 / 45%);
  font-size: 28px;
}
.portal-popup-instructions .portal-popup-controls {
  min-height: 0;
  flex: none;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 0;
}
.portal-popup-instructions .portal-popup-controls button {
  min-width: 88px;
  min-height: 40px;
}
.portal-popup-content iframe {
  display: block;
  width: 100%;
  height: min(65vh, 700px);
  border: 0;
  background: #fff;
}
.portal-popup-open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: #0b3d2e;
  font-weight: 700;
  text-decoration: none;
}
.portal-popup-details {
  padding: 17px 20px 10px;
  color: #17332a;
}
.portal-popup-details h2 {
  margin: 0 48px 6px 0;
  font-size: 1.1rem;
}
.portal-popup-details p {
  margin: 0;
  color: #51665d;
  white-space: pre-wrap;
}
.portal-popup-controls {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 16px;
}
.portal-popup-controls button {
  min-width: 92px;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #0b3d2e;
  font-weight: 700;
}
.portal-popup-controls button:disabled {
  color: #6f8078;
  background: #e3e9e5;
}
.portal-popup-count {
  color: #51665d;
  font-size: .9rem;
  font-weight: 700;
}
.portal-popup-error {
  padding: 30px;
  color: #51665d;
  text-align: center;
}
@media (max-width: 520px) {
  .portal-popup-backdrop { padding: 8px; }
  .portal-popup-dialog { max-height: 94vh; border-radius: 14px; }
  .portal-popup-close { top: 8px; right: 8px; width: 48px; height: 48px; }
  .portal-popup-content img { max-height: 59vh; }
  .portal-popup-content iframe { height: 59vh; }
  .portal-popup-controls { padding-inline: 14px; }
  .portal-popup-dialog.portal-popup-ad { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .portal-popup-ad .portal-popup-content img { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .portal-popup-instructions .portal-popup-content img { max-width: calc(100vw - 16px); max-height: calc(94vh - 64px); }
  .portal-popup-instructions .portal-popup-content iframe { width: calc(100vw - 16px); height: calc(94vh - 64px); max-height: calc(94vh - 64px); }
  .portal-popup-instructions .portal-popup-controls { padding: 8px 0 0; }
  .portal-popup-instructions .portal-popup-controls button { min-width: 78px; }
}
