.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
}

.app-dialog-card {
  width: min(520px, calc(100vw - 28px));
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
}

.app-dialog-alert-card {
  width: min(440px, calc(100vw - 28px));
}

.app-dialog-header,
.app-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}

.app-dialog-header {
  justify-content: space-between;
  border-bottom: 1px solid #e8edf5;
}

.app-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid #e8edf5;
}

.app-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.app-dialog-message {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #475569;
  font: inherit;
  line-height: 1.4;
}

.app-dialog-alert-message {
  color: #1f2937;
}

.app-dialog-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.app-dialog-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

textarea.app-dialog-input {
  min-height: 96px;
  resize: vertical;
  line-height: 1.35;
}

.app-dialog-error {
  color: #b91c1c;
  font-size: 12px;
}

.app-dialog-icon-btn,
.app-dialog-secondary,
.app-dialog-primary {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 7px 12px;
  cursor: pointer;
  font: inherit;
}

.app-dialog-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.app-dialog-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

@media (max-width: 640px) {
  .app-dialog-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .app-dialog-card {
    width: 100%;
    max-height: 88vh;
  }
}
