.sui-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1.5rem 1.5rem;
  z-index: 100;
  animation: fadeIn 0.18s ease both;
  overscroll-behavior: contain;
}

.sui-modal {
  /* Set our own font: the modal portals to <body>, so it can't inherit the
     app's font through the DOM (the portal's .portal-scope isn't an ancestor). */
  font-family: var(--font-sans);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow:
    0 1.25rem 3rem rgba(15, 23, 42, 0.35),
    0 0 0 1px var(--color-border-light);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 6.5rem);
  overflow: hidden;
  animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.sui-modal--sm {
  max-width: 24rem;
}
.sui-modal--md {
  max-width: 32rem;
}
.sui-modal--lg {
  max-width: 48rem;
}
.sui-modal--xl {
  max-width: 64rem;
}

.sui-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.125rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

.sui-modal__header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.sui-modal__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.sui-modal__sub {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--color-text-4);
}

.sui-modal__close {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-4);
  transition:
    background var(--motion-fast),
    color var(--motion-fast);
}

.sui-modal__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-1);
}

.sui-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.125rem 1.125rem;
  color: var(--color-text-2);
}

.sui-modal__footer {
  padding: 0.875rem 1.125rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
