.rc-demo-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-width: 1040px;
  max-height: min(92vh, 900px);
  max-height: min(92dvh, 900px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border, #e8e4f2);
  border-radius: 16px;
  background: #fff;
  color: var(--foreground, #09090b);
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(9, 9, 11, 0.45);
}

.rc-demo-dialog:not([open]) {
  display: none;
}

.rc-demo-dialog[open] {
  display: flex;
  flex-direction: column;
  height: min(88vh, 860px);
  height: min(88dvh, 860px);
}

.rc-demo-dialog::backdrop {
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.rc-demo-dialog__panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.rc-demo-dialog__bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--border, #e8e4f2);
  background: #fff;
}

.rc-demo-dialog__title {
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground, #09090b);
}

.rc-demo-dialog__note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted-foreground, #615e6e);
}

.rc-demo-dialog__close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border, #e8e4f2);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-foreground, #615e6e);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-in-out, ease), color 0.15s var(--ease-in-out, ease);
}

.rc-demo-dialog__close:hover {
  background: var(--muted, #f2f0f9);
  color: var(--foreground, #09090b);
}

.rc-demo-dialog__close:focus-visible {
  outline: 3px solid var(--brand-vivid, #bf00e5);
  outline-offset: 2px;
}

.rc-demo-dialog__close svg {
  width: 18px;
  height: 18px;
}

/* The embedded form: its own scroll container, its own document. */
.rc-demo-dialog__frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

/* Fallback when a browser cannot open a modal dialog: the page navigates to
   /demo.html instead, so this class is only used for the scroll lock. */
html.rc-demo-dialog-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: no-preference) {
  .rc-demo-dialog[open] {
    animation: rc-demo-dialog-in 0.18s ease-out;
  }
}

@keyframes rc-demo-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -----------------------------------------------------------------------------
   Phones — full-screen sheet so the form keeps the whole viewport
   -------------------------------------------------------------------------- */
@media (max-width: 639.98px) {
  .rc-demo-dialog[open] {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .rc-demo-dialog__bar {
    padding: 10px 10px 10px 16px;
  }

  .rc-demo-dialog__note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rc-demo-dialog__close {
    transition: none;
  }
}

@media print {
  .rc-demo-dialog {
    display: none !important;
  }
}
