/* ---------- Demo dialog ---------- */
.demo {
  width: min(420px, calc(100vw - 32px));
  height: min(860px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: var(--border-w) solid var(--color-ink);
  border-radius: var(--radius-lg);
  background: var(--color-cream);
  box-shadow: 0 12px 0 0 var(--color-blush);
  overflow: hidden;
}

.demo::backdrop {
  background: rgba(42, 30, 44, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.demo__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-ink);
  color: var(--color-cream);
}

.demo__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font: 600 16px/1.2 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo__pick {
  flex: none;
}

.demo__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-cream);
  border-radius: 50%;
  background: transparent;
  color: var(--color-cream);
  font-size: 20px;
  line-height: 1;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    rotate 0.3s var(--ease-spring);
}

.demo__close:hover {
  background: var(--color-cream);
  color: var(--color-ink);
  rotate: 90deg;
}

.demo__stage {
  position: relative;
  height: calc(100% - 60px);
  background: var(--color-paper);
}

.demo__stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.demo__stage.is-ready iframe {
  opacity: 1;
}

.demo__wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--mute);
  font-size: 14px;
}

.demo__stage.is-ready .demo__wait {
  display: none;
}

@media (max-width: 480px) {
  .demo {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}
