.dialog-backdrop {
  position: fixed;
  inset: 0;
  /* Darker scrim + a soft blur so the modal reads as floating above a dimmed app. */
  background: rgba(6, 9, 14, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 100;
  animation: dialog-backdrop-in 120ms ease-out;
}

.dialog {
  width: 100%;
  max-width: var(--login-card-width);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: dialog-in 140ms ease-out;
}

@keyframes dialog-backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog-backdrop,
  .dialog {
    animation: none;
  }
}

/* Wider variant — for content (attachments) that needs more than the default
   form-card width. */
.dialog-wide {
  max-width: 760px;
}

.dialog-title {
  margin: 0;
  font-size: var(--font-size-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
}

/* A standard modal footer: a full-width, right-aligned button row separated
   from the body by a hairline rule and top spacing. Works for both the Dialog's
   built-in footer (which sits below .dialog-body, separated by the dialog's own
   gap) and the form-rendered footers in CreatePageModal/CreateFolderModal
   (which sit flush inside a <form> in .dialog-body and rely on this border +
   padding for separation). align-items:center keeps 1- and 2-button rows tidy. */
.dialog-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.dialog-footer .btn {
  min-height: var(--hit-min-height);
}
