.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1200;
  max-height: 90vh;
  flex-direction: column;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.modal-card--compact {
  max-width: 520px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 18px;
}

.modal-body {
  overflow-y: auto;
  padding-bottom: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  z-index: 2;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .modal {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-card {
    border-radius: 22px 22px 0 0;
    padding: 16px;
  }
}
