.rt-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 10, 18, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.rt-modal.is-open,
.rt-modal.show {
  display: flex;
}

.rt-modal.is-closing {
  display: flex;
}

@keyframes rtFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rtFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

.rt-modal.is-open,
.rt-modal.show {
  animation: none;
}

.rt-modal.is-closing {
  animation: none;
}

@media (max-width: 640px) {
  .rt-modal.is-open,
  .rt-modal.show,
  .rt-modal.is-closing {
    margin: 0 -1px;
  }
}

.rt-modal-content,
.rt-modal-dialog {
  width: 100%;
  max-height: 85vh;
  border: 0;
  border-radius: 0;
  background: var(--rt-surface-solid);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  will-change: opacity, transform;
}

.rt-modal.is-open .rt-modal-content,
.rt-modal.show .rt-modal-content {
  opacity: 1;
  transform: translateY(0);
}

.rt-modal.is-open .rt-modal-content,
.rt-modal.show .rt-modal-content {
  animation: rtFadeIn 0.22s ease both;
}

.rt-modal.is-closing .rt-modal-content {
  animation: rtFadeOut 0.18s ease both;
}

/* Size variants */
.rt-modal-sm .rt-modal-content {
  max-width: 420px;
}

.rt-modal-md .rt-modal-content {
  max-width: 600px;
}

.rt-modal-lg .rt-modal-content {
  max-width: 820px;
}

.rt-modal-xl .rt-modal-content {
  max-width: 1080px;
}

.rt-modal-fullscreen .rt-modal-content {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
}

.rt-modal-fullscreen {
  padding: 0;
}

.rt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--rt-border);
  background: linear-gradient(
    135deg,
    rgba(var(--rt-primary-rgb), 0.08),
    rgba(0, 184, 255, 0.04)
  );
}

.rt-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.rt-modal-subtitle {
  margin: 6px 0 0;
  color: var(--rt-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.rt-modal-embed,
.rt-modal-embed {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rt-border);
  background: var(--rt-surface-solid);
  min-height: 220px;
  aspect-ratio: 16 / 9;
}

.rt-modal-embed--map,
.rt-modal-embed--map {
  aspect-ratio: 4 / 3;
  min-height: 260px;
}

.rt-modal-embed--video,
.rt-modal-embed--video {
  min-height: 280px;
}

.rt-modal-iframe,
.rt-modal-embed iframe,
.rt-modal-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.rt-modal-close,
.rt-modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--rt-border);
  border-radius: 0;
  background: var(--rt-surface);
  color: var(--rt-text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.rt-modal-close::before,
.rt-modal-close::after,
.rt-modal-close::before,
.rt-modal-close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 0;
  background: currentColor;
}

.rt-modal-close::before,
.rt-modal-close::before {
  transform: rotate(45deg);
}

.rt-modal-close::after,
.rt-modal-close::after {
  transform: rotate(-45deg);
}

.rt-modal-close:hover,
.rt-modal-close:hover {
  background: rgba(var(--rt-primary-rgb), 0.08);
  color: var(--rt-primary);
}

.rt-modal-close svg,
.rt-modal-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.rt-modal-body {
  padding: 20px 22px;
  overflow: auto;
  flex: 1;
}

.rt-modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--rt-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.rt-modal-open {
  overflow: hidden;
}

