/* View-owned dialogs are mounted under body so animated workspaces cannot clip them. */
body > :is(.quote-editor, .quote-client-editor, .order-editor, .product-editor)[data-modal-portal="body"] {
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  margin: 0;
  transform: none;
}

body > .product-editor[data-modal-portal="body"] {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

body > .product-editor[data-modal-portal="body"] .product-editor-body {
  grid-auto-rows: max-content;
  align-content: start;
}

body > .product-editor[data-modal-portal="body"] .product-presentations {
  min-height: 220px;
  align-self: start;
  overflow: visible;
}

.quote-editor-main,
.quote-editor-summary,
.quote-client-form-body,
.order-editor-body,
.product-editor-scroll,
.modal-dialog-scrollable .modal-body,
.maintainer-fields {
  scrollbar-width: thin;
  scrollbar-color: var(--do-brand) transparent;
}

.quote-editor-main::-webkit-scrollbar,
.quote-editor-summary::-webkit-scrollbar,
.quote-client-form-body::-webkit-scrollbar,
.order-editor-body::-webkit-scrollbar,
.product-editor-scroll::-webkit-scrollbar,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar,
.maintainer-fields::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.quote-editor-main::-webkit-scrollbar-thumb,
.quote-editor-summary::-webkit-scrollbar-thumb,
.quote-client-form-body::-webkit-scrollbar-thumb,
.order-editor-body::-webkit-scrollbar-thumb,
.product-editor-scroll::-webkit-scrollbar-thumb,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb,
.maintainer-fields::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--do-brand);
  background-clip: padding-box;
}

.do-dialog.maintainer-dialog {
  max-height: min(90dvh, 760px);
  overflow: hidden;
}

.maintainer-dialog > form {
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 760px);
  overflow: hidden;
}

.maintainer-dialog > form > header,
.maintainer-dialog > form > footer {
  flex: 0 0 auto;
}

.maintainer-fields {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#maintainer-duplicate-list {
  max-height: 45dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.swal2-container {
  z-index: 12000 !important;
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 1rem !important;
}

.swal2-popup.do-alert {
  width: min(500px, calc(100vw - 2rem));
  max-height: min(90dvh, 720px);
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid var(--do-border);
  border-radius: 18px;
  background: var(--do-surface);
  color: var(--bs-body-color);
  box-shadow: 0 28px 90px #0d1b3066;
}

.swal2-popup.do-alert.swal2-show {
  animation: do-alert-in .2s ease-out both !important;
}

.swal2-popup.do-alert.swal2-hide {
  animation: do-alert-out .15s ease-in both !important;
}

@keyframes do-alert-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes do-alert-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.do-alert .swal2-title {
  color: var(--bs-body-color);
  font-size: 1.3rem;
}

.do-alert .swal2-html-container {
  min-height: 0;
  overflow-y: auto;
  color: var(--do-muted);
  white-space: pre-line;
  scrollbar-width: thin;
  scrollbar-color: var(--do-brand) transparent;
}

.do-alert .swal2-input,
.do-alert .swal2-textarea {
  width: auto;
  margin: .8rem 1.5rem 0;
  border-color: var(--do-border);
  background: var(--do-bg);
  color: var(--bs-body-color);
  box-shadow: none;
}

.do-alert .swal2-validation-message {
  background: var(--do-danger-soft);
  color: var(--do-danger);
}

.do-alert-actions {
  flex: 0 0 auto;
  gap: .55rem;
  margin-top: 1rem;
}

.do-alert-actions .btn {
  margin: 0;
  min-width: 110px;
}

