.modal-mask {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  background: rgba(15, 44, 71, 0.46);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-mask.modal-visible .modal-dialog {
  animation: billModalIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.modal-mask.modal-hidden .modal-dialog {
  animation: billModalOut 0.12s ease forwards;
}

.modal-mask .modal-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  margin: auto;
  pointer-events: none;
  min-height: 0;
}

.modal-mask .modal-dialog.modal-sm {
  max-width: 360px;
}

.modal-mask .modal-dialog.modal-lg {
  max-width: 860px;
}

.modal-mask .modal-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 28px 60px -24px rgba(14, 116, 144, 0.45),
    0 0 0 1px rgba(150, 190, 215, 0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #12324f;
}

.modal-mask .bill-modal-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.modal-mask .bill-modal-shell--no-header {
  grid-template-rows: minmax(0, 1fr) auto;
}

.modal-mask .modal-header {
  flex: 0 0 auto;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(150, 190, 215, 0.45);
  background: rgba(241, 248, 252, 0.72);
}

.modal-mask .modal-header .modal-title,
.modal-mask .modal-header h4 {
  margin: 0;
  padding: 0;
  color: #0f2c47;
  font-size: 1.03rem;
  font-weight: 850;
  line-height: 1.35;
}

.modal-mask .modal-body {
  overflow-x: hidden;
  overflow-y: hidden;
  min-height: 0;
  max-height: 100%;
  padding: 1.1rem 1.15rem 1.15rem;
  background: rgba(255, 255, 255, 0.35);
}

.modal-mask .modal-body.modal-body--scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-mask .modal-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0.85rem 1.15rem 1rem;
  border-top: 1px solid rgba(150, 190, 215, 0.45);
  background: rgba(241, 248, 252, 0.55);
}

.modal-mask .modal-footer > :not(:first-child) {
  margin-left: 0;
}

.modal-mask .modal-footer > :not(:last-child) {
  margin-right: 0;
}

@keyframes billModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes billModalOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

@media (max-width: 575.98px) {
  .modal-mask {
    padding: 0.75rem;
  }

  .modal-mask .modal-dialog,
  .modal-mask .modal-dialog.modal-sm,
  .modal-mask .modal-dialog.modal-lg {
    max-width: calc(100vw - 1.5rem);
  }

  .modal-mask .modal-body img.img-fluid,
  .modal-mask .modal-body img.img-responsive {
    max-height: 60vh;
    width: auto;
    object-fit: contain;
  }
}

@media (min-width: 576px) {
  .modal-mask {
    align-items: center;
    padding: 1.75rem;
  }

  .modal-mask .modal-dialog,
  .modal-mask .modal-content {
    max-height: calc(100vh - 3.5rem);
    max-height: calc(100dvh - 3.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-mask.modal-visible .modal-dialog,
  .modal-mask.modal-hidden .modal-dialog {
    animation: none;
  }
}
